Important:
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
A version of this page is also available for
4/8/2010

This function blocks the debugger thread until a debug event is generated in the target process being debugged or the specified timeout elapses.

Syntax

BOOL WaitForDebugEvent(
  LPDEBUG_EVENT 
lpDebugEvent, 
  DWORD 
dwMilliseconds 
);

Parameters

Parameter Description

lpDebugEvent

[in] Pointer to a DEBUG_EVENTstructure that is filled with information about the debugging event.

dwMilliseconds

[in] Number of milliseconds to wait for a debugging event. The following table shows expected return values:

Value Result

0

Tests for a debugging event and returns immediately.

INFINITE

Returns after a debugging event has occurred.

Other

Returns 0. GetLastErrorindicates WAIT_TIMEOUT.

Return Value

Nonzero indicates success.

Zero indicates failure.

To get extended error information, call GetLastError.

Remarks

Only the thread that created the process being debugged can call WaitForDebugEvent.

There is a 64 (MAXIMUM_WAIT_OBJECTS) thread limit for WaitForDebugEvent, which means that the maximum threads that can be debugged per-process is 64.

This call translates to the read API call of the debug message queue with the specified timeout value.

Requirements

Header winbase.h
Library coredll.lib, Nk.lib
Windows Embedded CE Windows CE 2.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also