Debugging Tools for Windows

GetModuleNames

The GetModuleNames and GetModuleNamesWide methods return the names of the specified module.

HRESULT
  IDebugSymbols::GetModuleNames(
    IN ULONG  Index,
    IN ULONG64  Base,
    OUT OPTIONAL PSTR  ImageNameBuffer,
    IN ULONG  ImageNameBufferSize,
    OUT OPTIONAL PULONG  ImageNameSize,
    OUT OPTIONAL PSTR  ModuleNameBuffer,
    IN ULONG  ModuleNameBufferSize,
    OUT OPTIONAL PULONG  ModuleNameSize,
    OUT OPTIONAL PSTR  LoadedImageNameBuffer,
    IN ULONG  LoadedImageNameBufferSize,
    OUT OPTIONAL PULONG  LoadedImageNameSize
    );

HRESULT
  IDebugSymbols3::GetModuleNamesWide(
    IN ULONG  Index,
    IN ULONG64  Base,
    OUT OPTIONAL PWSTR  ImageNameBuffer,
    IN ULONG  ImageNameBufferSize,
    OUT OPTIONAL PULONG  ImageNameSize,
    OUT OPTIONAL PWSTR  ModuleNameBuffer,
    IN ULONG  ModuleNameBufferSize,
    OUT OPTIONAL PULONG  ModuleNameSize,
    OUT OPTIONAL PWSTR  LoadedImageNameBuffer,
    IN ULONG  LoadedImageNameBufferSize,
    OUT OPTIONAL PULONG  LoadedImageNameSize
    );

#ifdef UNICODE
#define GetModuleNamesT GetModuleNamesWide
#else
#define GetModuleNamesT GetModuleNames
#endif

Parameters

Index
Specifies the index of the module whose names are requested. If it is set to DEBUG_ANY_ID, the module is specified by Base.
Base
Specifies the base address of the module whose names are requested. This parameter is only used if Index is set to DEBUG_ANY_ID.
ImageNameBuffer
Receives the image name of the module. If ImageNameBuffer is NULL, this information is not returned.
ImageNameBufferSize
Specifies the size in characters of the buffer ImageNameBuffer in characters.
ImageNameSize
Receives the size in characters of the image name. If ImageNameSize is NULL, this information is not returned.
ModuleNameBuffer
Receives the module name of the module. If ModuleNameBuffer is NULL, this information is not returned.
ModuleNameBufferSize
Specifies the size in characters of the buffer ModuleNameBuffer.
ModuleNameSize
Receives the size in characters of the module name. If ModuleNameSize is NULL, this information is not returned.
LoadedImageNameBuffer
Receives the loaded image name of the module. If LoadedImageNameBuffer is NULL, this information is not returned.
LoadedImageNameBufferSize
Specifies the size in characters of the buffer LoadedImageNameBuffer.
LoadedImageNameSize
Receives the size in characters of the loaded image name. If LoadedImageNameSize is NULL, this information is not returned.

Return Value

S_OK
The method was successful.
S_FALSE
The method was successful. However, at least one of ImageNameBuffer, ModuleNameBuffer, or LoadedImageNameBuffer was too small for the corresponding name, so it was truncated.
E_NOINTERFACE
The specified module was not found.

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

Interface Version

GetModuleNames is available in all versions of IDebugSymbols. GetModuleNamesWide is available in IDebugSymbols3 and later versions.

Comments

For more information about modules, see Modules.

Requirements

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

See Also

GetModuleNameString

Build machine: CAPEBUILD