Debugging Tools for Windows

GetExtensionFunction

The GetExtensionFunction and GetExtensionFunctionWide methods return a pointer to an extension function from an extension library.

HRESULT
  IDebugControl::GetExtensionFunction(
    IN ULONG64  Handle,
    IN PCSTR  FuncName,
    OUT FARPROC *  Function
    );

HRESULT
  IDebugControl4::GetExtensionFunctionWide(
    IN ULONG64  Handle,
    IN PCWSTR  FuncName,
    OUT FARPROC *  Function
    );

#ifdef UNICODE
#define GetExtensionFunctionT GetExtensionFunctionWide
#else
#define GetExtensionFunctionT GetExtensionFunction
#endif

Parameters

Handle
Specifies the handle of the extension library that contains the extension function. If Handle is zero, the engine will walk the extension library chain searching for the extension function.
FuncName
Specifies the name of the extension function to return. When searching the extension libraries for the function, the debugger engine will prepend "_EFN_" to the name. For example, if FuncName is "SampleFunction", the engine will search the extension libraries for "_EFN_SampleFunction".
Function
Receives the extension function.

Return Value

S_OK
The method was successful.

This method can also return error values. See Return Values for more details.

Interface Version

GetExtensionFunction is available in all versions of IDebugControl. GetExtensionFunctionWide is available in IDebugControl4 and later versions.

Comments

Extension libraries are loaded into the host engine and extension functions cannot be called remotely. The current client must not be a debugging client, it must belong to the host engine.

The extension function can have any function prototype. In order for any program to call this extension function, the extension function should be cast to the correct prototype.

For more information on using extension functions, see Calling Extensions and Extension Functions.

Requirements

Headers: Defined in dbgeng.h. Include dbgeng.h.

See Also

AddExtension, CallExtension, GetExtensionByPath

Build machine: CAPEBUILD