GetProcessInformation function (processthreadsapi.h)

Retrieves information about the specified process.

Syntax

BOOL GetProcessInformation(
  [in] HANDLE                    hProcess,
  [in] PROCESS_INFORMATION_CLASS ProcessInformationClass,
       LPVOID                    ProcessInformation,
  [in] DWORD                     ProcessInformationSize
);

Parameters

[in] hProcess

A handle to the process. This handle must have at least the PROCESS_QUERY_LIMITED_INFORMATION access right. For more information, see Process Security and Access Rights.

[in] ProcessInformationClass

A member of the PROCESS_INFORMATION_CLASS enumeration specifying the kind of information to retrieve.

ProcessInformation

Pointer to an object to receive the type of information specified by the ProcessInformationClass parameter.

If the ProcessInformationClass parameter is ProcessMemoryPriority, this parameter must point to a MEMORY_PRIORITY_INFORMATION structure.

If the ProcessInformationClass parameter is ProcessPowerThrottling, this parameter must point to a PROCESS_POWER_THROTTLING_STATE structure.

If the ProcessInformationClass parameter is ProcessProtectionLevelInfo, this parameter must point to a PROCESS_PROTECTION_LEVEL_INFORMATION structure.

If the ProcessInformationClass parameter is ProcessLeapSecondInfo, this parameter must point to a PROCESS_LEAP_SECOND_INFO structure.

If the ProcessInformationClass parameter is ProcessAppMemoryInfo, this parameter must point to a APP_MEMORY_INFORMATION structure.

If the ProcessInformationClass parameter is ProcessMaxOverridePrefetchParameter, this parameter must point to an OVERRIDE_PREFETCH_PARAMETER structure.

[in] ProcessInformationSize

The size in bytes of the structure specified by the ProcessInformation parameter.

If the ProcessInformationClass parameter is ProcessMemoryPriority, this parameter must be sizeof(MEMORY_PRIORITY_INFORMATION).

If the ProcessInformationClass parameter is ProcessPowerThrottling, this parameter must be sizeof(PROCESS_POWER_THROTTLING_STATE).

If the ProcessInformationClass parameter is ProcessProtectionLevelInfo, this parameter must be sizeof(PROCESS_PROTECTION_LEVEL_INFORMATION).

If the ProcessInformationClass parameter is ProcessLeapSecondInfo, this parameter must be sizeof(PROCESS_LEAP_SECOND_INFO).

If the ProcessInformationClass parameter is ProcessAppMemoryInfo, this parameter must be sizeof(APP_MEMORY_INFORMATION).

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 function.

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header processthreadsapi.h (include Windows.h)
Library Kernel32.lib
DLL Kernel32.dll

See also

GetThreadInformation function, MEMORY_PRIORITY_INFORMATION structure, SetProcessInformation function, PROCESS_INFORMATION_CLASS enumeration, OVERRIDE_PREFETCH_PARAMETER structure