40 |
|
{ |
41 |
|
PDH_STATUS pdh_status; |
42 |
|
PDH_FMT_COUNTERVALUE *item_buf; |
43 |
< |
HCOUNTER *phcounter = current_han[counter]; |
43 |
> |
HCOUNTER hcounter = current_han[counter]; |
44 |
|
|
45 |
< |
if(phcounter == NULL) |
45 |
> |
if(hcounter == NULL) |
46 |
|
return -1; |
47 |
|
|
48 |
|
item_buf = sg_malloc(sizeof(PDH_FMT_COUNTERVALUE)); |
50 |
|
return -1; |
51 |
|
} |
52 |
|
|
53 |
< |
pdh_status = PdhGetFormattedCounterValue(phcounter, PDH_FMT_DOUBLE, NULL, |
53 |
> |
pdh_status = PdhGetFormattedCounterValue(hcounter, PDH_FMT_DOUBLE, NULL, |
54 |
|
item_buf); |
55 |
|
if(pdh_status != ERROR_SUCCESS) { |
56 |
|
free(item_buf); |
61 |
|
return 0; |
62 |
|
} |
63 |
|
|
64 |
< |
static int read_counter_large_int(HCOUNTER phcounter, long long *result) |
64 |
> |
static int read_counter_large_int(HCOUNTER hcounter, long long *result) |
65 |
|
{ |
66 |
|
PDH_STATUS pdh_status; |
67 |
|
PDH_FMT_COUNTERVALUE *item_buf; |
68 |
|
|
69 |
< |
if(phcounter == NULL) |
69 |
> |
if(hcounter == NULL) |
70 |
|
return -1; |
71 |
|
|
72 |
|
item_buf = sg_malloc(sizeof(PDH_FMT_COUNTERVALUE)); |
74 |
|
return -1; |
75 |
|
} |
76 |
|
|
77 |
< |
pdh_status = PdhGetFormattedCounterValue(phcounter, PDH_FMT_LARGE, NULL, |
77 |
> |
pdh_status = PdhGetFormattedCounterValue(hcounter, PDH_FMT_LARGE, NULL, |
78 |
|
item_buf); |
79 |
|
if(pdh_status != ERROR_SUCCESS) { |
80 |
|
free(item_buf); |