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;
38 typedef HANDLE PDH_HLOG;
40 #define PDH_MAX_SCALE 7
41 #define PDH_MIN_SCALE (-7)
43 #define PDH_MAX_COUNTER_NAME 1024
45 #define PDH_FMT_LONG 0x00000100
46 #define PDH_FMT_DOUBLE 0x00000200
47 #define PDH_FMT_LARGE 0x00000400
48 #define PDH_FMT_NOSCALE 0x00001000
49 #define PDH_FMT_1000 0x00002000
50 #define PDH_FMT_NOCAP100 0x00008000
52 #define DATA_SOURCE_REGISTRY 0x00000001
53 #define DATA_SOURCE_LOGFILE 0x00000002
54 #define DATA_SOURCE_WBEM 0x00000004
56 typedef struct _PDH_FMT_COUNTERVALUE
64 LPCSTR AnsiStringValue;
65 LPCWSTR WideStringValue;
67 } PDH_FMT_COUNTERVALUE, *PPDH_FMT_COUNTERVALUE;
69 typedef struct _PDH_RAW_COUNTER
76 } PDH_RAW_COUNTER, *PPDH_RAW_COUNTER;
78 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
83 LPSTR szParentInstance;
84 DWORD dwInstanceIndex;
86 } PDH_COUNTER_PATH_ELEMENTS_A, *PPDH_COUNTER_PATH_ELEMENTS_A;
88 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
92 LPWSTR szInstanceName;
93 LPWSTR szParentInstance;
94 DWORD dwInstanceIndex;
96 } PDH_COUNTER_PATH_ELEMENTS_W, *PPDH_COUNTER_PATH_ELEMENTS_W;
98 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
103 LPSTR szInstanceName;
104 } PDH_DATA_ITEM_PATH_ELEMENTS_A, *PPDH_DATA_ITEM_PATH_ELEMENTS_A;
106 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
108 LPWSTR szMachineName;
111 LPWSTR szInstanceName;
112 } PDH_DATA_ITEM_PATH_ELEMENTS_W, *PPDH_DATA_ITEM_PATH_ELEMENTS_W;
114 typedef struct _PDH_COUNTER_INFO_A
122 DWORD_PTR dwUserData;
123 DWORD_PTR dwQueryUserData;
127 PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
128 PDH_COUNTER_PATH_ELEMENTS_A CounterPath;
133 LPSTR szInstanceName;
134 LPSTR szParentInstance;
135 DWORD dwInstanceIndex;
141 } PDH_COUNTER_INFO_A, *PPDH_COUNTER_INFO_A;
143 typedef struct _PDH_COUNTER_INFO_W
151 DWORD_PTR dwUserData;
152 DWORD_PTR dwQueryUserData;
156 PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath;
157 PDH_COUNTER_PATH_ELEMENTS_W CounterPath;
160 LPWSTR szMachineName;
162 LPWSTR szInstanceName;
163 LPWSTR szParentInstance;
164 DWORD dwInstanceIndex;
165 LPWSTR szCounterName;
168 LPWSTR szExplainText;
170 } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W;
172 PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
173 PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
174 #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
175 PDH_STATUS WINAPI PdhAddEnglishCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
176 PDH_STATUS WINAPI PdhAddEnglishCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
177 #define PdhAddEnglishCounter WINELIB_NAME_AW(PdhAddEnglishCounter)
178 PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY);
179 PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY);
180 PDH_STATUS WINAPI PdhCollectQueryDataEx(PDH_HQUERY, DWORD, HANDLE);
181 PDH_STATUS WINAPI PdhCollectQueryDataWithTime(PDH_HQUERY,LONGLONG *);
182 PDH_STATUS WINAPI PdhEnumObjectItemsA(LPCSTR, LPCSTR, LPCSTR, LPSTR, LPDWORD, LPSTR, LPDWORD, DWORD, DWORD);
183 PDH_STATUS WINAPI PdhEnumObjectItemsW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD, DWORD);
184 #define PdhEnumObjectItems WINELIB_NAME_AW(PdhEnumObjectItems)
185 PDH_STATUS WINAPI PdhGetCounterInfoA(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_A);
186 PDH_STATUS WINAPI PdhGetCounterInfoW(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_W);
187 #define PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
188 PDH_STATUS WINAPI PdhGetCounterTimeBase(PDH_HCOUNTER, LONGLONG *);
189 PDH_STATUS WINAPI PdhGetFormattedCounterValue(PDH_HCOUNTER, DWORD, LPDWORD, PPDH_FMT_COUNTERVALUE);
190 PDH_STATUS WINAPI PdhGetRawCounterValue(PDH_HCOUNTER, LPDWORD, PPDH_RAW_COUNTER);
191 PDH_STATUS WINAPI PdhLookupPerfIndexByNameA(LPCSTR, LPCSTR, LPDWORD);
192 PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR, LPCWSTR, LPDWORD);
193 #define PdhLookupPerfIndexByName WINELIB_NAME_AW(PdhLookupPerfIndexByName)
194 PDH_STATUS WINAPI PdhLookupPerfNameByIndexA(LPCSTR, DWORD, LPSTR, LPDWORD);
195 PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR, DWORD, LPWSTR, LPDWORD);
196 #define PdhLookupPerfNameByIndex WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
197 PDH_STATUS WINAPI PdhMakeCounterPathA(PDH_COUNTER_PATH_ELEMENTS_A *, LPSTR, LPDWORD, DWORD);
198 PDH_STATUS WINAPI PdhMakeCounterPathW(PDH_COUNTER_PATH_ELEMENTS_W *, LPWSTR, LPDWORD, DWORD);
199 #define PdhMakeCounterPath WINELIB_NAME_AW(PdhMakeCounterPath)
200 PDH_STATUS WINAPI PdhOpenQueryA(LPCSTR, DWORD_PTR, PDH_HQUERY *);
201 PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR, DWORD_PTR, PDH_HQUERY *);
202 #define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
203 PDH_STATUS WINAPI PdhRemoveCounter(PDH_HCOUNTER);
204 PDH_STATUS WINAPI PdhSetCounterScaleFactor(PDH_HCOUNTER, LONG);
205 PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource(DWORD);
206 PDH_STATUS WINAPI PdhValidatePathA(LPCSTR);
207 PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR);
208 #define PdhValidatePath WINELIB_NAME_AW(PdhValidatePath)
209 PDH_STATUS WINAPI PdhValidatePathExA(PDH_HLOG, LPCSTR);
210 PDH_STATUS WINAPI PdhValidatePathExW(PDH_HLOG, LPCWSTR);
211 #define PdhValidatePathEx WINELIB_NAME_AW(PdhValidatePathEx)