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 | /*
|
---|
20 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
21 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
22 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
23 | * a choice of LGPL license versions is made available with the language indicating
|
---|
24 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
25 | * of the LGPL is applied is otherwise unspecified.
|
---|
26 | */
|
---|
27 |
|
---|
28 | #ifndef _EVNTRACE_
|
---|
29 | #define _EVNTRACE_
|
---|
30 |
|
---|
31 | #include <guiddef.h>
|
---|
32 |
|
---|
33 | #ifdef __cplusplus
|
---|
34 | extern "C" {
|
---|
35 | #endif
|
---|
36 |
|
---|
37 | #define EVENT_TRACE_CONTROL_QUERY 0
|
---|
38 | #define EVENT_TRACE_CONTROL_STOP 1
|
---|
39 | #define EVENT_TRACE_CONTROL_UPDATE 2
|
---|
40 | #define EVENT_TRACE_CONTROL_FLUSH 3
|
---|
41 |
|
---|
42 | typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
|
---|
43 |
|
---|
44 | struct _EVENT_TRACE_LOGFILEA;
|
---|
45 | struct _EVENT_TRACE_LOGFILEW;
|
---|
46 |
|
---|
47 | typedef struct _EVENT_TRACE_LOGFILEA EVENT_TRACE_LOGFILEA, *PEVENT_TRACE_LOGFILEA;
|
---|
48 | typedef struct _EVENT_TRACE_LOGFILEW EVENT_TRACE_LOGFILEW, *PEVENT_TRACE_LOGFILEW;
|
---|
49 |
|
---|
50 | typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKA)( PEVENT_TRACE_LOGFILEA );
|
---|
51 | typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKW)( PEVENT_TRACE_LOGFILEW );
|
---|
52 |
|
---|
53 | typedef ULONG (WINAPI * WMIDPREQUEST)( WMIDPREQUESTCODE, PVOID, ULONG*, PVOID );
|
---|
54 |
|
---|
55 | typedef struct _TRACE_GUID_REGISTRATION
|
---|
56 | {
|
---|
57 | LPCGUID Guid;
|
---|
58 | HANDLE RegHandle;
|
---|
59 | } TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION;
|
---|
60 |
|
---|
61 | typedef struct _TRACE_GUID_PROPERTIES {
|
---|
62 | GUID Guid;
|
---|
63 | ULONG GuidType;
|
---|
64 | ULONG LoggerId;
|
---|
65 | ULONG EnableLevel;
|
---|
66 | ULONG EnableFlags;
|
---|
67 | BOOLEAN IsEnable;
|
---|
68 | } TRACE_GUID_PROPERTIES, *PTRACE_GUID_PROPERTIES;
|
---|
69 |
|
---|
70 | typedef struct _EVENT_TRACE_HEADER
|
---|
71 | {
|
---|
72 | USHORT Size;
|
---|
73 | union
|
---|
74 | {
|
---|
75 | USHORT FieldTypeFlags;
|
---|
76 | struct
|
---|
77 | {
|
---|
78 | UCHAR HeaderType;
|
---|
79 | UCHAR MarkerFlags;
|
---|
80 | } DUMMYSTRUCTNAME;
|
---|
81 | } DUMMYUNIONNAME;
|
---|
82 | union
|
---|
83 | {
|
---|
84 | ULONG Version;
|
---|
85 | struct
|
---|
86 | {
|
---|
87 | UCHAR Type;
|
---|
88 | UCHAR Level;
|
---|
89 | USHORT Version;
|
---|
90 | } Class;
|
---|
91 | } DUMMYUNIONNAME1;
|
---|
92 | ULONG ThreadId;
|
---|
93 | ULONG ProcessId;
|
---|
94 | LARGE_INTEGER TimeStamp;
|
---|
95 | union
|
---|
96 | {
|
---|
97 | GUID Guid;
|
---|
98 | ULONGLONG GuidPtr;
|
---|
99 | } DUMMYUNIONNAME2;
|
---|
100 | union
|
---|
101 | {
|
---|
102 | struct
|
---|
103 | {
|
---|
104 | ULONG ClientContext;
|
---|
105 | ULONG Flags;
|
---|
106 | } DUMMYSTRUCTNAME1;
|
---|
107 | struct
|
---|
108 | {
|
---|
109 | ULONG KernelTime;
|
---|
110 | ULONG UserTime;
|
---|
111 | } DUMMYSTRUCTNAME2;
|
---|
112 | } DUMMYUNIONNAME3;
|
---|
113 | } EVENT_TRACE_HEADER, *PEVENT_TRACE_HEADER;
|
---|
114 |
|
---|
115 | typedef struct _EVENT_TRACE
|
---|
116 | {
|
---|
117 | EVENT_TRACE_HEADER Header;
|
---|
118 | ULONG InstanceId;
|
---|
119 | ULONG ParentInstanceId;
|
---|
120 | GUID ParentGuid;
|
---|
121 | PVOID MofData;
|
---|
122 | ULONG MofLength;
|
---|
123 | ULONG ClientContext;
|
---|
124 | } EVENT_TRACE, *PEVENT_TRACE;
|
---|
125 |
|
---|
126 | typedef VOID (WINAPI * PEVENT_CALLBACK)( PEVENT_TRACE );
|
---|
127 |
|
---|
128 | typedef struct _TRACE_LOGFILE_HEADER
|
---|
129 | {
|
---|
130 | ULONG BufferSize;
|
---|
131 | union
|
---|
132 | {
|
---|
133 | ULONG Version;
|
---|
134 | struct
|
---|
135 | {
|
---|
136 | UCHAR MajorVersion;
|
---|
137 | UCHAR MinorVersion;
|
---|
138 | UCHAR SubVersion;
|
---|
139 | UCHAR SubMinorVersion;
|
---|
140 | } VersionDetail;
|
---|
141 | } DUMMYUNIONNAME;
|
---|
142 | ULONG ProviderVersion;
|
---|
143 | ULONG NumberOfProcessors;
|
---|
144 | LARGE_INTEGER EndTime;
|
---|
145 | ULONG TimerResolution;
|
---|
146 | ULONG MaximumFileSize;
|
---|
147 | ULONG LogFileMode;
|
---|
148 | ULONG BuffersWritten;
|
---|
149 | union
|
---|
150 | {
|
---|
151 | GUID LogInstanceGuid;
|
---|
152 | struct
|
---|
153 | {
|
---|
154 | ULONG StartBuffers;
|
---|
155 | ULONG PointerSize;
|
---|
156 | ULONG EventsLost;
|
---|
157 | ULONG CpuSpeedInMHZ;
|
---|
158 | } DUMMYSTRUCTNAME;
|
---|
159 | } DUMMYUNIONNAME1;
|
---|
160 | LPWSTR LoggerName;
|
---|
161 | LPWSTR LogFileName;
|
---|
162 | TIME_ZONE_INFORMATION TimeZone;
|
---|
163 | LARGE_INTEGER BootTime;
|
---|
164 | LARGE_INTEGER PerfFreq;
|
---|
165 | LARGE_INTEGER StartTime;
|
---|
166 | ULONG ReservedTime;
|
---|
167 | ULONG BuffersLost;
|
---|
168 | } TRACE_LOGFILE_HEADER, *PTRACE_LOGFILE_HEADER;
|
---|
169 |
|
---|
170 | struct _EVENT_TRACE_LOGFILEW
|
---|
171 | {
|
---|
172 | LPWSTR LogFileName;
|
---|
173 | LPWSTR LoggerName;
|
---|
174 | LONGLONG CurrentTime;
|
---|
175 | ULONG LogFileMode;
|
---|
176 | EVENT_TRACE CurrentEvent;
|
---|
177 | TRACE_LOGFILE_HEADER LogfileHeader;
|
---|
178 | PEVENT_TRACE_BUFFER_CALLBACKW BufferCallback;
|
---|
179 | ULONG BufferSize;
|
---|
180 | ULONG Filled;
|
---|
181 | ULONG EventsLost;
|
---|
182 | PEVENT_CALLBACK EventCallback;
|
---|
183 | PVOID Context;
|
---|
184 | };
|
---|
185 |
|
---|
186 | struct _EVENT_TRACE_LOGFILEA
|
---|
187 | {
|
---|
188 | LPSTR LogFileName;
|
---|
189 | LPSTR LoggerName;
|
---|
190 | LONGLONG CurrentTime;
|
---|
191 | ULONG LogFileMode;
|
---|
192 | EVENT_TRACE CurrentEvent;
|
---|
193 | TRACE_LOGFILE_HEADER LogfileHeader;
|
---|
194 | PEVENT_TRACE_BUFFER_CALLBACKA BufferCallback;
|
---|
195 | ULONG BufferSize;
|
---|
196 | ULONG Filled;
|
---|
197 | ULONG EventsLost;
|
---|
198 | PEVENT_CALLBACK EventCallback;
|
---|
199 | PVOID Context;
|
---|
200 | };
|
---|
201 |
|
---|
202 | typedef struct _EVENT_TRACE_PROPERTIES
|
---|
203 | {
|
---|
204 | WNODE_HEADER Wnode;
|
---|
205 | ULONG BufferSize;
|
---|
206 | ULONG MinimumBuffers;
|
---|
207 | ULONG MaximumBuffers;
|
---|
208 | ULONG MaximumFileSize;
|
---|
209 | ULONG LogFileMode;
|
---|
210 | ULONG FlushTimer;
|
---|
211 | LONG AgeLimit;
|
---|
212 | ULONG NumberOfBuffers;
|
---|
213 | ULONG FreeBuffers;
|
---|
214 | ULONG EventsLost;
|
---|
215 | ULONG BuffersWritten;
|
---|
216 | ULONG LogBuffersLost;
|
---|
217 | ULONG RealTimeBuffersLost;
|
---|
218 | HANDLE LoggerThreadId;
|
---|
219 | ULONG LoggerFileNameOffset;
|
---|
220 | ULONG LoggerNameOffset;
|
---|
221 | } EVENT_TRACE_PROPERTIES, *PEVENT_TRACE_PROPERTIES;
|
---|
222 |
|
---|
223 | #define INVALID_PROCESSTRACE_HANDLE ((TRACEHANDLE)~(ULONG_PTR)0)
|
---|
224 |
|
---|
225 | ULONG WINAPI CloseTrace(TRACEHANDLE);
|
---|
226 | ULONG WINAPI ControlTraceA(TRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES,ULONG);
|
---|
227 | ULONG WINAPI ControlTraceW(TRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES,ULONG);
|
---|
228 | #define ControlTrace WINELIB_NAME_AW(ControlTrace)
|
---|
229 | ULONG WINAPI EnableTrace(ULONG,ULONG,ULONG,LPCGUID,TRACEHANDLE);
|
---|
230 | ULONG WINAPI FlushTraceA(TRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES);
|
---|
231 | ULONG WINAPI FlushTraceW(TRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
|
---|
232 | #define FlushTrace WINELIB_NAME_AW(FlushTrace)
|
---|
233 | ULONG WINAPI QueryAllTracesA(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG);
|
---|
234 | ULONG WINAPI QueryAllTracesW(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG);
|
---|
235 | #define QueryAllTraces WINELIB_NAME_AW(QueryAllTraces)
|
---|
236 | ULONG WINAPI RegisterTraceGuidsA(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCSTR,LPCSTR,PTRACEHANDLE);
|
---|
237 | ULONG WINAPI RegisterTraceGuidsW(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCWSTR,LPCWSTR,PTRACEHANDLE);
|
---|
238 | #define RegisterTraceGuids WINELIB_NAME_AW(RegisterTraceGuids)
|
---|
239 | ULONG WINAPI StartTraceA(PTRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES);
|
---|
240 | ULONG WINAPI StartTraceW(PTRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
|
---|
241 | #define StartTrace WINELIB_NAME_AW(StartTrace)
|
---|
242 | ULONG WINAPI TraceEvent(TRACEHANDLE,PEVENT_TRACE_HEADER);
|
---|
243 | ULONG WINAPIV TraceMessage(TRACEHANDLE,ULONG,LPGUID,USHORT,...);
|
---|
244 | ULONG WINAPI TraceMessageVa(TRACEHANDLE,ULONG,LPGUID,USHORT,__ms_va_list);
|
---|
245 | ULONG WINAPI UnregisterTraceGuids(TRACEHANDLE);
|
---|
246 |
|
---|
247 | #ifdef __cplusplus
|
---|
248 | }
|
---|
249 | #endif
|
---|
250 |
|
---|
251 | #endif /* _EVNTRACE_ */
|
---|