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 the process
PPROCESS_MEMORY_COUNTERS ppsmemCounters,
// structure that receives information
DWORD cb // size of the structure
);
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.
Process Status Helper Overview, PSAPI Functions, EnumProcesses, PROCESS_MEMORY_COUNTERS