GetPerformanceInfo, fonction (psapi.h)

Récupère les valeurs de performances contenues dans la structure PERFORMANCE_INFORMATION .

Syntaxe

BOOL GetPerformanceInfo(
  [out] PPERFORMANCE_INFORMATION pPerformanceInformation,
  [in]  DWORD                    cb
);

Paramètres

[out] pPerformanceInformation

Pointeur vers une structure PERFORMANCE_INFORMATION qui reçoit les informations de performances.

[in] cb

Taille de la structure PERFORMANCE_INFORMATION , en octets.

Valeur retournée

Si la fonction réussit, la valeur de retour est TRUE. Si la fonction échoue, la valeur de retour est FALSE. Pour obtenir des informations détaillées sur l’erreur, appelez GetLastError.

Notes

À compter de Windows 7 et Windows Server 2008 R2, Psapi.h établit les numéros de version pour les fonctions PSAPI. Le numéro de version PSAPI affecte le nom utilisé pour appeler la fonction et la bibliothèque qu’un programme doit charger.

Si PSAPI_VERSION est égal ou supérieur à 2, cette fonction est définie comme K32GetPerformanceInfo dans Psapi.h et exportée dans Kernel32.lib et Kernel32.dll. Si PSAPI_VERSION a la valeur 1, cette fonction est définie comme GetPerformanceInfo dans Psapi.h et exportée dans Psapi.lib et Psapi.dll en tant que wrapper qui appelle K32GetPerformanceInfo.

Les programmes qui doivent s’exécuter sur des versions antérieures de Windows, de Windows 7 et versions ultérieures doivent toujours appeler cette fonction GetPerformanceInfo. Pour garantir la résolution correcte des symboles, ajoutez Psapi.lib à la macro TARGETLIBS et compilez le programme avec –DPSAPI_VERSION=1. Pour utiliser la liaison dynamique au moment de l’exécution, chargez Psapi.dll.

Spécifications

   
Client minimal pris en charge Windows XP [applications de bureau uniquement]
Serveur minimal pris en charge Windows Server 2003 [applications de bureau uniquement]
Plateforme cible Windows
En-tête psapi.h
Bibliothèque Kernel32.lib sur Windows 7 et Windows Server 2008 R2 ; Psapi.lib (si PSAPI_VERSION=1) sur Windows 7 et Windows Server 2008 R2 ; Psapi.lib sur Windows Server 2008, Windows Vista, Windows Server 2003 et Windows XP
DLL Kernel32.dll sur Windows 7 et Windows Server 2008 R2 ; Psapi.dll (si PSAPI_VERSION=1) sur Windows 7 et Windows Server 2008 R2 ; Psapi.dll sur Windows Server 2008, Windows Vista, Windows Server 2003 et Windows XP

Voir aussi

Informations sur les performances de la mémoire

PERFORMANCE_INFORMATION

Fonctions PSAPI