IDebugSymbols3::GetNumberModules method (dbgeng.h)

The GetNumberModules method returns the number of modules in the current process's module list.

Syntax

HRESULT GetNumberModules(
  [out] PULONG Loaded,
  [out] PULONG Unloaded
);

Parameters

[out] Loaded

Receives the number of loaded modules in the current process's module list.

[out] Unloaded

Receives the number of unloaded modules in the current process's module list. This number will be zero if the version of Microsoft Windows running on the target computer does not track unloaded modules.

Return value

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

Return code Description
S_OK
The method was successful.

Remarks

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.

Requirements

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

See also

GetModuleByIndex

IDebugSymbols

IDebugSymbols2

IDebugSymbols3