qcap: Add optional dependency on libv4l.
[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 #ifdef __WINESRC__
25 # include <windef.h>
26 #else
27 # include <windows.h>
28 #endif
29 #include <winperf.h>
30
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34
35 typedef LONG   PDH_STATUS;
36 typedef HANDLE PDH_HQUERY;
37 typedef HANDLE PDH_HCOUNTER;
38 typedef HANDLE PDH_HLOG;
39
40 #define PDH_MAX_SCALE 7
41 #define PDH_MIN_SCALE (-7)
42
43 #define PDH_MAX_COUNTER_NAME    1024
44
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
51
52 #define DATA_SOURCE_REGISTRY    0x00000001
53 #define DATA_SOURCE_LOGFILE     0x00000002
54 #define DATA_SOURCE_WBEM        0x00000004
55
56 typedef struct _PDH_FMT_COUNTERVALUE
57 {
58     DWORD CStatus;
59     union
60     {
61         LONG     longValue;
62         double   doubleValue;
63         LONGLONG largeValue;
64         LPCSTR   AnsiStringValue;
65         LPCWSTR  WideStringValue;
66     } DUMMYUNIONNAME;
67 } PDH_FMT_COUNTERVALUE, *PPDH_FMT_COUNTERVALUE;
68
69 typedef struct _PDH_RAW_COUNTER
70 {
71     DWORD    CStatus;
72     FILETIME TimeStamp;
73     LONGLONG FirstValue;
74     LONGLONG SecondValue;
75     DWORD    MultiCount;
76 } PDH_RAW_COUNTER, *PPDH_RAW_COUNTER;
77
78 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
79 {
80     LPSTR szMachineName;
81     LPSTR szObjectName;
82     LPSTR szInstanceName;
83     LPSTR szParentInstance;
84     DWORD dwInstanceIndex;
85     LPSTR szCounterName;
86 } PDH_COUNTER_PATH_ELEMENTS_A, *PPDH_COUNTER_PATH_ELEMENTS_A;
87
88 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
89 {
90     LPWSTR szMachineName;
91     LPWSTR szObjectName;
92     LPWSTR szInstanceName;
93     LPWSTR szParentInstance;
94     DWORD  dwInstanceIndex;
95     LPWSTR szCounterName;
96 } PDH_COUNTER_PATH_ELEMENTS_W, *PPDH_COUNTER_PATH_ELEMENTS_W;
97
98 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
99 {
100     LPSTR szMachineName;
101     GUID  ObjectGUID;
102     DWORD dwItemId;
103     LPSTR szInstanceName;
104 } PDH_DATA_ITEM_PATH_ELEMENTS_A, *PPDH_DATA_ITEM_PATH_ELEMENTS_A;
105
106 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
107 {
108     LPWSTR szMachineName;
109     GUID   ObjectGUID;
110     DWORD  dwItemId;
111     LPWSTR szInstanceName;
112 } PDH_DATA_ITEM_PATH_ELEMENTS_W, *PPDH_DATA_ITEM_PATH_ELEMENTS_W;
113
114 typedef struct _PDH_COUNTER_INFO_A
115 {
116     DWORD     dwLength;
117     DWORD     dwType;
118     DWORD     CVersion;
119     DWORD     CStatus;
120     LONG      lScale;
121     LONG      lDefaultScale;
122     DWORD_PTR dwUserData;
123     DWORD_PTR dwQueryUserData;
124     LPSTR     szFullPath;
125     union
126     {
127         PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
128         PDH_COUNTER_PATH_ELEMENTS_A   CounterPath;
129         struct
130         {
131             LPSTR szMachineName;
132             LPSTR szObjectName;
133             LPSTR szInstanceName;
134             LPSTR szParentInstance;
135             DWORD dwInstanceIndex;
136             LPSTR szCounterName;
137         } DUMMYSTRUCTNAME;
138     } DUMMYUNIONNAME;
139     LPSTR szExplainText;
140     DWORD DataBuffer[1];
141 } PDH_COUNTER_INFO_A, *PPDH_COUNTER_INFO_A;
142
143 typedef struct _PDH_COUNTER_INFO_W
144 {
145     DWORD     dwLength;
146     DWORD     dwType;
147     DWORD     CVersion;
148     DWORD     CStatus;
149     LONG      lScale;
150     LONG      lDefaultScale;
151     DWORD_PTR dwUserData;
152     DWORD_PTR dwQueryUserData;
153     LPWSTR    szFullPath;
154     union
155     {
156         PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath;
157         PDH_COUNTER_PATH_ELEMENTS_W   CounterPath;
158         struct
159         {
160             LPWSTR szMachineName;
161             LPWSTR szObjectName;
162             LPWSTR szInstanceName;
163             LPWSTR szParentInstance;
164             DWORD  dwInstanceIndex;
165             LPWSTR szCounterName;
166         } DUMMYSTRUCTNAME;
167     } DUMMYUNIONNAME;
168     LPWSTR szExplainText;
169     DWORD DataBuffer[1];
170 } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W;
171
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)
212
213 #ifdef __cplusplus
214 }
215 #endif
216
217 #endif /* _PDH_H_ */