Skip to content

Latest commit

 

History

History
154 lines (114 loc) · 5.68 KB

nf-dbghelp-symgetmoduleinfo.md

File metadata and controls

154 lines (114 loc) · 5.68 KB
UID title description helpviewer_keywords old-location tech.root ms.assetid ms.date ms.keywords req.header req.include-header req.target-type req.target-min-winverclnt req.target-min-winversvr req.kmdf-ver req.umdf-ver req.ddi-compliance req.unicode-ansi req.idl req.max-support req.namespace req.assembly req.type-library req.lib req.dll req.irql targetos req.typenames req.redist ms.custom f1_keywords dev_langs topic_type api_type api_location api_name
NF:dbghelp.SymGetModuleInfo
SymGetModuleInfo function (dbghelp.h)
The SymGetModuleInfo function (dbghelp.h) retrieves the module information of the specified module.
SymGetModuleInfo
SymGetModuleInfo function
SymGetModuleInfo64
SymGetModuleInfo64 function
SymGetModuleInfoW
SymGetModuleInfoW64
_win32_symgetmoduleinfo64
base.symgetmoduleinfo64
dbghelp/SymGetModuleInfo
dbghelp/SymGetModuleInfo64
dbghelp/SymGetModuleInfoW
dbghelp/SymGetModuleInfoW64
base\symgetmoduleinfo64.htm
Debug
e8057cb5-3331-4460-b07c-4338a57024be
08/04/2022
SymGetModuleInfo, SymGetModuleInfo function, SymGetModuleInfo64, SymGetModuleInfo64 function, SymGetModuleInfoW, SymGetModuleInfoW64, _win32_symgetmoduleinfo64, base.symgetmoduleinfo64, dbghelp/SymGetModuleInfo, dbghelp/SymGetModuleInfo64, dbghelp/SymGetModuleInfoW, dbghelp/SymGetModuleInfoW64
dbghelp.h
Windows
SymGetModuleInfoW64 (Unicode) and SymGetModuleInfo64 (ANSI)
Dbghelp.lib
Dbghelp.dll
Windows
DbgHelp.dll 5.1 or later
19H1
SymGetModuleInfo
dbghelp/SymGetModuleInfo
c++
APIRef
kbSyntax
DllExport
Dbghelp.dll
SymGetModuleInfo64
SymGetModuleInfo64
SymGetModuleInfoW64
SymGetModuleInfo
SymGetModuleInfoW

SymGetModuleInfo function

-description

Retrieves the module information of the specified module.

-parameters

-param hProcess [in]

A handle to the process that was originally passed to the SymInitialize function.

-param dwAddr [in]

The virtual address that is contained in one of the modules loaded by the SymLoadModule64 function

-param ModuleInfo [out]

A pointer to an IMAGEHLP_MODULE64 structure. The SizeOfStruct member must be set to the size of the IMAGEHLP_MODULE64 structure. An invalid value will result in an error.

-returns

If the function succeeds, the return value is TRUE.

If the function fails, the return value is FALSE. To retrieve extended error information, call GetLastError.

-remarks

The module table is searched for a module that contains the dwAddr. The module is located based on the load address and size of each module. If a valid module is found, the ModuleInfo parameter is filled with the information about the module.

The size of the IMAGEHLP_MODULE64 structure used by this function has changed over the years. If a version of DbgHelp.dll is called that is older than the DbgHelp.h used to compile the calling code, then this function may fail with an error code of ERROR_INVALID_PARAMETER. This most commonly occurs when the system version (%WinDir%\System32\DbgHelp.dll) is called. Code that calls the system version of DbgHelp.dll must be compiled using the appropriate SDK for that Windows release or the SDK for a previous release.

The recommended model is to redistribute the required version of DbgHelp.dll along with the calling software. This allows the caller to use the most robust versions of DbgHelp.dll as well as a simplifying upgrades. The most recent version of DbgHelp.dll can always be found in the Debugging Tools for Windows package. As a general rule, code that is compiled to work with older versions will always work with newer versions.

All DbgHelp functions, such as this one, are single threaded. Therefore, calls from more than one thread to this function will likely result in unexpected behavior or memory corruption. To avoid this, you must synchronize all concurrent calls from more than one thread to this function.

To call the Unicode version of this function, define DBGHELP_TRANSLATE_TCHAR. SymGetModuleInfoW64 is defined as follows in DbgHelp.h.

BOOL
IMAGEAPI
SymGetModuleInfoW64(
    __in HANDLE hProcess,
    __in DWORD64 qwAddr,
    __out PIMAGEHLP_MODULEW64 ModuleInfo
    );

#ifdef DBGHELP_TRANSLATE_TCHAR
#define SymGetModuleInfo64   SymGetModuleInfoW64
#endif

This function supersedes the SymGetModuleInfo function. For more information, see Updated Platform Support. SymGetModuleInfo is defined as follows in DbgHelp.h.

#if !defined(_IMAGEHLP_SOURCE_) && defined(_IMAGEHLP64)
#define SymGetModuleInfo   SymGetModuleInfo64
#define SymGetModuleInfoW  SymGetModuleInfoW64
#else
BOOL
IMAGEAPI
SymGetModuleInfo(
    __in HANDLE hProcess,
    __in DWORD dwAddr,
    __out PIMAGEHLP_MODULE ModuleInfo
    );

BOOL
IMAGEAPI
SymGetModuleInfoW(
    __in HANDLE hProcess,
    __in DWORD dwAddr,
    __out PIMAGEHLP_MODULEW ModuleInfo
    );
#endif

-see-also

DbgHelp Functions

IMAGEHLP_MODULE64

SymInitialize

SymLoadModule64