Platform SDK: Performance Monitoring

GetProcessMemoryInfo

The GetProcessMemoryInfo function retrieves information about the memory usage of the specified process in the PROCESS_MEMORY_COUNTERS structure.

BOOL GetProcessMemoryInfo(
  HANDLE Process,                          // handle to process
  PPROCESS_MEMORY_COUNTERS ppsmemCounters, // buffer
  DWORD cb                                 // size of buffer
);

Parameters

Process
[in] Handle to the process.
ppsmemCounters
[out] Pointer to the PROCESS_MEMORY_COUNTERS structure that receives information about the memory usage of the process.
cb
[in] Specifies the size, in bytes, of the PROCESS_MEMORY_COUNTERS structure.

Return Value

If the function succeeds, the return value is nonzero.

If the function fails, the return value is zero. To get extended error information, call GetLastError.

Requirements

  Windows NT/2000: Requires Windows NT 4.0 or later.
  Header: Declared in Psapi.h.
  Library: Use Psapi.lib.

See Also

Process Status Helper Overview, PSAPI Functions, EnumProcesses, PROCESS_MEMORY_COUNTERS