Debugging Tools for Windows |
The GetNumberModules method returns the number of modules in the current process's module list.
HRESULT
IDebugSymbols::GetNumberModules(
OUT PULONG Loaded,
OUT PULONG Unloaded
);
This method may also return other error values. See Return Values for more details.
GetNumberModules is available in all versions of IDebugSymbols.
The list of loaded and unloaded modules is maintained by Windows. The engine caches a copy of this list, but it may become out of date. Reload can be used to synchronize the engine's copy of the list with the list maintained by Windows.
The unloaded modules are not tracked in all versions of Windows. Unloaded modules are tracked for user-mode targets in Microsoft Windows Server™ 2003 and later; for kernel-mode targets, the unloaded modules are tracked in earlier Windows versions as well. When they are tracked they are indexed after the loaded modules. Unloaded modules can be used to analyze failures caused by an attempt to call unloaded code.
For more information about modules, see Modules.
Headers: Defined in Dbgeng.h. Include Dbgeng.h.