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_MAX_COUNTER_NAME 1024
44 #define PDH_FMT_LONG 0x00000100
45 #define PDH_FMT_DOUBLE 0x00000200
46 #define PDH_FMT_LARGE 0x00000400
47 #define PDH_FMT_NOSCALE 0x00001000
48 #define PDH_FMT_1000 0x00002000
49 #define PDH_FMT_NOCAP100 0x00008000
51 typedef struct _PDH_FMT_COUNTERVALUE
59 LPCSTR AnsiStringValue
;
60 LPCWSTR WideStringValue
;
62 } PDH_FMT_COUNTERVALUE
, *PPDH_FMT_COUNTERVALUE
;
64 typedef struct _PDH_RAW_COUNTER
71 } PDH_RAW_COUNTER
, *PPDH_RAW_COUNTER
;
73 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
78 LPSTR szParentInstance
;
79 DWORD dwInstanceIndex
;
81 } PDH_COUNTER_PATH_ELEMENTS_A
, *PPDH_COUNTER_PATH_ELEMENTS_A
;
83 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
87 LPWSTR szInstanceName
;
88 LPWSTR szParentInstance
;
89 DWORD dwInstanceIndex
;
91 } PDH_COUNTER_PATH_ELEMENTS_W
, *PPDH_COUNTER_PATH_ELEMENTS_W
;
93 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
99 } PDH_DATA_ITEM_PATH_ELEMENTS_A
, *PPDH_DATA_ITEM_PATH_ELEMENTS_A
;
101 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
103 LPWSTR szMachineName
;
106 LPWSTR szInstanceName
;
107 } PDH_DATA_ITEM_PATH_ELEMENTS_W
, *PPDH_DATA_ITEM_PATH_ELEMENTS_W
;
109 typedef struct _PDH_COUNTER_INFO_A
117 DWORD_PTR dwUserData
;
118 DWORD_PTR dwQueryUserData
;
122 PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath
;
123 PDH_COUNTER_PATH_ELEMENTS_A CounterPath
;
128 LPSTR szInstanceName
;
129 LPSTR szParentInstance
;
130 DWORD dwInstanceIndex
;
136 } PDH_COUNTER_INFO_A
, *PPDH_COUNTER_INFO_A
;
138 typedef struct _PDH_COUNTER_INFO_W
146 DWORD_PTR dwUserData
;
147 DWORD_PTR dwQueryUserData
;
151 PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath
;
152 PDH_COUNTER_PATH_ELEMENTS_W CounterPath
;
155 LPWSTR szMachineName
;
157 LPWSTR szInstanceName
;
158 LPWSTR szParentInstance
;
159 DWORD dwInstanceIndex
;
160 LPWSTR szCounterName
;
163 LPWSTR szExplainText
;
165 } PDH_COUNTER_INFO_W
, *PPDH_COUNTER_INFO_W
;
167 PDH_STATUS WINAPI
PdhAddCounterA(PDH_HQUERY
, LPCSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
168 PDH_STATUS WINAPI
PdhAddCounterW(PDH_HQUERY
, LPCWSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
169 #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
170 PDH_STATUS WINAPI
PdhAddEnglishCounterA(PDH_HQUERY
, LPCSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
171 PDH_STATUS WINAPI
PdhAddEnglishCounterW(PDH_HQUERY
, LPCWSTR
, DWORD_PTR
, PDH_HCOUNTER
*);
172 #define PdhAddEnglishCounter WINELIB_NAME_AW(PdhAddEnglishCounter)
173 PDH_STATUS WINAPI
PdhCloseQuery(PDH_HQUERY
);
174 PDH_STATUS WINAPI
PdhCollectQueryData(PDH_HQUERY
);
175 PDH_STATUS WINAPI
PdhCollectQueryDataWithTime(PDH_HQUERY
,LONGLONG
*);
176 PDH_STATUS WINAPI
PdhGetCounterInfoA(PDH_HCOUNTER
, BOOLEAN
, LPDWORD
, PPDH_COUNTER_INFO_A
);
177 PDH_STATUS WINAPI
PdhGetCounterInfoW(PDH_HCOUNTER
, BOOLEAN
, LPDWORD
, PPDH_COUNTER_INFO_W
);
178 #define PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
179 PDH_STATUS WINAPI
PdhGetCounterTimeBase(PDH_HCOUNTER
, LONGLONG
*);
180 PDH_STATUS WINAPI
PdhGetFormattedCounterValue(PDH_HCOUNTER
, DWORD
, LPDWORD
, PPDH_FMT_COUNTERVALUE
);
181 PDH_STATUS WINAPI
PdhGetRawCounterValue(PDH_HCOUNTER
, LPDWORD
, PPDH_RAW_COUNTER
);
182 PDH_STATUS WINAPI
PdhLookupPerfIndexByNameA(LPCSTR
, LPCSTR
, LPDWORD
);
183 PDH_STATUS WINAPI
PdhLookupPerfIndexByNameW(LPCWSTR
, LPCWSTR
, LPDWORD
);
184 #define PdhLookupPerfIndexByName WINELIB_NAME_AW(PdhLookupPerfIndexByName)
185 PDH_STATUS WINAPI
PdhLookupPerfNameByIndexA(LPCSTR
, DWORD
, LPSTR
, LPDWORD
);
186 PDH_STATUS WINAPI
PdhLookupPerfNameByIndexW(LPCWSTR
, DWORD
, LPWSTR
, LPDWORD
);
187 #define PdhLookupPerfNameByIndex WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
188 PDH_STATUS WINAPI
PdhOpenQueryA(LPCSTR
, DWORD_PTR
, PDH_HQUERY
*);
189 PDH_STATUS WINAPI
PdhOpenQueryW(LPCWSTR
, DWORD_PTR
, PDH_HQUERY
*);
190 #define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
191 PDH_STATUS WINAPI
PdhRemoveCounter(PDH_HCOUNTER
);
192 PDH_STATUS WINAPI
PdhSetCounterScaleFactor(PDH_HCOUNTER
, LONG
);