Search
Module:
Directory

   Desktop Functions:

   Smart Device Functions:


Show Recent Changes
Subscribe (RSS)
Misc. Pages
Comments
FAQ
Helpful Tools
Playground
Suggested Reading
Website TODO List
Download Visual Studio Add-In

WaitForDebugEvent (kernel32)
 
.
Summary

C# Signature:

[DllImport( "kernel32.dll", EntryPoint = "WaitForDebugEvent" )]
[return : MarshalAs( UnmanagedType.Bool )]
public static extern bool WaitForDebugEvent(ref DEBUG_EVENT lpDebugEvent, uint dwMilliseconds );

User-Defined Types:

DEBUG_EVENT

Notes:

Wrapping WaitForDebugEvent is very hard, because you need to wrap DEBUG_EVENT, which is a large tagged variant structure. It's especially hard to make the wrappers work on both 32-bit and 64-bit because DEBUG_EVENT has different definitions on each platform.

Tips & Tricks:

Please add some!

Sample Code:

Please add some!

Alternative Managed API:

The Managed Debugger (MDbg) sample has a great set of wrappers for the native debug API that deal with problems like these.

See http://blogs.msdn.com/jmstall/archive/2006/07/05/managed-wrappers-for-native-debug-api.aspx for a quick example of what the wrappers look like.

You can download Mdbg at http://www.microsoft.com/downloads/details.aspx?familyid=38449a42-6b7a-4e28-80ce-c55645ab1310&displaylang=en and get the wrappers there.

(or if that link gets broken, you can find the latest info at http://blogs.msdn.com/jmstall/archive/2005/11/08/mdbg_linkfest.aspx)

In contrast, if you are trying to do managed-debugging (instead of just write a native debugger in C#), you need to use the managed debugging APIs (ICorDebug) instead of the native debugging APIs here.

Documentation

Please edit this page!

Do you have...

  • helpful tips or sample code to share for using this API in managed code?
  • corrections to the existing content?
  • variations of the signature you want to share?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing supporting types needed for this API (structures, delegates, and more).

 
Access PInvoke.net directly from VS:
Terms of Use
Edit This Page
Find References
Show Printable Version
Revisions