wined3d: In device_map_psamplers(), only touch the sampler mapping for samplers that...
[wine/hacks.git] / include / pdh.h
blobde5dad3db3833ac987e5359fbba172871dd256d4
1 /*
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
21 #ifndef _PDH_H_
22 #define _PDH_H_
24 #ifdef __WINESRC__
25 # include <windef.h>
26 #else
27 # include <windows.h>
28 #endif
29 #include <winperf.h>
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
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_FMT_LONG 0x00000100
43 #define PDH_FMT_DOUBLE 0x00000200
44 #define PDH_FMT_LARGE 0x00000400
45 #define PDH_FMT_NOSCALE 0x00001000
46 #define PDH_FMT_1000 0x00002000
47 #define PDH_FMT_NOCAP100 0x00008000
49 typedef struct _PDH_FMT_COUNTERVALUE
51 DWORD CStatus;
52 union
54 LONG longValue;
55 double doubleValue;
56 LONGLONG largeValue;
57 LPCSTR AnsiStringValue;
58 LPCWSTR WideStringValue;
59 } DUMMYUNIONNAME;
60 } PDH_FMT_COUNTERVALUE, *PPDH_FMT_COUNTERVALUE;
62 typedef struct _PDH_RAW_COUNTER
64 DWORD CStatus;
65 FILETIME TimeStamp;
66 LONGLONG FirstValue;
67 LONGLONG SecondValue;
68 DWORD MultiCount;
69 } PDH_RAW_COUNTER, *PPDH_RAW_COUNTER;
71 typedef struct _PDH_COUNTER_PATH_ELEMENTS_A
73 LPSTR szMachineName;
74 LPSTR szObjectName;
75 LPSTR szInstanceName;
76 LPSTR szParentInstance;
77 DWORD dwInstanceIndex;
78 LPSTR szCounterName;
79 } PDH_COUNTER_PATH_ELEMENTS_A, *PPDH_COUNTER_PATH_ELEMENTS_A;
81 typedef struct _PDH_COUNTER_PATH_ELEMENTS_W
83 LPWSTR szMachineName;
84 LPWSTR szObjectName;
85 LPWSTR szInstanceName;
86 LPWSTR szParentInstance;
87 DWORD dwInstanceIndex;
88 LPWSTR szCounterName;
89 } PDH_COUNTER_PATH_ELEMENTS_W, *PPDH_COUNTER_PATH_ELEMENTS_W;
91 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_A
93 LPSTR szMachineName;
94 GUID ObjectGUID;
95 DWORD dwItemId;
96 LPSTR szInstanceName;
97 } PDH_DATA_ITEM_PATH_ELEMENTS_A, *PPDH_DATA_ITEM_PATH_ELEMENTS_A;
99 typedef struct _PDH_DATA_ITEM_PATH_ELEMENTS_W
101 LPWSTR szMachineName;
102 GUID ObjectGUID;
103 DWORD dwItemId;
104 LPWSTR szInstanceName;
105 } PDH_DATA_ITEM_PATH_ELEMENTS_W, *PPDH_DATA_ITEM_PATH_ELEMENTS_W;
107 typedef struct _PDH_COUNTER_INFO_A
109 DWORD dwLength;
110 DWORD dwType;
111 DWORD CVersion;
112 DWORD CStatus;
113 LONG lScale;
114 LONG lDefaultScale;
115 DWORD_PTR dwUserData;
116 DWORD_PTR dwQueryUserData;
117 LPSTR szFullPath;
118 union
120 PDH_DATA_ITEM_PATH_ELEMENTS_A DataItemPath;
121 PDH_COUNTER_PATH_ELEMENTS_A CounterPath;
122 struct
124 LPSTR szMachineName;
125 LPSTR szObjectName;
126 LPSTR szInstanceName;
127 LPSTR szParentInstance;
128 DWORD dwInstanceIndex;
129 LPSTR szCounterName;
130 } DUMMYSTRUCTNAME;
131 } DUMMYUNIONNAME;
132 LPSTR szExplainText;
133 DWORD DataBuffer[1];
134 } PDH_COUNTER_INFO_A, *PPDH_COUNTER_INFO_A;
136 typedef struct _PDH_COUNTER_INFO_W
138 DWORD dwLength;
139 DWORD dwType;
140 DWORD CVersion;
141 DWORD CStatus;
142 LONG lScale;
143 LONG lDefaultScale;
144 DWORD_PTR dwUserData;
145 DWORD_PTR dwQueryUserData;
146 LPWSTR szFullPath;
147 union
149 PDH_DATA_ITEM_PATH_ELEMENTS_W DataItemPath;
150 PDH_COUNTER_PATH_ELEMENTS_W CounterPath;
151 struct
153 LPWSTR szMachineName;
154 LPWSTR szObjectName;
155 LPWSTR szInstanceName;
156 LPWSTR szParentInstance;
157 DWORD dwInstanceIndex;
158 LPWSTR szCounterName;
159 } DUMMYSTRUCTNAME;
160 } DUMMYUNIONNAME;
161 LPWSTR szExplainText;
162 DWORD DataBuffer[1];
163 } PDH_COUNTER_INFO_W, *PPDH_COUNTER_INFO_W;
165 PDH_STATUS WINAPI PdhAddCounterA(PDH_HQUERY, LPCSTR, DWORD_PTR, PDH_HCOUNTER *);
166 PDH_STATUS WINAPI PdhAddCounterW(PDH_HQUERY, LPCWSTR, DWORD_PTR, PDH_HCOUNTER *);
167 #define PdhAddCounter WINELIB_NAME_AW(PdhAddCounter)
168 PDH_STATUS WINAPI PdhCloseQuery(PDH_HQUERY);
169 PDH_STATUS WINAPI PdhCollectQueryData(PDH_HQUERY);
170 PDH_STATUS WINAPI PdhGetCounterInfoA(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_A);
171 PDH_STATUS WINAPI PdhGetCounterInfoW(PDH_HCOUNTER, BOOLEAN, LPDWORD, PPDH_COUNTER_INFO_W);
172 #define PdhGetCounterInfo WINELIB_NAME_AW(PdhGetCounterInfo)
173 PDH_STATUS WINAPI PdhGetCounterTimeBase(PDH_HCOUNTER, LONGLONG *);
174 PDH_STATUS WINAPI PdhGetFormattedCounterValue(PDH_HCOUNTER, DWORD, LPDWORD, PPDH_FMT_COUNTERVALUE);
175 PDH_STATUS WINAPI PdhGetRawCounterValue(PDH_HCOUNTER, LPDWORD, PPDH_RAW_COUNTER);
176 PDH_STATUS WINAPI PdhOpenQueryA(LPCSTR, DWORD_PTR, PDH_HQUERY *);
177 PDH_STATUS WINAPI PdhOpenQueryW(LPCWSTR, DWORD_PTR, PDH_HQUERY *);
178 #define PdhOpenQuery WINELIB_NAME_AW(PdhOpenQuery)
179 PDH_STATUS WINAPI PdhRemoveCounter(PDH_HCOUNTER);
180 PDH_STATUS WINAPI PdhSetCounterScaleFactor(PDH_HCOUNTER, LONG);
182 #ifdef __cplusplus
184 #endif
186 #endif /* _PDH_H_ */