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_CVERSION_WIN40 0x0400
41 #define PDH_CVERSION_WIN50 0x0500
42 #define PDH_VERSION 0x0503
44 #define PDH_MAX_SCALE 7
45 #define PDH_MIN_SCALE (-7)
47 #define PDH_MAX_COUNTER_NAME 1024
49 #define PDH_FMT_LONG 0x00000100
50 #define PDH_FMT_DOUBLE 0x00000200
51 #define PDH_FMT_LARGE 0x00000400
52 #define PDH_FMT_NOSCALE 0x00001000
53 #define PDH_FMT_1000 0x00002000
54 #define PDH_FMT_NOCAP100 0x00008000
56 #define DATA_SOURCE_REGISTRY 0x00000001
57 #define DATA_SOURCE_LOGFILE 0x00000002
58 #define DATA_SOURCE_WBEM 0x00000004
60 typedef struct _PDH_FMT_COUNTERVALUE
68 LPCSTR AnsiStringValue
;
69 LPCWSTR WideStringValue
;
71 } PDH_FMT_COUNTERVALUE
, *PPDH_FMT_COUNTERVALUE
;
73 typedef struct _PDH_RAW_COUNTER
80 } PDH_RAW_COUNTER
, *PPDH_RAW_COUNTER
;
82 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
87 LPSTR szParentInstance
;
88 DWORD dwInstanceIndex
;
90 } PDH_COUNTER_PATH_ELEMENTS_A
, *PPDH_COUNTER_PATH_ELEMENTS_A
;
92 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
96 LPWSTR szInstanceName
;
97 LPWSTR szParentInstance
;
98 DWORD dwInstanceIndex
;
100 } PDH_COUNTER_PATH_ELEMENTS_W
, *PPDH_COUNTER_PATH_ELEMENTS_W
;
102 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
107 LPSTR szInstanceName
;
108 } PDH_DATA_ITEM_PATH_ELEMENTS_A
, *PPDH_DATA_ITEM_PATH_ELEMENTS_A
;
110 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
112 LPWSTR szMachineName
;
115 LPWSTR szInstanceName
;
116 } PDH_DATA_ITEM_PATH_ELEMENTS_W
, *PPDH_DATA_ITEM_PATH_ELEMENTS_W
;
118 typedef struct _PDH_COUNTER_INFO_A
126 DWORD_PTR dwUserData
;
127 DWORD_PTR dwQueryUserData
;
131 PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath
;
132 PDH_COUNTER_PATH_ELEMENTS_A CounterPath
;
137 LPSTR szInstanceName
;
138 LPSTR szParentInstance
;
139 DWORD dwInstanceIndex
;
145 } PDH_COUNTER_INFO_A
, *PPDH_COUNTER_INFO_A
;
147 typedef struct _PDH_COUNTER_INFO_W
155 DWORD_PTR dwUserData
;
156 DWORD_PTR dwQueryUserData
;
160 PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath
;
161 PDH_COUNTER_PATH_ELEMENTS_W CounterPath
;
164 LPWSTR szMachineName
;
166 LPWSTR szInstanceName
;
167 LPWSTR szParentInstance
;
168 DWORD dwInstanceIndex
;
169 LPWSTR szCounterName
;
172 LPWSTR szExplainText
;
174 } PDH_COUNTER_INFO_W
, *PPDH_COUNTER_INFO_W
;
176 PDH_STATUS WINAPI
PdhAddCounterA(PDH_HQUERY
, LPCSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
177 PDH_STATUS WINAPI
PdhAddCounterW(PDH_HQUERY
, LPCWSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
178 #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
179 PDH_STATUS WINAPI
PdhAddEnglishCounterA(PDH_HQUERY
, LPCSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
180 PDH_STATUS WINAPI
PdhAddEnglishCounterW(PDH_HQUERY
, LPCWSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
181 #define PdhAddEnglishCounter WINELIB_NAME_AW(PdhAddEnglishCounter)
182 PDH_STATUS WINAPI
PdhCloseQuery(PDH_HQUERY
);
183 PDH_STATUS WINAPI
PdhCollectQueryData(PDH_HQUERY
);
184 PDH_STATUS WINAPI
PdhCollectQueryDataEx(PDH_HQUERY
, DWORD
, HANDLE
);
185 PDH_STATUS WINAPI
PdhCollectQueryDataWithTime(PDH_HQUERY
,LONGLONG
*);
186 PDH_STATUS WINAPI
PdhEnumObjectItemsA(LPCSTR
, LPCSTR
, LPCSTR
, LPSTR
, LPDWORD
, LPSTR
, LPDWORD
, DWORD
, DWORD
);
187 PDH_STATUS WINAPI
PdhEnumObjectItemsW(LPCWSTR
, LPCWSTR
, LPCWSTR
, LPWSTR
, LPDWORD
, LPWSTR
, LPDWORD
, DWORD
, DWORD
);
188 #define PdhEnumObjectItems WINELIB_NAME_AW(PdhEnumObjectItems)
189 PDH_STATUS WINAPI
PdhGetCounterInfoA(PDH_HCOUNTER
, BOOLEAN
, LPDWORD
, PPDH_COUNTER_INFO_A
);
190 PDH_STATUS WINAPI
PdhGetCounterInfoW(PDH_HCOUNTER
, BOOLEAN
, LPDWORD
, PPDH_COUNTER_INFO_W
);
191 #define PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
192 PDH_STATUS WINAPI
PdhGetCounterTimeBase(PDH_HCOUNTER
, LONGLONG
*);
193 PDH_STATUS WINAPI
PdhGetDllVersion(LPDWORD
);
194 PDH_STATUS WINAPI
PdhGetFormattedCounterValue(PDH_HCOUNTER
, DWORD
, LPDWORD
, PPDH_FMT_COUNTERVALUE
);
195 PDH_STATUS WINAPI
PdhGetRawCounterValue(PDH_HCOUNTER
, LPDWORD
, PPDH_RAW_COUNTER
);
196 PDH_STATUS WINAPI
PdhLookupPerfIndexByNameA(LPCSTR
, LPCSTR
, LPDWORD
);
197 PDH_STATUS WINAPI
PdhLookupPerfIndexByNameW(LPCWSTR
, LPCWSTR
, LPDWORD
);
198 #define PdhLookupPerfIndexByName WINELIB_NAME_AW(PdhLookupPerfIndexByName)
199 PDH_STATUS WINAPI
PdhLookupPerfNameByIndexA(LPCSTR
, DWORD
, LPSTR
, LPDWORD
);
200 PDH_STATUS WINAPI
PdhLookupPerfNameByIndexW(LPCWSTR
, DWORD
, LPWSTR
, LPDWORD
);
201 #define PdhLookupPerfNameByIndex WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
202 PDH_STATUS WINAPI
PdhMakeCounterPathA(PDH_COUNTER_PATH_ELEMENTS_A
*, LPSTR
, LPDWORD
, DWORD
);
203 PDH_STATUS WINAPI
PdhMakeCounterPathW(PDH_COUNTER_PATH_ELEMENTS_W
*, LPWSTR
, LPDWORD
, DWORD
);
204 #define PdhMakeCounterPath WINELIB_NAME_AW(PdhMakeCounterPath)
205 PDH_STATUS WINAPI
PdhOpenQueryA(LPCSTR
, DWORD_PTR
, PDH_HQUERY
*);
206 PDH_STATUS WINAPI
PdhOpenQueryW(LPCWSTR
, DWORD_PTR
, PDH_HQUERY
*);
207 #define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
208 PDH_STATUS WINAPI
PdhRemoveCounter(PDH_HCOUNTER
);
209 PDH_STATUS WINAPI
PdhSetCounterScaleFactor(PDH_HCOUNTER
, LONG
);
210 PDH_STATUS WINAPI
PdhSetDefaultRealTimeDataSource(DWORD
);
211 PDH_STATUS WINAPI
PdhValidatePathA(LPCSTR
);
212 PDH_STATUS WINAPI
PdhValidatePathW(LPCWSTR
);
213 #define PdhValidatePath WINELIB_NAME_AW(PdhValidatePath)
214 PDH_STATUS WINAPI
PdhValidatePathExA(PDH_HLOG
, LPCSTR
);
215 PDH_STATUS WINAPI
PdhValidatePathExW(PDH_HLOG
, LPCWSTR
);
216 #define PdhValidatePathEx WINELIB_NAME_AW(PdhValidatePathEx)