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

DEBUG_EVENT (Structures)
 
.
Summary
Used by WaitForDebugEvent. Not tested in 64bit environments.

C# Definition:

[StructLayout(LayoutKind.Sequential)]

public struct DEBUG_EVENT

{

  public DebugEventType dwDebugEventCode;
  public int dwProcessId;
  public int dwThreadId;

  [MarshalAs(UnmanagedType.ByValArray, SizeConst = 86, ArraySubType = UnmanagedType.U1)]
  byte[] debugInfo;

  public EXCEPTION_DEBUG_INFO Exception{
    get { return GetDebugInfo<EXCEPTION_DEBUG_INFO>(); }
  }

  public CREATE_THREAD_DEBUG_INFO CreateThread
  {
    get { return GetDebugInfo<CREATE_THREAD_DEBUG_INFO>(); }
  }

  public CREATE_PROCESS_DEBUG_INFO CreateProcessInfo
  {
    get { return GetDebugInfo<CREATE_PROCESS_DEBUG_INFO>(); }
  }

  public EXIT_THREAD_DEBUG_INFO ExitThread
  {
    get { return GetDebugInfo<EXIT_THREAD_DEBUG_INFO>(); }
  }

  public EXIT_PROCESS_DEBUG_INFO ExitProcess
  {
    get { return GetDebugInfo<EXIT_PROCESS_DEBUG_INFO>(); }
  }

  public LOAD_DLL_DEBUG_INFO LoadDll
  {
    get { return GetDebugInfo<LOAD_DLL_DEBUG_INFO>(); }
  }

  public UNLOAD_DLL_DEBUG_INFO UnloadDll
  {
    get { return GetDebugInfo<UNLOAD_DLL_DEBUG_INFO>(); }
  }

  public OUTPUT_DEBUG_STRING_INFO DebugString
  {
    get { return GetDebugInfo<OUTPUT_DEBUG_STRING_INFO>(); }
  }

  public RIP_INFO RipInfo
  {
    get { return GetDebugInfo<RIP_INFO>(); }
  }

  private T GetDebugInfo<T>() where T : struct
  {
    var structSize = Marshal.SizeOf(typeof(T));
    var pointer = Marshal.AllocHGlobal(structSize);
    Marshal.Copy(debugInfo, 0, pointer, structSize);

    var result = Marshal.PtrToStructure(pointer, typeof(T));
    Marshal.FreeHGlobal(pointer);
    return (T)result;
  }

}

User-Defined Field Types:

EXCEPTION_DEBUG_INFO CREATE_THREAD_DEBUG_INFO CREATE_PROCESS_DEBUG_INFO EXIT_THREAD_DEBUG_INFO EXIT_PROCESS_DEBUG_INFO LOAD_DLL_DEBUG_INFO UNLOAD_DLL_DEBUG_INFO OUTPUT_DEBUG_STRING_INFO RIP_INFO

Documentation
DEBUG_EVENT on MSDN

Please edit this page!

Do you have...

  • helpful tips?
  • corrections to the existing content?
  • alternate definitions?
  • additional languages you want to include?

Select "Edit This Page" on the right hand toolbar and edit it! Or add new pages containing any supporting types needed.

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