2 * Copyright (C) 2005 Mike McCormack
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.
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.
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
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
33 typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
35 struct _EVENT_TRACE_LOGFILEA;
36 struct _EVENT_TRACE_LOGFILEW;
38 typedef struct _EVENT_TRACE_LOGFILEA EVENT_TRACE_LOGFILEA, *PEVENT_TRACE_LOGFILEA;
39 typedef struct _EVENT_TRACE_LOGFILEW EVENT_TRACE_LOGFILEW, *PEVENT_TRACE_LOGFILEW;
41 typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKA)( PEVENT_TRACE_LOGFILEA );
42 typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKW)( PEVENT_TRACE_LOGFILEW );
44 typedef ULONG (WINAPI * WMIDPREQUEST)( WMIDPREQUESTCODE, PVOID, ULONG*, PVOID );
46 typedef struct _TRACE_GUID_REGISTRATION
50 } TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION;
52 typedef struct _EVENT_TRACE_HEADER
57 USHORT FieldTypeFlags;
76 LARGE_INTEGER TimeStamp;
95 } EVENT_TRACE_HEADER, *PEVENT_TRACE_HEADER;
97 typedef struct _EVENT_TRACE
99 EVENT_TRACE_HEADER Header;
101 ULONG ParentInstanceId;
106 } EVENT_TRACE, *PEVENT_TRACE;
108 typedef VOID (WINAPI * PEVENT_CALLBACK)( PEVENT_TRACE );
110 typedef struct _TRACE_LOGFILE_HEADER
121 UCHAR SubMinorVersion;
124 ULONG ProviderVersion;
125 ULONG NumberOfProcessors;
126 LARGE_INTEGER EndTime;
127 ULONG TimerResolution;
128 ULONG MaximumFileSize;
130 ULONG BuffersWritten;
133 GUID LogInstanceGuid;
144 TIME_ZONE_INFORMATION TimeZone;
145 LARGE_INTEGER BootTime;
146 LARGE_INTEGER PerfFreq;
147 LARGE_INTEGER StartTime;
150 } TRACE_LOGFILE_HEADER, *PTRACE_LOGFILE_HEADER;
152 struct _EVENT_TRACE_LOGFILEW
156 LONGLONG CurrentTime;
158 EVENT_TRACE CurrentEvent;
159 TRACE_LOGFILE_HEADER LogfileHeader;
160 PEVENT_TRACE_BUFFER_CALLBACKW BufferCallback;
164 PEVENT_CALLBACK EventCallback;
168 struct _EVENT_TRACE_LOGFILEA
172 LONGLONG CurrentTime;
174 EVENT_TRACE CurrentEvent;
175 TRACE_LOGFILE_HEADER LogfileHeader;
176 PEVENT_TRACE_BUFFER_CALLBACKA BufferCallback;
180 PEVENT_CALLBACK EventCallback;
184 typedef struct _EVENT_TRACE_PROPERTIES
188 ULONG MinimumBuffers;
189 ULONG MaximumBuffers;
190 ULONG MaximumFileSize;
194 ULONG NumberOfBuffers;
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;
205 #define INVALID_PROCESSTRACE_HANDLE ((TRACEHANDLE)~(ULONG_PTR)0)
207 ULONG WINAPI CloseTrace(TRACEHANDLE);
208 ULONG WINAPI ControlTraceA(TRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES,ULONG);
209 ULONG WINAPI ControlTraceW(TRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES,ULONG);
210 #define ControlTrace WINELIB_NAME_AW(ControlTrace)
211 ULONG WINAPI EnableTrace(ULONG,ULONG,ULONG,LPCGUID,TRACEHANDLE);
212 ULONG WINAPI FlushTraceA(TRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES);
213 ULONG WINAPI FlushTraceW(TRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
214 #define FlushTrace WINELIB_NAME_AW(FlushTrace)
215 ULONG WINAPI QueryAllTracesA(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG);
216 ULONG WINAPI QueryAllTracesW(PEVENT_TRACE_PROPERTIES*,ULONG,PULONG);
217 #define QueryAllTraces WINELIB_NAME_AW(QueryAllTraces)
218 ULONG WINAPI RegisterTraceGuidsA(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCSTR,LPCSTR,PTRACEHANDLE);
219 ULONG WINAPI RegisterTraceGuidsW(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCWSTR,LPCWSTR,PTRACEHANDLE);
220 #define RegisterTraceGuids WINELIB_NAME_AW(RegisterTraceGuids)
221 ULONG WINAPI StartTraceA(PTRACEHANDLE,LPCSTR,PEVENT_TRACE_PROPERTIES);
222 ULONG WINAPI StartTraceW(PTRACEHANDLE,LPCWSTR,PEVENT_TRACE_PROPERTIES);
223 #define StartTrace WINELIB_NAME_AW(StartTrace)
224 ULONG WINAPI TraceEvent(TRACEHANDLE,PEVENT_TRACE_HEADER);
225 ULONG WINAPI UnregisterTraceGuids(TRACEHANDLE);
231 #endif /* _EVNTRACE_ */