xref: /reactos/dll/ntdll/etw/trace.c (revision de7c959c)
1c2c66affSColin Finck /*
2c2c66affSColin Finck  * ntdll.dll Event Tracing Functions
3c2c66affSColin Finck  */
4c2c66affSColin Finck 
5c2c66affSColin Finck #include <ntdll.h>
6c2c66affSColin Finck 
7c2c66affSColin Finck #include <wmistr.h>
8c2c66affSColin Finck #include <evntrace.h>
9c2c66affSColin Finck 
10c2c66affSColin Finck #define NDEBUG
11c2c66affSColin Finck #include <debug.h>
12c2c66affSColin Finck 
13c2c66affSColin Finck #define FIXME DPRINT1
14c2c66affSColin Finck 
15c2c66affSColin Finck /*
16c2c66affSColin Finck  * @unimplemented
17c2c66affSColin Finck  */
18c2c66affSColin Finck ULONG CDECL
EtwTraceMessage(TRACEHANDLE SessionHandle,ULONG MessageFlags,LPCGUID MessageGuid,USHORT MessageNumber,...)19c2c66affSColin Finck EtwTraceMessage(
20c2c66affSColin Finck     TRACEHANDLE  SessionHandle,
21c2c66affSColin Finck     ULONG        MessageFlags,
22c2c66affSColin Finck     LPCGUID      MessageGuid,
23c2c66affSColin Finck     USHORT       MessageNumber,
24c2c66affSColin Finck     ...)
25c2c66affSColin Finck {
26c2c66affSColin Finck     FIXME("TraceMessage()\n");
27c2c66affSColin Finck     return ERROR_SUCCESS;
28c2c66affSColin Finck }
29c2c66affSColin Finck 
30c2c66affSColin Finck TRACEHANDLE
31c2c66affSColin Finck NTAPI
EtwGetTraceLoggerHandle(PVOID Buffer)32c2c66affSColin Finck EtwGetTraceLoggerHandle(
33c2c66affSColin Finck     PVOID Buffer
34c2c66affSColin Finck )
35c2c66affSColin Finck {
36c2c66affSColin Finck     FIXME("EtwGetTraceLoggerHandle stub()\n");
37c2c66affSColin Finck     return (TRACEHANDLE)-1;
38c2c66affSColin Finck }
39c2c66affSColin Finck 
40c2c66affSColin Finck 
41c2c66affSColin Finck ULONG
42c2c66affSColin Finck NTAPI
EtwTraceEvent(TRACEHANDLE SessionHandle,PEVENT_TRACE_HEADER EventTrace)43c2c66affSColin Finck EtwTraceEvent(
44c2c66affSColin Finck     TRACEHANDLE SessionHandle,
45c2c66affSColin Finck     PEVENT_TRACE_HEADER EventTrace
46c2c66affSColin Finck )
47c2c66affSColin Finck {
48c2c66affSColin Finck     FIXME("EtwTraceEvent stub()\n");
49c2c66affSColin Finck 
50c2c66affSColin Finck     if (!SessionHandle || !EventTrace)
51c2c66affSColin Finck     {
52c2c66affSColin Finck         /* invalid parameters */
53c2c66affSColin Finck         return ERROR_INVALID_PARAMETER;
54c2c66affSColin Finck     }
55c2c66affSColin Finck 
56c2c66affSColin Finck     if (EventTrace->Size != sizeof(EVENT_TRACE_HEADER))
57c2c66affSColin Finck     {
58c2c66affSColin Finck         /* invalid parameter */
59c2c66affSColin Finck         return ERROR_INVALID_PARAMETER;
60c2c66affSColin Finck     }
61c2c66affSColin Finck 
62c2c66affSColin Finck     return ERROR_SUCCESS;
63c2c66affSColin Finck }
64c2c66affSColin Finck 
65c2c66affSColin Finck ULONG
66c2c66affSColin Finck NTAPI
EtwGetTraceEnableFlags(TRACEHANDLE TraceHandle)67c2c66affSColin Finck EtwGetTraceEnableFlags(
68c2c66affSColin Finck     TRACEHANDLE TraceHandle
69c2c66affSColin Finck )
70c2c66affSColin Finck {
71c2c66affSColin Finck     FIXME("EtwGetTraceEnableFlags stub()\n");
72c2c66affSColin Finck     return 0xFF;
73c2c66affSColin Finck }
74c2c66affSColin Finck 
75c2c66affSColin Finck UCHAR
76c2c66affSColin Finck NTAPI
EtwGetTraceEnableLevel(TRACEHANDLE TraceHandle)77c2c66affSColin Finck EtwGetTraceEnableLevel(
78c2c66affSColin Finck     TRACEHANDLE TraceHandle
79c2c66affSColin Finck )
80c2c66affSColin Finck {
81c2c66affSColin Finck     FIXME("EtwGetTraceEnableLevel stub()\n");
82c2c66affSColin Finck     return 0xFF;
83c2c66affSColin Finck }
84c2c66affSColin Finck 
85c2c66affSColin Finck ULONG
86c2c66affSColin Finck NTAPI
EtwUnregisterTraceGuids(TRACEHANDLE RegistrationHandle)87c2c66affSColin Finck EtwUnregisterTraceGuids(
88c2c66affSColin Finck     TRACEHANDLE RegistrationHandle
89c2c66affSColin Finck )
90c2c66affSColin Finck {
91c2c66affSColin Finck     FIXME("EtwUnregisterTraceGuids stub()\n");
92c2c66affSColin Finck     return ERROR_SUCCESS;
93c2c66affSColin Finck }
94c2c66affSColin Finck 
95c2c66affSColin Finck ULONG
96c2c66affSColin Finck NTAPI
EtwRegisterTraceGuidsA(WMIDPREQUEST RequestAddress,PVOID RequestContext,LPCGUID ControlGuid,ULONG GuidCount,PTRACE_GUID_REGISTRATION TraceGuidReg,LPCSTR MofImagePath,LPCSTR MofResourceName,PTRACEHANDLE RegistrationHandle)97c2c66affSColin Finck EtwRegisterTraceGuidsA(
98c2c66affSColin Finck     WMIDPREQUEST RequestAddress,
99c2c66affSColin Finck     PVOID RequestContext,
100c2c66affSColin Finck     LPCGUID ControlGuid,
101c2c66affSColin Finck     ULONG GuidCount,
102c2c66affSColin Finck     PTRACE_GUID_REGISTRATION TraceGuidReg,
103c2c66affSColin Finck     LPCSTR MofImagePath,
104c2c66affSColin Finck     LPCSTR MofResourceName,
105c2c66affSColin Finck     PTRACEHANDLE RegistrationHandle
106c2c66affSColin Finck )
107c2c66affSColin Finck {
108c2c66affSColin Finck     FIXME("EtwRegisterTraceGuidsA stub()\n");
109c2c66affSColin Finck     return ERROR_SUCCESS;
110c2c66affSColin Finck }
111c2c66affSColin Finck 
112c2c66affSColin Finck ULONG
113c2c66affSColin Finck NTAPI
EtwRegisterTraceGuidsW(WMIDPREQUEST RequestAddress,PVOID RequestContext,LPCGUID ControlGuid,ULONG GuidCount,PTRACE_GUID_REGISTRATION TraceGuidReg,LPCWSTR MofImagePath,LPCWSTR MofResourceName,PTRACEHANDLE RegistrationHandle)114c2c66affSColin Finck EtwRegisterTraceGuidsW(
115c2c66affSColin Finck     WMIDPREQUEST RequestAddress,
116c2c66affSColin Finck     PVOID RequestContext,
117c2c66affSColin Finck     LPCGUID ControlGuid,
118c2c66affSColin Finck     ULONG GuidCount,
119c2c66affSColin Finck     PTRACE_GUID_REGISTRATION TraceGuidReg,
120c2c66affSColin Finck     LPCWSTR MofImagePath,
121c2c66affSColin Finck     LPCWSTR MofResourceName,
122c2c66affSColin Finck     PTRACEHANDLE RegistrationHandle
123c2c66affSColin Finck )
124c2c66affSColin Finck {
125c2c66affSColin Finck     FIXME("EtwRegisterTraceGuidsW stub()\n");
126c2c66affSColin Finck     return ERROR_SUCCESS;
127c2c66affSColin Finck }
128c2c66affSColin Finck 
EtwStartTraceW(PTRACEHANDLE pSessionHandle,LPCWSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)129c2c66affSColin Finck ULONG WINAPI EtwStartTraceW( PTRACEHANDLE pSessionHandle, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
130c2c66affSColin Finck {
131c2c66affSColin Finck     FIXME("(%p, %s, %p) stub\n", pSessionHandle, SessionName, Properties);
132c2c66affSColin Finck     if (pSessionHandle) *pSessionHandle = 0xcafe4242;
133c2c66affSColin Finck     return ERROR_SUCCESS;
134c2c66affSColin Finck }
135c2c66affSColin Finck 
EtwStartTraceA(PTRACEHANDLE pSessionHandle,LPCSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)136c2c66affSColin Finck ULONG WINAPI EtwStartTraceA( PTRACEHANDLE pSessionHandle, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
137c2c66affSColin Finck {
138c2c66affSColin Finck     FIXME("(%p, %s, %p) stub\n", pSessionHandle, SessionName, Properties);
139c2c66affSColin Finck     if (pSessionHandle) *pSessionHandle = 0xcafe4242;
140c2c66affSColin Finck     return ERROR_SUCCESS;
141c2c66affSColin Finck }
142c2c66affSColin Finck 
143c2c66affSColin Finck /******************************************************************************
144c2c66affSColin Finck  * EtwControlTraceW [NTDLL.@]
145c2c66affSColin Finck  *
146c2c66affSColin Finck  * Control a givel event trace session
147c2c66affSColin Finck  *
148c2c66affSColin Finck  */
EtwControlTraceW(TRACEHANDLE hSession,LPCWSTR SessionName,PEVENT_TRACE_PROPERTIES Properties,ULONG control)149c2c66affSColin Finck ULONG WINAPI EtwControlTraceW( TRACEHANDLE hSession, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties, ULONG control )
150c2c66affSColin Finck {
151c2c66affSColin Finck     FIXME("(%I64x, %s, %p, %d) stub\n", hSession, SessionName, Properties, control);
152c2c66affSColin Finck     return ERROR_SUCCESS;
153c2c66affSColin Finck }
154c2c66affSColin Finck 
155c2c66affSColin Finck /******************************************************************************
156c2c66affSColin Finck  * EtwControlTraceA [NTDLL.@]
157c2c66affSColin Finck  *
158c2c66affSColin Finck  * See ControlTraceW.
159c2c66affSColin Finck  *
160c2c66affSColin Finck  */
EtwControlTraceA(TRACEHANDLE hSession,LPCSTR SessionName,PEVENT_TRACE_PROPERTIES Properties,ULONG control)161c2c66affSColin Finck ULONG WINAPI EtwControlTraceA( TRACEHANDLE hSession, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties, ULONG control )
162c2c66affSColin Finck {
163c2c66affSColin Finck     FIXME("(%I64x, %s, %p, %d) stub\n", hSession, SessionName, Properties, control);
164c2c66affSColin Finck     return ERROR_SUCCESS;
165c2c66affSColin Finck }
166c2c66affSColin Finck 
167c2c66affSColin Finck /******************************************************************************
168c2c66affSColin Finck  * EtwEnableTrace [NTDLL.@]
169c2c66affSColin Finck  */
EtwEnableTrace(ULONG enable,ULONG flag,ULONG level,LPCGUID guid,TRACEHANDLE hSession)170c2c66affSColin Finck ULONG WINAPI EtwEnableTrace( ULONG enable, ULONG flag, ULONG level, LPCGUID guid, TRACEHANDLE hSession )
171c2c66affSColin Finck {
172c2c66affSColin Finck     FIXME("(%d, 0x%x, %d, %p, %I64x): stub\n", enable, flag, level,
173c2c66affSColin Finck             guid, hSession);
174c2c66affSColin Finck 
175c2c66affSColin Finck     return ERROR_SUCCESS;
176c2c66affSColin Finck }
177c2c66affSColin Finck 
178c2c66affSColin Finck /******************************************************************************
179c2c66affSColin Finck  * EtwQueryAllTracesW [NTDLL.@]
180c2c66affSColin Finck  *
181c2c66affSColin Finck  * Query information for started event trace sessions
182c2c66affSColin Finck  *
183c2c66affSColin Finck  */
EtwQueryAllTracesW(PEVENT_TRACE_PROPERTIES * parray,ULONG arraycount,PULONG psessioncount)184c2c66affSColin Finck ULONG WINAPI EtwQueryAllTracesW( PEVENT_TRACE_PROPERTIES * parray, ULONG arraycount, PULONG psessioncount )
185c2c66affSColin Finck {
186c2c66affSColin Finck     FIXME("(%p, %d, %p) stub\n", parray, arraycount, psessioncount);
187c2c66affSColin Finck 
188c2c66affSColin Finck     if (psessioncount) *psessioncount = 0;
189c2c66affSColin Finck     return ERROR_SUCCESS;
190c2c66affSColin Finck }
191c2c66affSColin Finck 
192c2c66affSColin Finck /******************************************************************************
193c2c66affSColin Finck  * QueryAllTracesA [NTDLL.@]
194c2c66affSColin Finck  *
195c2c66affSColin Finck  * See EtwQueryAllTracesA.
196c2c66affSColin Finck  */
EtwQueryAllTracesA(PEVENT_TRACE_PROPERTIES * parray,ULONG arraycount,PULONG psessioncount)197c2c66affSColin Finck ULONG WINAPI EtwQueryAllTracesA( PEVENT_TRACE_PROPERTIES * parray, ULONG arraycount, PULONG psessioncount )
198c2c66affSColin Finck {
199c2c66affSColin Finck     FIXME("(%p, %d, %p) stub\n", parray, arraycount, psessioncount);
200c2c66affSColin Finck 
201c2c66affSColin Finck     if (psessioncount) *psessioncount = 0;
202c2c66affSColin Finck     return ERROR_SUCCESS;
203c2c66affSColin Finck }
204c2c66affSColin Finck 
205*de7c959cSPierre Schweitzer /******************************************************************************
206*de7c959cSPierre Schweitzer  * EtwFlushTraceA [NTDLL.@]
207*de7c959cSPierre Schweitzer  *
208*de7c959cSPierre Schweitzer  */
EtwFlushTraceA(TRACEHANDLE hSession,LPCSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)209*de7c959cSPierre Schweitzer ULONG WINAPI EtwFlushTraceA( TRACEHANDLE hSession, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
210*de7c959cSPierre Schweitzer {
211*de7c959cSPierre Schweitzer     return EtwControlTraceA( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_FLUSH );
212*de7c959cSPierre Schweitzer }
213*de7c959cSPierre Schweitzer 
214*de7c959cSPierre Schweitzer /******************************************************************************
215*de7c959cSPierre Schweitzer  * EtwFlushTraceW [NTDLL.@]
216*de7c959cSPierre Schweitzer  *
217*de7c959cSPierre Schweitzer  */
EtwFlushTraceW(TRACEHANDLE hSession,LPCWSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)218*de7c959cSPierre Schweitzer ULONG WINAPI EtwFlushTraceW( TRACEHANDLE hSession, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
219*de7c959cSPierre Schweitzer {
220*de7c959cSPierre Schweitzer     return EtwControlTraceW( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_FLUSH );
221*de7c959cSPierre Schweitzer }
222*de7c959cSPierre Schweitzer 
223*de7c959cSPierre Schweitzer /******************************************************************************
224*de7c959cSPierre Schweitzer  * EtwQueryTraceA [NTDLL.@]
225*de7c959cSPierre Schweitzer  *
226*de7c959cSPierre Schweitzer  */
EtwQueryTraceA(TRACEHANDLE hSession,LPCSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)227*de7c959cSPierre Schweitzer ULONG WINAPI EtwQueryTraceA( TRACEHANDLE hSession, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
228*de7c959cSPierre Schweitzer {
229*de7c959cSPierre Schweitzer     return EtwControlTraceA( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_QUERY );
230*de7c959cSPierre Schweitzer }
231*de7c959cSPierre Schweitzer 
232*de7c959cSPierre Schweitzer /******************************************************************************
233*de7c959cSPierre Schweitzer  * EtwQueryTraceW [NTDLL.@]
234*de7c959cSPierre Schweitzer  *
235*de7c959cSPierre Schweitzer  */
EtwQueryTraceW(TRACEHANDLE hSession,LPCWSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)236*de7c959cSPierre Schweitzer ULONG WINAPI EtwQueryTraceW( TRACEHANDLE hSession, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
237*de7c959cSPierre Schweitzer {
238*de7c959cSPierre Schweitzer     return EtwControlTraceW( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_QUERY );
239*de7c959cSPierre Schweitzer }
240*de7c959cSPierre Schweitzer 
241*de7c959cSPierre Schweitzer /******************************************************************************
242*de7c959cSPierre Schweitzer  * EtwStopTraceA [NTDLL.@]
243*de7c959cSPierre Schweitzer  *
244*de7c959cSPierre Schweitzer  */
EtwStopTraceA(TRACEHANDLE hSession,LPCSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)245*de7c959cSPierre Schweitzer ULONG WINAPI EtwStopTraceA( TRACEHANDLE hSession, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
246*de7c959cSPierre Schweitzer {
247*de7c959cSPierre Schweitzer     return EtwControlTraceA( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_STOP );
248*de7c959cSPierre Schweitzer }
249*de7c959cSPierre Schweitzer 
250*de7c959cSPierre Schweitzer /******************************************************************************
251*de7c959cSPierre Schweitzer  * EtwStopTraceW [NTDLL.@]
252*de7c959cSPierre Schweitzer  *
253*de7c959cSPierre Schweitzer  */
EtwStopTraceW(TRACEHANDLE hSession,LPCWSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)254*de7c959cSPierre Schweitzer ULONG WINAPI EtwStopTraceW( TRACEHANDLE hSession, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
255*de7c959cSPierre Schweitzer {
256*de7c959cSPierre Schweitzer     return EtwControlTraceW( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_STOP );
257*de7c959cSPierre Schweitzer }
258*de7c959cSPierre Schweitzer 
259*de7c959cSPierre Schweitzer /******************************************************************************
260*de7c959cSPierre Schweitzer  * EtwUpdateTraceA [NTDLL.@]
261*de7c959cSPierre Schweitzer  *
262*de7c959cSPierre Schweitzer  */
EtwUpdateTraceA(TRACEHANDLE hSession,LPCSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)263*de7c959cSPierre Schweitzer ULONG WINAPI EtwUpdateTraceA( TRACEHANDLE hSession, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
264*de7c959cSPierre Schweitzer {
265*de7c959cSPierre Schweitzer     return EtwControlTraceA( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_UPDATE );
266*de7c959cSPierre Schweitzer }
267*de7c959cSPierre Schweitzer 
268*de7c959cSPierre Schweitzer /******************************************************************************
269*de7c959cSPierre Schweitzer  * EtwUpdateTraceW [NTDLL.@]
270*de7c959cSPierre Schweitzer  *
271*de7c959cSPierre Schweitzer  */
EtwUpdateTraceW(TRACEHANDLE hSession,LPCWSTR SessionName,PEVENT_TRACE_PROPERTIES Properties)272*de7c959cSPierre Schweitzer ULONG WINAPI EtwUpdateTraceW( TRACEHANDLE hSession, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
273*de7c959cSPierre Schweitzer {
274*de7c959cSPierre Schweitzer     return EtwControlTraceW( hSession, SessionName, Properties, EVENT_TRACE_CONTROL_UPDATE );
275*de7c959cSPierre Schweitzer }
276*de7c959cSPierre Schweitzer 
277c2c66affSColin Finck /* EOF */
278