Debugging Tools for Windows

GetModuleByModuleName

The GetModuleByModuleName and GetModuleByModuleNameWide methods search through the target's modules for one with the specified name.

HRESULT
  IDebugSymbols::GetModuleByModuleName(
    IN PCSTR  Name,
    IN ULONG  StartIndex,
    OUT OPTIONAL PULONG  Index,
    OUT OPTIONAL PULONG64  Base
    );

HRESULT
  IDebugSymbols::GetModuleByModuleNameWide(
    IN PCWSTR  Name,
    IN ULONG  StartIndex,
    OUT OPTIONAL PULONG  Index,
    OUT OPTIONAL PULONG64  Base
    );

#ifdef UNICODE
#define GetModuleByModuleNameT GetModuleByModuleNameWide
#else
#define GetModuleByModuleNameT GetModuleByModuleName
#endif

Parameters

Name
Specifies the name of the desired module.
StartIndex
Specifies the index to start searching from.
Index
Receives the index of the first module with the name Name. If Index is NULL, this information is not returned.
Base
Receives the location in the target's memory address space of the base of the module. If Base is NULL, this information is not returned.

Return Value

S_OK
The method was successful.
E_INVALIDARG
One of the arguments passed in was invalid.

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

Interface Version

GetModuleByModuleName is available in all versions of IDebugSymbols. GetModuleByModuleNameWide is available in IDebugSymbols3 and later versions.

Comments

Starting at the specified index, these methods return the first module they find with the specified name. If the target has more than one module with this name, then subsequent modules can be found by repeated calls to these methods with higher values of StartIndex.

For more information about modules, see Modules.

Requirements

Headers: Defined in Dbgeng.h. Include Dbgeng.h.

See Also

GetModuleByModuleName2

Build machine: CAPEBUILD