configure: Remove regex detection.
[wine] / include / pdh.h
1 /*
2  * Performance Data Helper
3  *
4  * Copyright 2007 Hans Leidekker
5  *
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.
10  *
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.
15  *
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
19  */
20
21 #ifndef _PDH_H_
22 #define _PDH_H_
23
24 #include <windows.h>
25 #include <winperf.h>
26
27 #ifdef __cplusplus
28 extern "C" {
29 #endif
30
31 typedef LONG   PDH_STATUS;
32 typedef HANDLE PDH_HQUERY;
33 typedef HANDLE PDH_HCOUNTER;
34 typedef HANDLE PDH_HLOG;
35
36 typedef PDH_HCOUNTER HCOUNTER;
37 typedef PDH_HQUERY   HQUERY;
38 typedef PDH_HLOG     HLOG;
39
40 #define PDH_CVERSION_WIN40  0x0400
41 #define PDH_CVERSION_WIN50  0x0500
42 #define PDH_VERSION         0x0503
43
44 #define PDH_MAX_SCALE 7
45 #define PDH_MIN_SCALE (-7)
46
47 #define PDH_MAX_COUNTER_NAME    1024
48
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
55
56 #define DATA_SOURCE_REGISTRY    0x00000001
57 #define DATA_SOURCE_LOGFILE     0x00000002
58 #define DATA_SOURCE_WBEM        0x00000004
59
60 #ifdef WINE_NO_UNICODE_MACROS
61 # define DECL_PDH_TYPE_AW(name)  /* nothing */
62 #else  /* WINE_NO_UNICODE_MACROS */
63 # ifdef UNICODE
64 # define DECL_PDH_TYPE_AW(name)  typedef name##_W name;
65 # else
66 # define DECL_PDH_TYPE_AW(name)  typedef name##_A name;
67 # endif
68 #endif  /* WINE_NO_UNICODE_MACROS */
69
70 typedef struct _PDH_FMT_COUNTERVALUE
71 {
72     DWORD CStatus;
73     union
74     {
75         LONG     longValue;
76         double   doubleValue;
77         LONGLONG largeValue;
78         LPCSTR   AnsiStringValue;
79         LPCWSTR  WideStringValue;
80     } DUMMYUNIONNAME;
81 } PDH_FMT_COUNTERVALUE, *PPDH_FMT_COUNTERVALUE;
82
83 typedef struct _PDH_RAW_COUNTER
84 {
85     DWORD    CStatus;
86     FILETIME TimeStamp;
87     LONGLONG FirstValue;
88     LONGLONG SecondValue;
89     DWORD    MultiCount;
90 } PDH_RAW_COUNTER, *PPDH_RAW_COUNTER;
91
92 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
93 {
94     LPSTR szMachineName;
95     LPSTR szObjectName;
96     LPSTR szInstanceName;
97     LPSTR szParentInstance;
98     DWORD dwInstanceIndex;
99     LPSTR szCounterName;
100 } PDH_COUNTER_PATH_ELEMENTS_A, *PPDH_COUNTER_PATH_ELEMENTS_A;
101
102 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
103 {
104     LPWSTR szMachineName;
105     LPWSTR szObjectName;
106     LPWSTR szInstanceName;
107     LPWSTR szParentInstance;
108     DWORD  dwInstanceIndex;
109     LPWSTR szCounterName;
110 } PDH_COUNTER_PATH_ELEMENTS_W, *PPDH_COUNTER_PATH_ELEMENTS_W;
111
112 DECL_PDH_TYPE_AW(PDH_COUNTER_PATH_ELEMENTS)
113 DECL_PDH_TYPE_AW(PPDH_COUNTER_PATH_ELEMENTS)
114
115 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
116 {
117     LPSTR szMachineName;
118     GUID  ObjectGUID;
119     DWORD dwItemId;
120     LPSTR szInstanceName;
121 } PDH_DATA_ITEM_PATH_ELEMENTS_A, *PPDH_DATA_ITEM_PATH_ELEMENTS_A;
122
123 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
124 {
125     LPWSTR szMachineName;
126     GUID   ObjectGUID;
127     DWORD  dwItemId;
128     LPWSTR szInstanceName;
129 } PDH_DATA_ITEM_PATH_ELEMENTS_W, *PPDH_DATA_ITEM_PATH_ELEMENTS_W;
130
131 DECL_PDH_TYPE_AW(PDH_DATA_ITEM_PATH_ELEMENTS)
132 DECL_PDH_TYPE_AW(PPDH_DATA_ITEM_PATH_ELEMENTS)
133
134 typedef struct _PDH_COUNTER_INFO_A
135 {
136     DWORD     dwLength;
137     DWORD     dwType;
138     DWORD     CVersion;
139     DWORD     CStatus;
140     LONG      lScale;
141     LONG      lDefaultScale;
142     DWORD_PTR dwUserData;
143     DWORD_PTR dwQueryUserData;
144     LPSTR     szFullPath;
145     union
146     {
147         PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
148         PDH_COUNTER_PATH_ELEMENTS_A   CounterPath;
149         struct
150         {
151             LPSTR szMachineName;
152             LPSTR szObjectName;
153             LPSTR szInstanceName;
154             LPSTR szParentInstance;
155             DWORD dwInstanceIndex;
156             LPSTR szCounterName;
157         } DUMMYSTRUCTNAME;
158     } DUMMYUNIONNAME;
159     LPSTR szExplainText;
160     DWORD DataBuffer[1];
161 } PDH_COUNTER_INFO_A, *PPDH_COUNTER_INFO_A;
162
163 typedef struct _PDH_COUNTER_INFO_W
164 {
165     DWORD     dwLength;
166     DWORD     dwType;
167     DWORD     CVersion;
168     DWORD     CStatus;
169     LONG      lScale;
170     LONG      lDefaultScale;
171     DWORD_PTR dwUserData;
172     DWORD_PTR dwQueryUserData;
173     LPWSTR    szFullPath;
174     union
175     {
176         PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath;
177         PDH_COUNTER_PATH_ELEMENTS_W   CounterPath;
178         struct
179         {
180             LPWSTR szMachineName;
181             LPWSTR szObjectName;
182             LPWSTR szInstanceName;
183             LPWSTR szParentInstance;
184             DWORD  dwInstanceIndex;
185             LPWSTR szCounterName;
186         } DUMMYSTRUCTNAME;
187     } DUMMYUNIONNAME;
188     LPWSTR szExplainText;
189     DWORD DataBuffer[1];
190 } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W;
191
192 DECL_PDH_TYPE_AW(PDH_COUNTER_INFO)
193 DECL_PDH_TYPE_AW(PPDH_COUNTER_INFO)
194
195 #undef DECL_PDH_TYPE_AW
196
197 PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
198 PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
199 #define    PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
200 PDH_STATUS WINAPI PdhAddEnglishCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
201 PDH_STATUS WINAPI PdhAddEnglishCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
202 #define    PdhAddEnglishCounter WINELIB_NAME_AW(PdhAddEnglishCounter)
203 PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY);
204 PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY);
205 PDH_STATUS WINAPI PdhCollectQueryDataEx(PDH_HQUERY, DWORD, HANDLE);
206 PDH_STATUS WINAPI PdhCollectQueryDataWithTime(PDH_HQUERY,LONGLONG *);
207 PDH_STATUS WINAPI PdhEnumObjectsA(LPCSTR,LPCSTR,PZZSTR,LPDWORD,DWORD,BOOL);
208 PDH_STATUS WINAPI PdhEnumObjectsW(LPCWSTR,LPCWSTR,PZZWSTR,LPDWORD,DWORD,BOOL);
209 #define    PdhEnumObjects WINELIB_NAME_AW(PdhEnumObjects)
210 PDH_STATUS WINAPI PdhEnumObjectItemsA(LPCSTR, LPCSTR, LPCSTR, LPSTR, LPDWORD, LPSTR, LPDWORD, DWORD, DWORD);
211 PDH_STATUS WINAPI PdhEnumObjectItemsW(LPCWSTR, LPCWSTR, LPCWSTR, LPWSTR, LPDWORD, LPWSTR, LPDWORD, DWORD, DWORD);
212 #define    PdhEnumObjectItems WINELIB_NAME_AW(PdhEnumObjectItems)
213 PDH_STATUS WINAPI PdhGetCounterInfoA(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_A);
214 PDH_STATUS WINAPI PdhGetCounterInfoW(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_W);
215 #define    PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
216 PDH_STATUS WINAPI PdhGetCounterTimeBase(PDH_HCOUNTER, LONGLONG *);
217 PDH_STATUS WINAPI PdhGetDllVersion(LPDWORD);
218 PDH_STATUS WINAPI PdhGetFormattedCounterValue(PDH_HCOUNTER, DWORD, LPDWORD, PPDH_FMT_COUNTERVALUE);
219 PDH_STATUS WINAPI PdhGetRawCounterValue(PDH_HCOUNTER, LPDWORD, PPDH_RAW_COUNTER);
220 PDH_STATUS WINAPI PdhLookupPerfIndexByNameA(LPCSTR, LPCSTR, LPDWORD);
221 PDH_STATUS WINAPI PdhLookupPerfIndexByNameW(LPCWSTR, LPCWSTR, LPDWORD);
222 #define    PdhLookupPerfIndexByName WINELIB_NAME_AW(PdhLookupPerfIndexByName)
223 PDH_STATUS WINAPI PdhLookupPerfNameByIndexA(LPCSTR, DWORD, LPSTR, LPDWORD);
224 PDH_STATUS WINAPI PdhLookupPerfNameByIndexW(LPCWSTR, DWORD, LPWSTR, LPDWORD);
225 #define    PdhLookupPerfNameByIndex WINELIB_NAME_AW(PdhLookupPerfNameByIndex)
226 PDH_STATUS WINAPI PdhMakeCounterPathA(PDH_COUNTER_PATH_ELEMENTS_A *, LPSTR, LPDWORD, DWORD);
227 PDH_STATUS WINAPI PdhMakeCounterPathW(PDH_COUNTER_PATH_ELEMENTS_W *, LPWSTR, LPDWORD, DWORD);
228 #define    PdhMakeCounterPath WINELIB_NAME_AW(PdhMakeCounterPath)
229 PDH_STATUS WINAPI PdhOpenQueryA(LPCSTR, DWORD_PTR, PDH_HQUERY *);
230 PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR, DWORD_PTR, PDH_HQUERY *);
231 #define    PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
232 PDH_STATUS WINAPI PdhRemoveCounter(PDH_HCOUNTER);
233 PDH_STATUS WINAPI PdhSetCounterScaleFactor(PDH_HCOUNTER, LONG);
234 PDH_STATUS WINAPI PdhSetDefaultRealTimeDataSource(DWORD);
235 PDH_STATUS WINAPI PdhValidatePathA(LPCSTR);
236 PDH_STATUS WINAPI PdhValidatePathW(LPCWSTR);
237 #define    PdhValidatePath WINELIB_NAME_AW(PdhValidatePath)
238 PDH_STATUS WINAPI PdhValidatePathExA(PDH_HLOG, LPCSTR);
239 PDH_STATUS WINAPI PdhValidatePathExW(PDH_HLOG, LPCWSTR);
240 #define    PdhValidatePathEx WINELIB_NAME_AW(PdhValidatePathEx)
241
242 #ifdef __cplusplus
243 }
244 #endif
245
246 #endif /* _PDH_H_ */