Share via


Fonction GetProcessInformation (processthreadsapi.h)

Récupère des informations sur le processus spécifié.

Syntaxe

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

Paramètres

[in] hProcess

Handle du processus. Ce handle doit avoir au moins le droit d’accès PROCESS_QUERY_LIMITED_INFORMATION . Pour plus d’informations, consultez Traiter les droits de sécurité et d’accès.

[in] ProcessInformationClass

Un membre du PROCESS_INFORMATION_CLASS énumération spécifiant le type d’informations à récupérer.

ProcessInformation

Pointeur vers un objet pour recevoir le type d’informations spécifié par le paramètre ProcessInformationClass .

Si le paramètre ProcessInformationClass est ProcessMemoryPriority, ce paramètre doit pointer vers une structure MEMORY_PRIORITY_INFORMATION.

Si le paramètre ProcessInformationClass est ProcessPowerThrottling, ce paramètre doit pointer vers une structure PROCESS_POWER_THROTTLING_STATE.

Si le paramètre ProcessInformationClass est ProcessProtectionLevelInfo, ce paramètre doit pointer vers une structure PROCESS_PROTECTION_LEVEL_INFORMATION.

Si le paramètre ProcessInformationClass est ProcessLeapSecondInfo, ce paramètre doit pointer vers une structure PROCESS_LEAP_SECOND_INFO.

Si le paramètre ProcessInformationClass est ProcessAppMemoryInfo, ce paramètre doit pointer vers une structure APP_MEMORY_INFORMATION.

Si le paramètre ProcessInformationClass est ProcessMaxOverridePrefetchParameter, ce paramètre doit pointer vers une structure OVERRIDE_PREFETCH_PARAMETER.

[in] ProcessInformationSize

Taille en octets de la structure spécifiée par le paramètre ProcessInformation .

Si le paramètre ProcessInformationClass est ProcessMemoryPriority, ce paramètre doit être sizeof(MEMORY_PRIORITY_INFORMATION).

Si le paramètre ProcessInformationClass est ProcessPowerThrottling, ce paramètre doit être sizeof(PROCESS_POWER_THROTTLING_STATE).

Si le paramètre ProcessInformationClass est ProcessProtectionLevelInfo, ce paramètre doit être sizeof(PROCESS_PROTECTION_LEVEL_INFORMATION).

Si le paramètre ProcessInformationClass est ProcessLeapSecondInfo, ce paramètre doit être sizeof(PROCESS_LEAP_SECOND_INFO).

Si le paramètre ProcessInformationClass est ProcessAppMemoryInfo, ce paramètre doit être sizeof(APP_MEMORY_INFORMATION).

Valeur retournée

Si la fonction réussit, la valeur de retour est différente de zéro.

Si la fonction échoue, la valeur de retour est égale à zéro. Pour obtenir des informations d’erreur étendues, appelez la fonction GetLastError.

Configuration requise

Condition requise Valeur
Client minimal pris en charge Windows 8 [applications de bureau | Applications UWP]
Serveur minimal pris en charge Windows Server 2012 [applications de bureau | Applications UWP]
Plateforme cible Windows
En-tête processthreadsapi.h (inclure Windows.h)
Bibliothèque Kernel32.lib
DLL Kernel32.dll

Voir aussi

Fonction GetThreadInformation, structure MEMORY_PRIORITY_INFORMATION, fonction SetProcessInformation, énumération PROCESS_INFORMATION_CLASS, structure OVERRIDE_PREFETCH_PARAMETER