Debugging Tools for Windows |
The WaitForEvent method waits for an event that breaks into the debugger engine application.
HRESULT
IDebugControl::WaitForEvent(
IN ULONG Flags,
IN ULONG Timeout
);
This method may return other error values and the above error values may have additional meanings. See Return Values for more details.
WaitForEvent is available in all versions of IDebugControl.
The method can be called only from the thread that started the debugger session.
When an event occurs, the debugger engine will process the event and call the event callbacks. If one of these callbacks indicates that the event should break into the debugger engine application (by returning DEBUG_STATUS_BREAK), this method will return; otherwise, it will continue waiting for an event. The event filters can also specify that an event should break into the debugger engine application. For more information about event filters, see Controlling Exceptions and Events.
This method is not re-entrant. Once it has been called, it can not be called again on any client until it has returned. In particular, it can not be called from the event callbacks, including extensions and commands executed by the callbacks.
If none of the targets are capable of generating events — for example, all the targets have exited — this method will end the current session, discard the targets, and then return E_UNEXPECTED.
For more information about using WaitForEvent to control the execution flow of the debugger application and targets, see Debugging Session and Execution Model. For details on the event callbacks, see Monitoring Events.
Headers: Defined in Dbgeng.h. Include Dbgeng.h. The constant INFINITE is defined in Winbase.h.