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 typedef struct _PDH_FMT_COUNTERVALUE
60 LPCSTR AnsiStringValue;
61 LPCWSTR WideStringValue;
63 } PDH_FMT_COUNTERVALUE, *PPDH_FMT_COUNTERVALUE;
65 typedef struct _PDH_RAW_COUNTER
72 } PDH_RAW_COUNTER, *PPDH_RAW_COUNTER;
74 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
79 LPSTR szParentInstance;
80 DWORD dwInstanceIndex;
82 } PDH_COUNTER_PATH_ELEMENTS_A, *PPDH_COUNTER_PATH_ELEMENTS_A;
84 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
88 LPWSTR szInstanceName;
89 LPWSTR szParentInstance;
90 DWORD dwInstanceIndex;
92 } PDH_COUNTER_PATH_ELEMENTS_W, *PPDH_COUNTER_PATH_ELEMENTS_W;
94 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
100 } PDH_DATA_ITEM_PATH_ELEMENTS_A, *PPDH_DATA_ITEM_PATH_ELEMENTS_A;
102 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
104 LPWSTR szMachineName;
107 LPWSTR szInstanceName;
108 } PDH_DATA_ITEM_PATH_ELEMENTS_W, *PPDH_DATA_ITEM_PATH_ELEMENTS_W;
110 typedef struct _PDH_COUNTER_INFO_A
118 DWORD_PTR dwUserData;
119 DWORD_PTR dwQueryUserData;
123 PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
124 PDH_COUNTER_PATH_ELEMENTS_A CounterPath;
129 LPSTR szInstanceName;
130 LPSTR szParentInstance;
131 DWORD dwInstanceIndex;
137 } PDH_COUNTER_INFO_A, *PPDH_COUNTER_INFO_A;
139 typedef struct _PDH_COUNTER_INFO_W
147 DWORD_PTR dwUserData;
148 DWORD_PTR dwQueryUserData;
152 PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath;
153 PDH_COUNTER_PATH_ELEMENTS_W CounterPath;
156 LPWSTR szMachineName;
158 LPWSTR szInstanceName;
159 LPWSTR szParentInstance;
160 DWORD dwInstanceIndex;
161 LPWSTR szCounterName;
164 LPWSTR szExplainText;
166 } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W;
168 PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
169 PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
170 #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
171 PDH_STATUS WINAPI PdhAddEnglishCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
172 PDH_STATUS WINAPI PdhAddEnglishCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
173 #define PdhAddEnglishCounter WINELIB_NAME_AW(PdhAddEnglishCounter)
174 PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY);
175 PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY);
176 PDH_STATUS WINAPI PdhCollectQueryDataEx(PDH_HQUERY, DWORD, HANDLE);
177 PDH_STATUS WINAPI PdhCollectQueryDataWithTime(PDH_HQUERY,LONGLONG *);
178 PDH_STATUS WINAPI PdhGetCounterInfoA(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_A);
179 PDH_STATUS WINAPI PdhGetCounterInfoW(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_W);
180 #define PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
181 PDH_STATUS WINAPI PdhGetCounterTimeBase(PDH_HCOUNTER, LONGLONG *);
182 PDH_STATUS WINAPI PdhGetFormattedCounterValue(PDH_HCOUNTER, DWORD, LPDWORD, PPDH_FMT_COUNTERVALUE);
183 PDH_STATUS WINAPI PdhGetRawCounterValue(PDH_HCOUNTER, LPDWORD, PPDH_RAW_COUNTER);
184 PDH_STATUS WINAPI PdhLookupPerfIndexByNameA(LPCSTR, LPCSTR, LPDWORD);
185 PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR, LPCWSTR, LPDWORD);
186 #define PdhLookupPerfIndexByName WINELIB_NAME_AW(PdhLookupPerfIndexByName)
187 PDH_STATUS WINAPI PdhLookupPerfNameByIndexA(LPCSTR, DWORD, LPSTR, LPDWORD);
188 PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR, DWORD, LPWSTR, LPDWORD);
189 #define PdhLookupPerfNameByIndex WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
190 PDH_STATUS WINAPI PdhOpenQueryA(LPCSTR, DWORD_PTR, PDH_HQUERY *);
191 PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR, DWORD_PTR, PDH_HQUERY *);
192 #define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
193 PDH_STATUS WINAPI PdhRemoveCounter(PDH_HCOUNTER);
194 PDH_STATUS WINAPI PdhSetCounterScaleFactor(PDH_HCOUNTER, LONG);
195 PDH_STATUS WINAPI PdhValidatePathA(LPCSTR);
196 PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR);
197 #define PdhValidatePath WINELIB_NAME_AW(PdhValidatePath)
198 PDH_STATUS WINAPI PdhValidatePathExA(PDH_HLOG, LPCSTR);
199 PDH_STATUS WINAPI PdhValidatePathExW(PDH_HLOG, LPCWSTR);
200 #define PdhValidatePathEx WINELIB_NAME_AW(PdhValidatePathEx)