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 | * Sun 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, Sun 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 | typedef ULONG64 TRACEHANDLE, *PTRACEHANDLE;
|
---|
38 |
|
---|
39 | struct _EVENT_TRACE_LOGFILEA;
|
---|
40 | struct _EVENT_TRACE_LOGFILEW;
|
---|
41 |
|
---|
42 | typedef struct _EVENT_TRACE_LOGFILEA EVENT_TRACE_LOGFILEA, *PEVENT_TRACE_LOGFILEA;
|
---|
43 | typedef struct _EVENT_TRACE_LOGFILEW EVENT_TRACE_LOGFILEW, *PEVENT_TRACE_LOGFILEW;
|
---|
44 |
|
---|
45 | typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKA)( PEVENT_TRACE_LOGFILEA );
|
---|
46 | typedef ULONG (WINAPI * PEVENT_TRACE_BUFFER_CALLBACKW)( PEVENT_TRACE_LOGFILEW );
|
---|
47 |
|
---|
48 | typedef ULONG (WINAPI * WMIDPREQUEST)( WMIDPREQUESTCODE, PVOID, ULONG*, PVOID );
|
---|
49 |
|
---|
50 | typedef struct _TRACE_GUID_REGISTRATION
|
---|
51 | {
|
---|
52 | LPCGUID Guid;
|
---|
53 | HANDLE RegHandle;
|
---|
54 | } TRACE_GUID_REGISTRATION, *PTRACE_GUID_REGISTRATION;
|
---|
55 |
|
---|
56 | typedef struct _EVENT_TRACE_HEADER
|
---|
57 | {
|
---|
58 | USHORT Size;
|
---|
59 | union
|
---|
60 | {
|
---|
61 | USHORT FieldTypeFlags;
|
---|
62 | struct
|
---|
63 | {
|
---|
64 | UCHAR HeaderType;
|
---|
65 | UCHAR MarkerFlags;
|
---|
66 | } DUMMYSTRUCTNAME;
|
---|
67 | } DUMMYUNIONNAME;
|
---|
68 | union
|
---|
69 | {
|
---|
70 | ULONG Version;
|
---|
71 | struct
|
---|
72 | {
|
---|
73 | UCHAR Type;
|
---|
74 | UCHAR Level;
|
---|
75 | USHORT Version;
|
---|
76 | } Class;
|
---|
77 | } DUMMYUNIONNAME1;
|
---|
78 | ULONG ThreadId;
|
---|
79 | ULONG ProcessId;
|
---|
80 | LARGE_INTEGER TimeStamp;
|
---|
81 | union
|
---|
82 | {
|
---|
83 | GUID Guid;
|
---|
84 | ULONGLONG GuidPtr;
|
---|
85 | } DUMMYUNIONNAME2;
|
---|
86 | union
|
---|
87 | {
|
---|
88 | struct
|
---|
89 | {
|
---|
90 | ULONG ClientContext;
|
---|
91 | ULONG Flags;
|
---|
92 | } DUMMYSTRUCTNAME1;
|
---|
93 | struct
|
---|
94 | {
|
---|
95 | ULONG KernelTime;
|
---|
96 | ULONG UserTime;
|
---|
97 | } DUMMYSTRUCTNAME2;
|
---|
98 | } DUMMYUNIONNAME3;
|
---|
99 | } EVENT_TRACE_HEADER, *PEVENT_TRACE_HEADER;
|
---|
100 |
|
---|
101 | typedef struct _EVENT_TRACE
|
---|
102 | {
|
---|
103 | EVENT_TRACE_HEADER Header;
|
---|
104 | ULONG InstanceId;
|
---|
105 | ULONG ParentInstanceId;
|
---|
106 | GUID ParentGuid;
|
---|
107 | PVOID MofData;
|
---|
108 | ULONG MofLength;
|
---|
109 | ULONG ClientContext;
|
---|
110 | } EVENT_TRACE, *PEVENT_TRACE;
|
---|
111 |
|
---|
112 | typedef VOID (WINAPI * PEVENT_CALLBACK)( PEVENT_TRACE );
|
---|
113 |
|
---|
114 | typedef struct _TRACE_LOGFILE_HEADER
|
---|
115 | {
|
---|
116 | ULONG BufferSize;
|
---|
117 | union
|
---|
118 | {
|
---|
119 | ULONG Version;
|
---|
120 | struct
|
---|
121 | {
|
---|
122 | UCHAR MajorVersion;
|
---|
123 | UCHAR MinorVersion;
|
---|
124 | UCHAR SubVersion;
|
---|
125 | UCHAR SubMinorVersion;
|
---|
126 | } VersionDetail;
|
---|
127 | } DUMMYUNIONNAME;
|
---|
128 | ULONG ProviderVersion;
|
---|
129 | ULONG NumberOfProcessors;
|
---|
130 | LARGE_INTEGER EndTime;
|
---|
131 | ULONG TimerResolution;
|
---|
132 | ULONG MaximumFileSize;
|
---|
133 | ULONG LogFileMode;
|
---|
134 | ULONG BuffersWritten;
|
---|
135 | union
|
---|
136 | {
|
---|
137 | GUID LogInstanceGuid;
|
---|
138 | struct
|
---|
139 | {
|
---|
140 | ULONG StartBuffers;
|
---|
141 | ULONG PointerSize;
|
---|
142 | ULONG EventsLost;
|
---|
143 | ULONG CpuSpeedInMHZ;
|
---|
144 | } DUMMYSTRUCTNAME;
|
---|
145 | } DUMMYUNIONNAME1;
|
---|
146 | LPWSTR LoggerName;
|
---|
147 | LPWSTR LogFileName;
|
---|
148 | TIME_ZONE_INFORMATION TimeZone;
|
---|
149 | LARGE_INTEGER BootTime;
|
---|
150 | LARGE_INTEGER PerfFreq;
|
---|
151 | LARGE_INTEGER StartTime;
|
---|
152 | ULONG ReservedTime;
|
---|
153 | ULONG BuffersLost;
|
---|
154 | } TRACE_LOGFILE_HEADER, *PTRACE_LOGFILE_HEADER;
|
---|
155 |
|
---|
156 | struct _EVENT_TRACE_LOGFILEW
|
---|
157 | {
|
---|
158 | LPWSTR LogFileName;
|
---|
159 | LPWSTR LoggerName;
|
---|
160 | LONGLONG CurrentTime;
|
---|
161 | ULONG LogFileMode;
|
---|
162 | EVENT_TRACE CurrentEvent;
|
---|
163 | TRACE_LOGFILE_HEADER LogfileHeader;
|
---|
164 | PEVENT_TRACE_BUFFER_CALLBACKW BufferCallback;
|
---|
165 | ULONG BufferSize;
|
---|
166 | ULONG Filled;
|
---|
167 | ULONG EventsLost;
|
---|
168 | PEVENT_CALLBACK EventCallback;
|
---|
169 | PVOID Context;
|
---|
170 | };
|
---|
171 |
|
---|
172 | struct _EVENT_TRACE_LOGFILEA
|
---|
173 | {
|
---|
174 | LPSTR LogFileName;
|
---|
175 | LPSTR LoggerName;
|
---|
176 | LONGLONG CurrentTime;
|
---|
177 | ULONG LogFileMode;
|
---|
178 | EVENT_TRACE CurrentEvent;
|
---|
179 | TRACE_LOGFILE_HEADER LogfileHeader;
|
---|
180 | PEVENT_TRACE_BUFFER_CALLBACKA BufferCallback;
|
---|
181 | ULONG BufferSize;
|
---|
182 | ULONG Filled;
|
---|
183 | ULONG EventsLost;
|
---|
184 | PEVENT_CALLBACK EventCallback;
|
---|
185 | PVOID Context;
|
---|
186 | };
|
---|
187 |
|
---|
188 | typedef struct _EVENT_TRACE_PROPERTIES
|
---|
189 | {
|
---|
190 | WNODE_HEADER Wnode;
|
---|
191 | ULONG BufferSize;
|
---|
192 | ULONG MinimumBuffers;
|
---|
193 | ULONG MaximumBuffers;
|
---|
194 | ULONG MaximumFileSize;
|
---|
195 | ULONG LogFileMode;
|
---|
196 | ULONG FlushTimer;
|
---|
197 | LONG AgeLimit;
|
---|
198 | ULONG NumberOfBuffers;
|
---|
199 | ULONG FreeBuffers;
|
---|
200 | ULONG EventsLost;
|
---|
201 | ULONG BuffersWritten;
|
---|
202 | ULONG LogBuffersLost;
|
---|
203 | ULONG RealTimeBuffersLost;
|
---|
204 | HANDLE LoggerThreadId;
|
---|
205 | ULONG LoggerFileNameOffset;
|
---|
206 | ULONG LoggerNameOffset;
|
---|
207 | } EVENT_TRACE_PROPERTIES, *PEVENT_TRACE_PROPERTIES;
|
---|
208 |
|
---|
209 | ULONG WINAPI CloseTrace(TRACEHANDLE);
|
---|
210 | ULONG WINAPI EnableTrace(ULONG,ULONG,ULONG,LPCGUID,TRACEHANDLE);
|
---|
211 | ULONG WINAPI RegisterTraceGuidsA(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCSTR,LPCSTR,PTRACEHANDLE);
|
---|
212 | ULONG WINAPI RegisterTraceGuidsW(WMIDPREQUEST,PVOID,LPCGUID,ULONG,PTRACE_GUID_REGISTRATION,LPCWSTR,LPCWSTR,PTRACEHANDLE);
|
---|
213 | #define RegisterTraceGuids WINELIB_NAME_AW(RegisterTraceGuids)
|
---|
214 |
|
---|
215 | #ifdef __cplusplus
|
---|
216 | }
|
---|
217 | #endif
|
---|
218 |
|
---|
219 | #endif /* _EVNTRACE_ */
|
---|