1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
DH_HQUERY appMemQueryCounter= NULL;
PDH_HCOUNTER appMemCounter = NULL;
PDH_STATUS pdhStatus;
char counterPath [1024];
// Code construisant le chemin, en utilisant notamment
// PdhLookupPerfNameByIndex pour récupérer les bons libellés
// au bout du compte, counterPath contient:
// \Processus(MonAppli)\Plage de travail - Privée"
// (je ne sais pas comment passent les antislash sur le forum, mais
// le chemin est OK :
// (antislash)Processus(MonAppli)(antislash)Plage de travail - Privée
pdhStatus = PdhOpenQueryH(NULL, NULL, &appMemQueryCounter);
if(pdhStatus == ERROR_SUCCESS && appMemQueryCounter != NULL)
{
dhStatus = PdhAddCounter(appMemQueryCounter, counterPath, NULL, &appMemCounter );
} |
Partager