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 _TRACE_GUID_PROPERTIES
{
59 } TRACE_GUID_PROPERTIES
, *PTRACE_GUID_PROPERTIES
;
61 typedef struct _EVENT_TRACE_HEADER
66 USHORT FieldTypeFlags
;
85 LARGE_INTEGER TimeStamp
;
104 } EVENT_TRACE_HEADER
, *PEVENT_TRACE_HEADER
;
106 typedef struct _EVENT_TRACE
108 EVENT_TRACE_HEADER Header
;
110 ULONG ParentInstanceId
;
115 } EVENT_TRACE
, *PEVENT_TRACE
;
117 typedef VOID (WINAPI
* PEVENT_CALLBACK
)( PEVENT_TRACE
);
119 typedef struct _TRACE_LOGFILE_HEADER
130 UCHAR SubMinorVersion
;
133 ULONG ProviderVersion
;
134 ULONG NumberOfProcessors
;
135 LARGE_INTEGER EndTime
;
136 ULONG TimerResolution
;
137 ULONG MaximumFileSize
;
139 ULONG BuffersWritten
;
142 GUID LogInstanceGuid
;
153 TIME_ZONE_INFORMATION TimeZone
;
154 LARGE_INTEGER BootTime
;
155 LARGE_INTEGER PerfFreq
;
156 LARGE_INTEGER StartTime
;
159 } TRACE_LOGFILE_HEADER
, *PTRACE_LOGFILE_HEADER
;
161 struct _EVENT_TRACE_LOGFILEW
165 LONGLONG CurrentTime
;
167 EVENT_TRACE CurrentEvent
;
168 TRACE_LOGFILE_HEADER LogfileHeader
;
169 PEVENT_TRACE_BUFFER_CALLBACKW BufferCallback
;
173 PEVENT_CALLBACK EventCallback
;
177 struct _EVENT_TRACE_LOGFILEA
181 LONGLONG CurrentTime
;
183 EVENT_TRACE CurrentEvent
;
184 TRACE_LOGFILE_HEADER LogfileHeader
;
185 PEVENT_TRACE_BUFFER_CALLBACKA BufferCallback
;
189 PEVENT_CALLBACK EventCallback
;
193 typedef struct _EVENT_TRACE_PROPERTIES
197 ULONG MinimumBuffers
;
198 ULONG MaximumBuffers
;
199 ULONG MaximumFileSize
;
203 ULONG NumberOfBuffers
;
206 ULONG BuffersWritten
;
207 ULONG LogBuffersLost
;
208 ULONG RealTimeBuffersLost
;
209 HANDLE LoggerThreadId
;
210 ULONG LoggerFileNameOffset
;
211 ULONG LoggerNameOffset
;
212 } EVENT_TRACE_PROPERTIES
, *PEVENT_TRACE_PROPERTIES
;
214 #define INVALID_PROCESSTRACE_HANDLE ((TRACEHANDLE)~(ULONG_PTR)0)
216 ULONG WINAPI
CloseTrace(TRACEHANDLE
);
217 ULONG WINAPI
ControlTraceA(TRACEHANDLE
,LPCSTR
,PEVENT_TRACE_PROPERTIES
,ULONG
);
218 ULONG WINAPI
ControlTraceW(TRACEHANDLE
,LPCWSTR
,PEVENT_TRACE_PROPERTIES
,ULONG
);
219 #define ControlTrace WINELIB_NAME_AW(ControlTrace)
220 ULONG WINAPI
EnableTrace(ULONG
,ULONG
,ULONG
,LPCGUID
,TRACEHANDLE
);
221 ULONG WINAPI
FlushTraceA(TRACEHANDLE
,LPCSTR
,PEVENT_TRACE_PROPERTIES
);
222 ULONG WINAPI
FlushTraceW(TRACEHANDLE
,LPCWSTR
,PEVENT_TRACE_PROPERTIES
);
223 #define FlushTrace WINELIB_NAME_AW(FlushTrace)
224 ULONG WINAPI
QueryAllTracesA(PEVENT_TRACE_PROPERTIES
*,ULONG
,PULONG
);
225 ULONG WINAPI
QueryAllTracesW(PEVENT_TRACE_PROPERTIES
*,ULONG
,PULONG
);
226 #define QueryAllTraces WINELIB_NAME_AW(QueryAllTraces)
227 ULONG WINAPI
RegisterTraceGuidsA(WMIDPREQUEST
,PVOID
,LPCGUID
,ULONG
,PTRACE_GUID_REGISTRATION
,LPCSTR
,LPCSTR
,PTRACEHANDLE
);
228 ULONG WINAPI
RegisterTraceGuidsW(WMIDPREQUEST
,PVOID
,LPCGUID
,ULONG
,PTRACE_GUID_REGISTRATION
,LPCWSTR
,LPCWSTR
,PTRACEHANDLE
);
229 #define RegisterTraceGuids WINELIB_NAME_AW(RegisterTraceGuids)
230 ULONG WINAPI
StartTraceA(PTRACEHANDLE
,LPCSTR
,PEVENT_TRACE_PROPERTIES
);
231 ULONG WINAPI
StartTraceW(PTRACEHANDLE
,LPCWSTR
,PEVENT_TRACE_PROPERTIES
);
232 #define StartTrace WINELIB_NAME_AW(StartTrace)
233 ULONG WINAPI
TraceEvent(TRACEHANDLE
,PEVENT_TRACE_HEADER
);
234 ULONG WINAPIV
TraceMessage(TRACEHANDLE
,ULONG
,LPGUID
,USHORT
,...);
235 ULONG WINAPI
TraceMessageVa(TRACEHANDLE
,ULONG
,LPGUID
,USHORT
,__ms_va_list
);
236 ULONG WINAPI
UnregisterTraceGuids(TRACEHANDLE
);
242 #endif /* _EVNTRACE_ */