Using WdbgExts Extension Callbacks
Every WdbgExts extension DLL can export certain callback functions. Two of these are required; the third is optional:
- You must export a function named WinDbgExtensionDllInit. When the debugger loads an extension DLL, it first calls WinDbgExtensionDllInit and passes it several parameters, including a pointer to a WINDBG_EXTENSION_APIS64 structure. This structure contains the callbacks to functions that are exported by wdbgexts.h. This pointer should be saved in a global variable named ExtensionApis. The debugger also passes information about the Windows version to the WinDbgExtensionDllInit function.
- You must export a function called ExtensionApiVersion. The debugger calls this function and expects back a pointer to an API_VERSION structure that contains the version number of the extension DLL. The debugger uses this version number when executing commands like .chain and version that display the extension version number.
- You can optionally export a function called CheckVersion. The debugger calls this routine every time you use an extension command from DLL. This is used to print out version mismatch warnings when your DLL is of a slightly different version than the debugger, but not different enough to prevent it from running.
Build machine: CAPEBUILD