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 #define TRACE_LEVEL_NONE 0
34 #define TRACE_LEVEL_CRITICAL 1
35 #define TRACE_LEVEL_FATAL 1
36 #define TRACE_LEVEL_ERROR 2
37 #define TRACE_LEVEL_WARNING 3
38 #define TRACE_LEVEL_INFORMATION 4
39 #define TRACE_LEVEL_VERBOSE 5
41 typedef ULONG64 TRACEHANDLE
, *PTRACEHANDLE
;
43 struct _EVENT_TRACE_LOGFILEA
;
44 struct _EVENT_TRACE_LOGFILEW
;
46 typedef struct _EVENT_TRACE_LOGFILEA EVENT_TRACE_LOGFILEA
, *PEVENT_TRACE_LOGFILEA
;
47 typedef struct _EVENT_TRACE_LOGFILEW EVENT_TRACE_LOGFILEW
, *PEVENT_TRACE_LOGFILEW
;
49 typedef ULONG (WINAPI
* PEVENT_TRACE_BUFFER_CALLBACKA
)( PEVENT_TRACE_LOGFILEA
);
50 typedef ULONG (WINAPI
* PEVENT_TRACE_BUFFER_CALLBACKW
)( PEVENT_TRACE_LOGFILEW
);
52 typedef ULONG (WINAPI
* WMIDPREQUEST
)( WMIDPREQUESTCODE
, PVOID
, ULONG
*, PVOID
);
54 typedef struct _TRACE_GUID_REGISTRATION
58 } TRACE_GUID_REGISTRATION
, *PTRACE_GUID_REGISTRATION
;
60 typedef struct _TRACE_GUID_PROPERTIES
{
67 } TRACE_GUID_PROPERTIES
, *PTRACE_GUID_PROPERTIES
;
69 typedef struct _EVENT_TRACE_HEADER
74 USHORT FieldTypeFlags
;
93 LARGE_INTEGER TimeStamp
;
112 } EVENT_TRACE_HEADER
, *PEVENT_TRACE_HEADER
;
114 typedef struct _EVENT_TRACE
116 EVENT_TRACE_HEADER Header
;
118 ULONG ParentInstanceId
;
123 } EVENT_TRACE
, *PEVENT_TRACE
;
125 typedef VOID (WINAPI
* PEVENT_CALLBACK
)( PEVENT_TRACE
);
127 typedef struct _TRACE_LOGFILE_HEADER
138 UCHAR SubMinorVersion
;
141 ULONG ProviderVersion
;
142 ULONG NumberOfProcessors
;
143 LARGE_INTEGER EndTime
;
144 ULONG TimerResolution
;
145 ULONG MaximumFileSize
;
147 ULONG BuffersWritten
;
150 GUID LogInstanceGuid
;
161 TIME_ZONE_INFORMATION TimeZone
;
162 LARGE_INTEGER BootTime
;
163 LARGE_INTEGER PerfFreq
;
164 LARGE_INTEGER StartTime
;
167 } TRACE_LOGFILE_HEADER
, *PTRACE_LOGFILE_HEADER
;
169 struct _EVENT_TRACE_LOGFILEW
173 LONGLONG CurrentTime
;
175 EVENT_TRACE CurrentEvent
;
176 TRACE_LOGFILE_HEADER LogfileHeader
;
177 PEVENT_TRACE_BUFFER_CALLBACKW BufferCallback
;
181 PEVENT_CALLBACK EventCallback
;
185 struct _EVENT_TRACE_LOGFILEA
189 LONGLONG CurrentTime
;
191 EVENT_TRACE CurrentEvent
;
192 TRACE_LOGFILE_HEADER LogfileHeader
;
193 PEVENT_TRACE_BUFFER_CALLBACKA BufferCallback
;
197 PEVENT_CALLBACK EventCallback
;
201 typedef struct _EVENT_TRACE_PROPERTIES
205 ULONG MinimumBuffers
;
206 ULONG MaximumBuffers
;
207 ULONG MaximumFileSize
;
211 ULONG NumberOfBuffers
;
214 ULONG BuffersWritten
;
215 ULONG LogBuffersLost
;
216 ULONG RealTimeBuffersLost
;
217 HANDLE LoggerThreadId
;
218 ULONG LoggerFileNameOffset
;
219 ULONG LoggerNameOffset
;
220 } EVENT_TRACE_PROPERTIES
, *PEVENT_TRACE_PROPERTIES
;
222 #define INVALID_PROCESSTRACE_HANDLE ((TRACEHANDLE)~(ULONG_PTR)0)
224 ULONG WINAPI
CloseTrace(TRACEHANDLE
);
225 ULONG WINAPI
ControlTraceA(TRACEHANDLE
,LPCSTR
,PEVENT_TRACE_PROPERTIES
,ULONG
);
226 ULONG WINAPI
ControlTraceW(TRACEHANDLE
,LPCWSTR
,PEVENT_TRACE_PROPERTIES
,ULONG
);
227 #define ControlTrace WINELIB_NAME_AW(ControlTrace)
228 ULONG WINAPI
EnableTrace(ULONG
,ULONG
,ULONG
,LPCGUID
,TRACEHANDLE
);
229 ULONG WINAPI
FlushTraceA(TRACEHANDLE
,LPCSTR
,PEVENT_TRACE_PROPERTIES
);
230 ULONG WINAPI
FlushTraceW(TRACEHANDLE
,LPCWSTR
,PEVENT_TRACE_PROPERTIES
);
231 #define FlushTrace WINELIB_NAME_AW(FlushTrace)
232 ULONG WINAPI
GetTraceEnableFlags(TRACEHANDLE
);
233 UCHAR WINAPI
GetTraceEnableLevel(TRACEHANDLE
);
234 TRACEHANDLE WINAPI
GetTraceLoggerHandle(PVOID
);
235 ULONG WINAPI
QueryAllTracesA(PEVENT_TRACE_PROPERTIES
*,ULONG
,PULONG
);
236 ULONG WINAPI
QueryAllTracesW(PEVENT_TRACE_PROPERTIES
*,ULONG
,PULONG
);
237 #define QueryAllTraces WINELIB_NAME_AW(QueryAllTraces)
238 ULONG WINAPI
RegisterTraceGuidsA(WMIDPREQUEST
,PVOID
,LPCGUID
,ULONG
,PTRACE_GUID_REGISTRATION
,LPCSTR
,LPCSTR
,PTRACEHANDLE
);
239 ULONG WINAPI
RegisterTraceGuidsW(WMIDPREQUEST
,PVOID
,LPCGUID
,ULONG
,PTRACE_GUID_REGISTRATION
,LPCWSTR
,LPCWSTR
,PTRACEHANDLE
);
240 #define RegisterTraceGuids WINELIB_NAME_AW(RegisterTraceGuids)
241 ULONG WINAPI
StartTraceA(PTRACEHANDLE
,LPCSTR
,PEVENT_TRACE_PROPERTIES
);
242 ULONG WINAPI
StartTraceW(PTRACEHANDLE
,LPCWSTR
,PEVENT_TRACE_PROPERTIES
);
243 #define StartTrace WINELIB_NAME_AW(StartTrace)
244 ULONG WINAPI
TraceEvent(TRACEHANDLE
,PEVENT_TRACE_HEADER
);
245 ULONG WINAPIV
TraceMessage(TRACEHANDLE
,ULONG
,LPGUID
,USHORT
,...);
246 ULONG WINAPI
TraceMessageVa(TRACEHANDLE
,ULONG
,LPGUID
,USHORT
,__ms_va_list
);
247 ULONG WINAPI
UnregisterTraceGuids(TRACEHANDLE
);
253 #endif /* _EVNTRACE_ */