Debugging Tools for Windows

WinDbgExtensionDllInit

The WinDbgExtensionDllInit callback function is used to load and initialize the extension module.

VOID
  WinDbgExtensionDllInit(
    PWINDBG_EXTENSION_APIS64  lpExtensionApis
    USHORT MajorVersion
    USHORT MinorVersion
    );

Parameters

lpExtensionApis
Receives a pointer to a WINDBG_EXTENSION_APIS64 structure. This structure contains the callbacks to functions that you can use to do standard operations. Save the pointer in a global variable named ExtensionApis.
MajorVersion
Specifies the Microsoft Windows build type. A value of 0xC indicates the checked build of Windows; a value of 0xF indicates the free build of Windows. Save this value in a global variable named SavedMajorVersion.
MinorVersion
Specifies the Windows build number of the target system. For example, 2600. Save this value in a global variable named SavedMinorVersion.

Return Value

None

Headers

You must define this function in your code using the prototype above. Include wdbgext.h.

Comments

WinDbgExtensionDllInit is called by the debugger when the extension DLL is loaded.

It is recommended that you always use 64-bit pointers in your code, since the debugger will automatically resize these pointers when necessary. See 32-Bit Pointers and 64-Bit Pointers for details. However, if you choose to use 32-bit pointers, the first parameter of WinDbgExtensionDllInit will have the type PWINDBG_EXTENSION_APIS instead of PWINDBG_EXTENSION_APIS64.

Additional Information

For more details, see Using WdbgExts Extension Callbacks.

Build machine: CAPEBUILD