msi: Implement and test MsiEnumComponentCostsA/W.
[wine] / include / evntrace.h
1 /*
2  * Copyright (C) 2005 Mike McCormack
3  *
4  * This library is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU Lesser General Public
6  * License as published by the Free Software Foundation; either
7  * version 2.1 of the License, or (at your option) any later version.
8  *
9  * This library is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU Lesser General Public
15  * License along with this library; if not, write to the Free Software
16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
17  */
18
19 #ifndef _EVNTRACE_
20 #define _EVNTRACE_
21
22 #include <guiddef.h>
23
24 #ifdef __cplusplus
25 extern "C" {
26 #endif
27
28 #define EVENT_TRACE_CONTROL_QUERY     0
29 #define EVENT_TRACE_CONTROL_STOP      1
30 #define EVENT_TRACE_CONTROL_UPDATE    2
31 #define EVENT_TRACE_CONTROL_FLUSH     3
32
33 typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
34
35 struct _EVENT_TRACE_LOGFILEA;
36 struct _EVENT_TRACE_LOGFILEW;
37
38 typedef struct _EVENT_TRACE_LOGFILEA EVENT_TRACE_LOGFILEA, *PEVENT_TRACE_LOGFILEA;
39 typedef struct _EVENT_TRACE_LOGFILEW EVENT_TRACE_LOGFILEW, *PEVENT_TRACE_LOGFILEW;
40
41 typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKA)( PEVENT_TRACE_LOGFILEA );
42 typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKW)( PEVENT_TRACE_LOGFILEW );
43
44 typedef ULONG (WINAPI * WMIDPREQUEST)( WMIDPREQUESTCODE, PVOID, ULONG*, PVOID );
45
46 typedef struct _TRACE_GUID_REGISTRATION
47 {
48     LPCGUID Guid;
49     HANDLE RegHandle;
50 } TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION;
51
52 typedef struct _EVENT_TRACE_HEADER
53 {
54     USHORT Size;
55     union
56     {
57         USHORT FieldTypeFlags;
58         struct
59         {
60             UCHAR HeaderType;
61             UCHAR MarkerFlags;
62         } DUMMYSTRUCTNAME;
63     } DUMMYUNIONNAME;
64     union
65     {
66         ULONG Version;
67         struct
68         {
69             UCHAR Type;
70             UCHAR Level;
71             USHORT Version;
72         } Class;
73     } DUMMYUNIONNAME1;
74     ULONG ThreadId;
75     ULONG ProcessId;
76     LARGE_INTEGER TimeStamp;
77     union
78     {
79         GUID Guid;
80         ULONGLONG GuidPtr;
81     } DUMMYUNIONNAME2;
82     union
83     {
84         struct
85         {
86             ULONG ClientContext;
87             ULONG Flags;
88         } DUMMYSTRUCTNAME1;
89         struct
90         {
91             ULONG KernelTime;
92             ULONG UserTime;
93         } DUMMYSTRUCTNAME2;
94     } DUMMYUNIONNAME3;
95 } EVENT_TRACE_HEADER, *PEVENT_TRACE_HEADER;
96
97 typedef struct _EVENT_TRACE
98 {
99     EVENT_TRACE_HEADER Header;
100     ULONG InstanceId;
101     ULONG ParentInstanceId;
102     GUID ParentGuid;
103     PVOID MofData;
104     ULONG MofLength;
105     ULONG ClientContext;
106 } EVENT_TRACE, *PEVENT_TRACE;
107
108 typedef VOID (WINAPI * PEVENT_CALLBACK)( PEVENT_TRACE );
109
110 typedef struct _TRACE_LOGFILE_HEADER
111 {
112     ULONG BufferSize;
113     union
114     {
115         ULONG Version;
116         struct 
117         {
118             UCHAR MajorVersion;
119             UCHAR MinorVersion;
120             UCHAR SubVersion;
121             UCHAR SubMinorVersion;
122         } VersionDetail;
123     } DUMMYUNIONNAME;
124     ULONG ProviderVersion;
125     ULONG NumberOfProcessors;
126     LARGE_INTEGER EndTime;
127     ULONG TimerResolution;
128     ULONG MaximumFileSize;
129     ULONG LogFileMode;
130     ULONG BuffersWritten;
131     union
132     {
133         GUID LogInstanceGuid;
134         struct
135         {
136             ULONG StartBuffers;
137             ULONG PointerSize;
138             ULONG EventsLost;
139             ULONG CpuSpeedInMHZ;
140         } DUMMYSTRUCTNAME;
141     } DUMMYUNIONNAME1;
142     LPWSTR LoggerName;
143     LPWSTR LogFileName;
144     TIME_ZONE_INFORMATION TimeZone;
145     LARGE_INTEGER BootTime;
146     LARGE_INTEGER PerfFreq;
147     LARGE_INTEGER StartTime;
148     ULONG ReservedTime;
149     ULONG BuffersLost;
150 } TRACE_LOGFILE_HEADER, *PTRACE_LOGFILE_HEADER;
151
152 struct _EVENT_TRACE_LOGFILEW
153 {
154     LPWSTR LogFileName;
155     LPWSTR LoggerName;
156     LONGLONG CurrentTime;
157     ULONG LogFileMode;
158     EVENT_TRACE CurrentEvent;
159     TRACE_LOGFILE_HEADER LogfileHeader;
160     PEVENT_TRACE_BUFFER_CALLBACKW BufferCallback;
161     ULONG BufferSize;
162     ULONG Filled;
163     ULONG EventsLost;
164     PEVENT_CALLBACK EventCallback;
165     PVOID Context;
166 };
167
168 struct _EVENT_TRACE_LOGFILEA
169 {
170     LPSTR LogFileName;
171     LPSTR LoggerName;
172     LONGLONG CurrentTime;
173     ULONG LogFileMode;
174     EVENT_TRACE CurrentEvent;
175     TRACE_LOGFILE_HEADER LogfileHeader;
176     PEVENT_TRACE_BUFFER_CALLBACKA BufferCallback;
177     ULONG BufferSize;
178     ULONG Filled;
179     ULONG EventsLost;
180     PEVENT_CALLBACK EventCallback;
181     PVOID Context;
182 };
183
184 typedef struct _EVENT_TRACE_PROPERTIES
185 {
186     WNODE_HEADER Wnode;
187     ULONG BufferSize;
188     ULONG MinimumBuffers;
189     ULONG MaximumBuffers;
190     ULONG MaximumFileSize;
191     ULONG LogFileMode;
192     ULONG FlushTimer;
193     LONG AgeLimit;
194     ULONG NumberOfBuffers;
195     ULONG FreeBuffers;
196     ULONG EventsLost;
197     ULONG BuffersWritten;
198     ULONG LogBuffersLost;
199     ULONG RealTimeBuffersLost;
200     HANDLE LoggerThreadId;
201     ULONG LoggerFileNameOffset;
202     ULONG LoggerNameOffset;
203 } EVENT_TRACE_PROPERTIES, *PEVENT_TRACE_PROPERTIES;
204
205 ULONG WINAPI CloseTrace(TRACEHANDLE);
206 ULONG WINAPI ControlTraceA(TRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES,ULONG);
207 ULONG WINAPI ControlTraceW(TRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES,ULONG);
208 #define      ControlTrace WINELIB_NAME_AW(ControlTrace)
209 ULONG WINAPI EnableTrace(ULONG,ULONG,ULONG,LPCGUID,TRACEHANDLE);
210 ULONG WINAPI FlushTraceA(TRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES);
211 ULONG WINAPI FlushTraceW(TRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
212 #define      FlushTrace WINELIB_NAME_AW(FlushTrace)
213 ULONG WINAPI QueryAllTracesA(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG);
214 ULONG WINAPI QueryAllTracesW(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG);
215 #define      QueryAllTraces WINELIB_NAME_AW(QueryAllTraces)
216 ULONG WINAPI RegisterTraceGuidsA(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCSTR,LPCSTR,PTRACEHANDLE);
217 ULONG WINAPI RegisterTraceGuidsW(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCWSTR,LPCWSTR,PTRACEHANDLE);
218 #define      RegisterTraceGuids WINELIB_NAME_AW(RegisterTraceGuids)
219 ULONG WINAPI StartTraceA(PTRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES);
220 ULONG WINAPI StartTraceW(PTRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
221 #define      StartTrace WINELIB_NAME_AW(StartTrace)
222 ULONG WINAPI TraceEvent(TRACEHANDLE,PEVENT_TRACE_HEADER);
223 ULONG WINAPI UnregisterTraceGuids(TRACEHANDLE);
224
225 #ifdef __cplusplus
226 }
227 #endif
228
229 #endif /* _EVNTRACE_ */