IDebugSymbols3::GetModuleByOffset2 method (dbgeng.h)

The GetModuleByOffset2 method searches through the process's modules for one whose memory allocation includes the specified location.

Syntax

HRESULT GetModuleByOffset2(
  [in]            ULONG64  Offset,
  [in]            ULONG    StartIndex,
  [in]            ULONG    Flags,
  [out, optional] PULONG   Index,
  [out, optional] PULONG64 Base
);

Parameters

[in] Offset

Specifies a location in the target's virtual address space which is inside the desired module's memory allocation -- for example, the address of a symbol belonging to the module.

[in] StartIndex

Specifies the index to start searching from.

[in] Flags

Specifies a bit-set containing options used when searching for the module with the specified location. Flags may contain the following bit-flags:

Flag Effect
DEBUG_GETMOD_NO_LOADED_MODULES Do not search the loaded modules.
DEBUG_GETMOD_NO_UNLOADED_MODULES Do not search the unloaded modules.

[out, optional] Index

Receives the index of the module. If Index is NULL, this information is not returned.

[out, optional] 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

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

Return code Description
S_OK
The method was successful.

Remarks

Starting at the specified index, this method returns the first module it finds whose memory allocation address range includes the specified location. If the target has more than one module whose memory address range includes this location, then subsequent modules can be found by repeated calls to this method with higher values of StartIndex.

For more information about modules, see Modules.

Requirements

Requirement Value
Target Platform Desktop
Header dbgeng.h (include Dbgeng.h)

See also

GetModuleByIndex

GetModuleByOffset

IDebugSymbols3