2 * Performance Data Helper
4 * Copyright 2007 Hans Leidekker
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
35 typedef LONG PDH_STATUS
;
36 typedef HANDLE PDH_HQUERY
;
37 typedef HANDLE PDH_HCOUNTER
;
39 #define PDH_MAX_SCALE 7
40 #define PDH_MIN_SCALE (-7)
42 #define PDH_FMT_LONG 0x00000100
43 #define PDH_FMT_DOUBLE 0x00000200
44 #define PDH_FMT_LARGE 0x00000400
45 #define PDH_FMT_NOSCALE 0x00001000
46 #define PDH_FMT_1000 0x00002000
47 #define PDH_FMT_NOCAP100 0x00008000
49 typedef struct _PDH_FMT_COUNTERVALUE
57 LPCSTR AnsiStringValue
;
58 LPCWSTR WideStringValue
;
60 } PDH_FMT_COUNTERVALUE
, *PPDH_FMT_COUNTERVALUE
;
62 typedef struct _PDH_RAW_COUNTER
69 } PDH_RAW_COUNTER
, *PPDH_RAW_COUNTER
;
71 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
76 LPSTR szParentInstance
;
77 DWORD dwInstanceIndex
;
79 } PDH_COUNTER_PATH_ELEMENTS_A
, *PPDH_COUNTER_PATH_ELEMENTS_A
;
81 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
85 LPWSTR szInstanceName
;
86 LPWSTR szParentInstance
;
87 DWORD dwInstanceIndex
;
89 } PDH_COUNTER_PATH_ELEMENTS_W
, *PPDH_COUNTER_PATH_ELEMENTS_W
;
91 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
97 } PDH_DATA_ITEM_PATH_ELEMENTS_A
, *PPDH_DATA_ITEM_PATH_ELEMENTS_A
;
99 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
101 LPWSTR szMachineName
;
104 LPWSTR szInstanceName
;
105 } PDH_DATA_ITEM_PATH_ELEMENTS_W
, *PPDH_DATA_ITEM_PATH_ELEMENTS_W
;
107 typedef struct _PDH_COUNTER_INFO_A
115 DWORD_PTR dwUserData
;
116 DWORD_PTR dwQueryUserData
;
120 PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath
;
121 PDH_COUNTER_PATH_ELEMENTS_A CounterPath
;
126 LPSTR szInstanceName
;
127 LPSTR szParentInstance
;
128 DWORD dwInstanceIndex
;
134 } PDH_COUNTER_INFO_A
, *PPDH_COUNTER_INFO_A
;
136 typedef struct _PDH_COUNTER_INFO_W
144 DWORD_PTR dwUserData
;
145 DWORD_PTR dwQueryUserData
;
149 PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath
;
150 PDH_COUNTER_PATH_ELEMENTS_W CounterPath
;
153 LPWSTR szMachineName
;
155 LPWSTR szInstanceName
;
156 LPWSTR szParentInstance
;
157 DWORD dwInstanceIndex
;
158 LPWSTR szCounterName
;
161 LPWSTR szExplainText
;
163 } PDH_COUNTER_INFO_W
, *PPDH_COUNTER_INFO_W
;
165 PDH_STATUS WINAPI
PdhAddCounterA(PDH_HQUERY
, LPCSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
166 PDH_STATUS WINAPI
PdhAddCounterW(PDH_HQUERY
, LPCWSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
167 #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
168 PDH_STATUS WINAPI
PdhCloseQuery(PDH_HQUERY
);
169 PDH_STATUS WINAPI
PdhCollectQueryData(PDH_HQUERY
);
170 PDH_STATUS WINAPI
PdhGetCounterInfoA(PDH_HCOUNTER
, BOOLEAN
, LPDWORD
, PPDH_COUNTER_INFO_A
);
171 PDH_STATUS WINAPI
PdhGetCounterInfoW(PDH_HCOUNTER
, BOOLEAN
, LPDWORD
, PPDH_COUNTER_INFO_W
);
172 #define PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
173 PDH_STATUS WINAPI
PdhGetCounterTimeBase(PDH_HCOUNTER
, LONGLONG
*);
174 PDH_STATUS WINAPI
PdhGetFormattedCounterValue(PDH_HCOUNTER
, DWORD
, LPDWORD
, PPDH_FMT_COUNTERVALUE
);
175 PDH_STATUS WINAPI
PdhGetRawCounterValue(PDH_HCOUNTER
, LPDWORD
, PPDH_RAW_COUNTER
);
176 PDH_STATUS WINAPI
PdhOpenQueryA(LPCSTR
, DWORD_PTR
, PDH_HQUERY
*);
177 PDH_STATUS WINAPI
PdhOpenQueryW(LPCWSTR
, DWORD_PTR
, PDH_HQUERY
*);
178 #define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
179 PDH_STATUS WINAPI
PdhRemoveCounter(PDH_HCOUNTER
);
180 PDH_STATUS WINAPI
PdhSetCounterScaleFactor(PDH_HCOUNTER
, LONG
);