kernel32: Add a structure to store all the information about an executable.
[wine] / dlls / advapi32 / eventlog.c
1 /*
2  * Win32 advapi functions
3  *
4  * Copyright 1995 Sven Verdoolaege
5  * Copyright 1998 Juergen Schmied
6  * Copyright 2003 Mike Hearn
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21  */
22
23 #include <stdarg.h>
24
25 #include "windef.h"
26 #include "winbase.h"
27 #include "winerror.h"
28 #include "winternl.h"
29 #include "wmistr.h"
30 #include "evntrace.h"
31
32 #include "wine/unicode.h"
33 #include "wine/debug.h"
34
35 WINE_DEFAULT_DEBUG_CHANNEL(advapi);
36 WINE_DECLARE_DEBUG_CHANNEL(eventlog);
37
38 static inline LPWSTR SERV_dup( LPCSTR str )
39 {
40     UINT len;
41     LPWSTR wstr;
42
43     if( !str )
44         return NULL;
45     len = MultiByteToWideChar( CP_ACP, 0, str, -1, NULL, 0 );
46     wstr = HeapAlloc( GetProcessHeap(), 0, len*sizeof (WCHAR) );
47     MultiByteToWideChar( CP_ACP, 0, str, -1, wstr, len );
48     return wstr;
49 }
50
51 /******************************************************************************
52  * BackupEventLogA [ADVAPI32.@]
53  *
54  * Saves the event log to a backup file.
55  *
56  * PARAMS
57  *  hEventLog        [I] Handle to event log to backup.
58  *  lpBackupFileName [I] Name of the backup file.
59  *
60  * RETURNS
61  *  Success: nonzero. File lpBackupFileName will contain the contents of
62  *           hEvenLog.
63  *  Failure: zero.
64  */
65 BOOL WINAPI BackupEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName )
66 {
67         FIXME("(%p,%s) stub\n", hEventLog, debugstr_a(lpBackupFileName));
68         return TRUE;
69 }
70
71 /******************************************************************************
72  * BackupEventLogW [ADVAPI32.@]
73  *
74  * See BackupEventLogA.
75  */
76 BOOL WINAPI BackupEventLogW( HANDLE hEventLog, LPCWSTR lpBackupFileName )
77 {
78         FIXME("(%p,%s) stub\n", hEventLog, debugstr_w(lpBackupFileName));
79         return TRUE;
80 }
81
82 /******************************************************************************
83  * ClearEventLogA [ADVAPI32.@]
84  *
85  * Clears the event log and/or saves the log to a backup file.
86  *
87  * PARAMS
88  *  hEvenLog         [I] Handle to event log to clear.
89  *  lpBackupFileName [I] Name of the backup file.
90  *
91  * RETURNS
92  *  Success: nonzero. if lpBackupFileName != NULL, lpBackupFileName will 
93  *           contain the contents of hEvenLog and the log will be cleared.
94  *  Failure: zero. Fails if the event log is empty or if lpBackupFileName
95  *           exists.
96  */
97 BOOL WINAPI ClearEventLogA( HANDLE hEventLog, LPCSTR lpBackupFileName )
98 {
99         FIXME("(%p,%s) stub\n", hEventLog, debugstr_a(lpBackupFileName));
100         return TRUE;
101 }
102
103 /******************************************************************************
104  * ClearEventLogW [ADVAPI32.@]
105  *
106  * See ClearEventLogA.
107  */
108 BOOL WINAPI ClearEventLogW( HANDLE hEventLog, LPCWSTR lpBackupFileName )
109 {
110         FIXME("(%p,%s) stub\n", hEventLog, debugstr_w(lpBackupFileName));
111         return TRUE;
112 }
113
114 /******************************************************************************
115  * CloseEventLog [ADVAPI32.@]
116  *
117  * Closes a read handle to the event log.
118  *
119  * PARAMS
120  *  hEventLog [I/O] Handle of the event log to close.
121  *
122  * RETURNS
123  *  Success: nonzero
124  *  Failure: zero
125  */
126 BOOL WINAPI CloseEventLog( HANDLE hEventLog )
127 {
128     FIXME("(%p) stub\n", hEventLog);
129
130     if (!hEventLog)
131     {
132         SetLastError(ERROR_INVALID_HANDLE);
133         return FALSE;
134     }
135
136     return TRUE;
137 }
138
139 /******************************************************************************
140  * ControlTraceW [ADVAPI32.@]
141  *
142  * Control a givel event trace session
143  *
144  */
145 ULONG WINAPI ControlTraceW( TRACEHANDLE hSession, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties, ULONG control )
146 {
147     FIXME("(%s, %s, %p, %d) stub\n", wine_dbgstr_longlong(hSession), debugstr_w(SessionName), Properties, control);
148     return ERROR_SUCCESS;
149 }
150
151 /******************************************************************************
152  * ControlTraceA [ADVAPI32.@]
153  *
154  * See ControlTraceW.
155  *
156  */
157 ULONG WINAPI ControlTraceA( TRACEHANDLE hSession, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties, ULONG control )
158 {
159     FIXME("(%s, %s, %p, %d) stub\n", wine_dbgstr_longlong(hSession), debugstr_a(SessionName), Properties, control);
160     return ERROR_SUCCESS;
161 }
162
163 /******************************************************************************
164  * DeregisterEventSource [ADVAPI32.@]
165  * 
166  * Closes a write handle to an event log
167  *
168  * PARAMS
169  *  hEventLog [I/O] Handle of the event log.
170  *
171  * RETURNS
172  *  Success: nonzero
173  *  Failure: zero
174  */
175 BOOL WINAPI DeregisterEventSource( HANDLE hEventLog )
176 {
177     FIXME("(%p) stub\n", hEventLog);
178     return TRUE;
179 }
180
181 /******************************************************************************
182  * EnableTrace [ADVAPI32.@]
183  */
184 ULONG WINAPI EnableTrace( ULONG enable, ULONG flag, ULONG level, LPCGUID guid, TRACEHANDLE hSession )
185 {
186     FIXME("(%d, 0x%x, %d, %s, %s): stub\n", enable, flag, level,
187             debugstr_guid(guid), wine_dbgstr_longlong(hSession));
188
189     return ERROR_SUCCESS;
190 }
191
192 /******************************************************************************
193  * GetNumberOfEventLogRecords [ADVAPI32.@]
194  *
195  * Retrieves the number of records in an event log.
196  *
197  * PARAMS
198  *  hEventLog       [I] Handle to an open event log.
199  *  NumberOfRecords [O] Number of records in the log.
200  *
201  * RETURNS
202  *  Success: nonzero. NumberOfRecords will contain the number of records in
203  *           the log.
204  *  Failure: zero
205  */
206 BOOL WINAPI GetNumberOfEventLogRecords( HANDLE hEventLog, PDWORD NumberOfRecords )
207 {
208     FIXME("(%p,%p) stub\n", hEventLog, NumberOfRecords);
209
210     if (!NumberOfRecords) return FALSE;
211     *NumberOfRecords = 0;
212
213     return TRUE;
214 }
215
216 /******************************************************************************
217  * GetOldestEventLogRecord [ADVAPI32.@]
218  *
219  * Retrieves the absolute record number of the oldest record in an even log.
220  *
221  * PARAMS
222  *  hEventLog    [I] Handle to an open event log.
223  *  OldestRecord [O] Absolute record number of the oldest record.
224  *
225  * RETURNS
226  *  Success: nonzero. OldestRecord contains the record number of the oldest
227  *           record in the log.
228  *  Failure: zero 
229  */
230 BOOL WINAPI GetOldestEventLogRecord( HANDLE hEventLog, PDWORD OldestRecord )
231 {
232     FIXME("(%p,%p) stub\n", hEventLog, OldestRecord);
233
234     if (!OldestRecord) return FALSE;
235     *OldestRecord = 0;
236
237     return TRUE;
238 }
239
240 /******************************************************************************
241  * NotifyChangeEventLog [ADVAPI32.@]
242  *
243  * Enables an application to receive notification when an event is written
244  * to an event log.
245  *
246  * PARAMS
247  *  hEventLog [I] Handle to an event log.
248  *  hEvent    [I] Handle to a manual-reset event object.
249  *
250  * RETURNS
251  *  Success: nonzero
252  *  Failure: zero
253  */
254 BOOL WINAPI NotifyChangeEventLog( HANDLE hEventLog, HANDLE hEvent )
255 {
256         FIXME("(%p,%p) stub\n", hEventLog, hEvent);
257         return TRUE;
258 }
259
260 /******************************************************************************
261  * OpenBackupEventLogA [ADVAPI32.@]
262  *
263  * Opens a handle to a backup event log.
264  *
265  * PARAMS
266  *  lpUNCServerName [I] Universal Naming Convention name of the server on which
267  *                      this will be performed.
268  *  lpFileName      [I] Specifies the name of the backup file.
269  *
270  * RETURNS
271  *  Success: Handle to the backup event log.
272  *  Failure: NULL
273  */
274 HANDLE WINAPI OpenBackupEventLogA( LPCSTR lpUNCServerName, LPCSTR lpFileName )
275 {
276         FIXME("(%s,%s) stub\n", debugstr_a(lpUNCServerName), debugstr_a(lpFileName));
277         return (HANDLE)0xcafe4242;
278 }
279
280 /******************************************************************************
281  * OpenBackupEventLogW [ADVAPI32.@]
282  *
283  * See OpenBackupEventLogA.
284  */
285 HANDLE WINAPI OpenBackupEventLogW( LPCWSTR lpUNCServerName, LPCWSTR lpFileName )
286 {
287         FIXME("(%s,%s) stub\n", debugstr_w(lpUNCServerName), debugstr_w(lpFileName));
288         return (HANDLE)0xcafe4242;
289 }
290
291 /******************************************************************************
292  * OpenEventLogA [ADVAPI32.@]
293  *
294  * Opens a handle to the specified event log.
295  *
296  * PARAMS
297  *  lpUNCServerName [I] UNC name of the server on which the event log is
298  *                      opened.
299  *  lpSourceName    [I] Name of the log.
300  *
301  * RETURNS
302  *  Success: Handle to an event log.
303  *  Failure: NULL
304  */
305 HANDLE WINAPI OpenEventLogA( LPCSTR uncname, LPCSTR source )
306 {
307     LPWSTR uncnameW, sourceW;
308     HANDLE handle;
309
310     uncnameW = SERV_dup(uncname);
311     sourceW = SERV_dup(source);
312     handle = OpenEventLogW(uncnameW, sourceW);
313     HeapFree(GetProcessHeap(), 0, uncnameW);
314     HeapFree(GetProcessHeap(), 0, sourceW);
315
316     return handle;
317 }
318
319 /******************************************************************************
320  * OpenEventLogW [ADVAPI32.@]
321  *
322  * See OpenEventLogA.
323  */
324 HANDLE WINAPI OpenEventLogW( LPCWSTR uncname, LPCWSTR source )
325 {
326     FIXME("(%s,%s) stub\n", debugstr_w(uncname), debugstr_w(source));
327
328     if (!source)
329     {
330         SetLastError(ERROR_INVALID_PARAMETER);
331         return NULL;
332     }
333
334     if (uncname && uncname[0])
335     {
336         FIXME("Remote server not supported\n");
337         SetLastError(RPC_S_SERVER_UNAVAILABLE);
338         return NULL;
339     }
340
341     return (HANDLE)0xcafe4242;
342 }
343
344 /******************************************************************************
345  * QueryAllTracesW [ADVAPI32.@]
346  *
347  * Query informations for started event trace sessions
348  *
349  */
350 ULONG WINAPI QueryAllTracesW( PEVENT_TRACE_PROPERTIES * parray, ULONG arraycount, PULONG psessioncount )
351 {
352     FIXME("(%p, %d, %p) stub\n", parray, arraycount, psessioncount);
353
354     if (psessioncount) *psessioncount = 0;
355     return ERROR_SUCCESS;
356 }
357
358 /******************************************************************************
359  * QueryAllTracesA [ADVAPI32.@]
360  *
361  * See QueryAllTracesW.
362  */
363 ULONG WINAPI QueryAllTracesA( PEVENT_TRACE_PROPERTIES * parray, ULONG arraycount, PULONG psessioncount )
364 {
365     FIXME("(%p, %d, %p) stub\n", parray, arraycount, psessioncount);
366
367     if (psessioncount) *psessioncount = 0;
368     return ERROR_SUCCESS;
369 }
370
371 /******************************************************************************
372  * ReadEventLogA [ADVAPI32.@]
373  *
374  * Reads a whole number of entries from an event log.
375  *
376  * PARAMS
377  *  hEventLog                [I] Handle of the event log to read.
378  *  dwReadFlags              [I] see MSDN doc.
379  *  dwRecordOffset           [I] Log-entry record number to start at.
380  *  lpBuffer                 [O] Buffer for the data read.
381  *  nNumberOfBytesToRead     [I] Size of lpBuffer.
382  *  pnBytesRead              [O] Receives number of bytes read.
383  *  pnMinNumberOfBytesNeeded [O] Receives number of bytes required for the
384  *                               next log entry.
385  *
386  * RETURNS
387  *  Success: nonzero
388  *  Failure: zero
389  */
390 BOOL WINAPI ReadEventLogA( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset,
391     LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded )
392 {
393     FIXME("(%p,0x%08x,0x%08x,%p,0x%08x,%p,%p) stub\n", hEventLog, dwReadFlags,
394           dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
395     return FALSE;
396 }
397
398 /******************************************************************************
399  * ReadEventLogW [ADVAPI32.@]
400  *
401  * See ReadEventLogA.
402  */
403 BOOL WINAPI ReadEventLogW( HANDLE hEventLog, DWORD dwReadFlags, DWORD dwRecordOffset,
404     LPVOID lpBuffer, DWORD nNumberOfBytesToRead, DWORD *pnBytesRead, DWORD *pnMinNumberOfBytesNeeded )
405 {
406     FIXME("(%p,0x%08x,0x%08x,%p,0x%08x,%p,%p) stub\n", hEventLog, dwReadFlags,
407           dwRecordOffset, lpBuffer, nNumberOfBytesToRead, pnBytesRead, pnMinNumberOfBytesNeeded);
408     return FALSE;
409 }
410
411 /******************************************************************************
412  * RegisterEventSourceA [ADVAPI32.@]
413  *
414  * Returns a registered handle to an event log.
415  *
416  * PARAMS
417  *  lpUNCServerName [I] UNC name of the source server.
418  *  lpSourceName    [I] Specifies the name of the event source to retrieve.
419  *
420  * RETURNS
421  *  Success: Handle to the event log.
422  *  Failure: NULL. Returns ERROR_INVALID_HANDLE if lpSourceName specifies the
423  *           Security event log.
424  */
425 HANDLE WINAPI RegisterEventSourceA( LPCSTR lpUNCServerName, LPCSTR lpSourceName )
426 {
427     UNICODE_STRING lpUNCServerNameW;
428     UNICODE_STRING lpSourceNameW;
429     HANDLE ret;
430
431     FIXME("(%s,%s): stub\n", debugstr_a(lpUNCServerName), debugstr_a(lpSourceName));
432
433     RtlCreateUnicodeStringFromAsciiz(&lpUNCServerNameW, lpUNCServerName);
434     RtlCreateUnicodeStringFromAsciiz(&lpSourceNameW, lpSourceName);
435     ret = RegisterEventSourceW(lpUNCServerNameW.Buffer,lpSourceNameW.Buffer);
436     RtlFreeUnicodeString (&lpUNCServerNameW);
437     RtlFreeUnicodeString (&lpSourceNameW);
438     return ret;
439 }
440
441 /******************************************************************************
442  * RegisterEventSourceW [ADVAPI32.@]
443  *
444  * See RegisterEventSourceA.
445  */
446 HANDLE WINAPI RegisterEventSourceW( LPCWSTR lpUNCServerName, LPCWSTR lpSourceName )
447 {
448     FIXME("(%s,%s): stub\n", debugstr_w(lpUNCServerName), debugstr_w(lpSourceName));
449     return (HANDLE)0xcafe4242;
450 }
451
452 /******************************************************************************
453  * ReportEventA [ADVAPI32.@]
454  *
455  * Writes an entry at the end of an event log.
456  *
457  * PARAMS
458  *  hEventLog   [I] Handle of an event log.
459  *  wType       [I] See MSDN doc.
460  *  wCategory   [I] Event category.
461  *  dwEventID   [I] Event identifier.
462  *  lpUserSid   [I] Current user's security identifier.
463  *  wNumStrings [I] Number of insert strings in lpStrings.
464  *  dwDataSize  [I] Size of event-specific raw data to write.
465  *  lpStrings   [I] Buffer containing an array of string to be merged.
466  *  lpRawData   [I] Buffer containing the binary data.
467  *
468  * RETURNS
469  *  Success: nonzero. Entry was written to the log.
470  *  Failure: zero.
471  *
472  * NOTES
473  *  The ReportEvent function adds the time, the entry's length, and the
474  *  offsets before storing the entry in the log. If lpUserSid != NULL, the
475  *  username is also logged.
476  */
477 BOOL WINAPI ReportEventA ( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID,
478     PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCSTR *lpStrings, LPVOID lpRawData)
479 {
480     LPWSTR *wideStrArray;
481     UNICODE_STRING str;
482     int i;
483     BOOL ret;
484
485     FIXME("(%p,0x%04x,0x%04x,0x%08x,%p,0x%04x,0x%08x,%p,%p): stub\n", hEventLog,
486           wType, wCategory, dwEventID, lpUserSid, wNumStrings, dwDataSize, lpStrings, lpRawData);
487
488     if (wNumStrings == 0) return TRUE;
489     if (!lpStrings) return TRUE;
490
491     wideStrArray = HeapAlloc(GetProcessHeap(), 0, sizeof(LPWSTR) * wNumStrings);
492     for (i = 0; i < wNumStrings; i++)
493     {
494         RtlCreateUnicodeStringFromAsciiz(&str, lpStrings[i]);
495         wideStrArray[i] = str.Buffer;
496     }
497     ret = ReportEventW(hEventLog, wType, wCategory, dwEventID, lpUserSid,
498                        wNumStrings, dwDataSize, (LPCWSTR *)wideStrArray, lpRawData);
499     for (i = 0; i < wNumStrings; i++)
500     {
501         HeapFree( GetProcessHeap(), 0, wideStrArray[i] );
502     }
503     HeapFree(GetProcessHeap(), 0, wideStrArray);
504     return ret;
505 }
506
507 /******************************************************************************
508  * ReportEventW [ADVAPI32.@]
509  *
510  * See ReportEventA.
511  */
512 BOOL WINAPI ReportEventW( HANDLE hEventLog, WORD wType, WORD wCategory, DWORD dwEventID,
513     PSID lpUserSid, WORD wNumStrings, DWORD dwDataSize, LPCWSTR *lpStrings, LPVOID lpRawData )
514 {
515     int i;
516
517     FIXME("(%p,0x%04x,0x%04x,0x%08x,%p,0x%04x,0x%08x,%p,%p): stub\n", hEventLog,
518           wType, wCategory, dwEventID, lpUserSid, wNumStrings, dwDataSize, lpStrings, lpRawData);
519
520     /* partial stub */
521
522     if (wNumStrings == 0) return TRUE;
523     if (!lpStrings) return TRUE;
524
525     for (i = 0; i < wNumStrings; i++)
526     {
527         switch (wType)
528         {
529         case EVENTLOG_SUCCESS:
530             TRACE_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
531             break;
532         case EVENTLOG_ERROR_TYPE:
533             ERR_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
534             break;
535         case EVENTLOG_WARNING_TYPE:
536             WARN_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
537             break;
538         default:
539             TRACE_(eventlog)("%s\n", debugstr_w(lpStrings[i]));
540             break;
541         }
542     }
543     return TRUE;
544 }
545
546 /******************************************************************************
547  * RegisterTraceGuidsW [ADVAPI32.@]
548  *
549  * Register an event trace provider and the event trace classes that it uses
550  * to generate events.
551  *
552  * PARAMS
553  *  RequestAddress     [I]   ControlCallback function
554  *  RequestContext     [I]   Optional provider-defined context
555  *  ControlGuid        [I]   GUID of the registering provider
556  *  GuidCount          [I]   Number of elements in the TraceGuidReg array
557  *  TraceGuidReg       [I/O] Array of TRACE_GUID_REGISTRATION structures
558  *  MofImagePath       [I]   not supported, set to NULL
559  *  MofResourceNmae    [I]   not supported, set to NULL
560  *  RegistrationHandle [O]   Provider's registration handle
561  *
562  * RETURNS
563  *  Success: ERROR_SUCCESS
564  *  Failure: System error code
565  *
566  * FIXME
567  *  Stub.
568  */
569 ULONG WINAPI RegisterTraceGuidsW( WMIDPREQUEST RequestAddress,
570                 PVOID RequestContext, LPCGUID ControlGuid, ULONG GuidCount,
571                 PTRACE_GUID_REGISTRATION TraceGuidReg, LPCWSTR MofImagePath,
572                 LPCWSTR MofResourceName, PTRACEHANDLE RegistrationHandle )
573 {
574     FIXME("%p %p %p %u %p %s %s %p\n", RequestAddress, RequestContext,
575           ControlGuid, GuidCount, TraceGuidReg, debugstr_w(MofImagePath),
576           debugstr_w(MofResourceName), RegistrationHandle);
577     return ERROR_CALL_NOT_IMPLEMENTED;
578 }
579
580 /******************************************************************************
581  * RegisterTraceGuidsA [ADVAPI32.@]
582  *
583  * See RegisterTraceGuidsW.
584  *
585  * FIXME
586  *  Stub.
587  */
588 ULONG WINAPI RegisterTraceGuidsA( WMIDPREQUEST RequestAddress,
589                 PVOID RequestContext, LPCGUID ControlGuid, ULONG GuidCount,
590                 PTRACE_GUID_REGISTRATION TraceGuidReg, LPCSTR MofImagePath,
591                 LPCSTR MofResourceName, PTRACEHANDLE RegistrationHandle )
592 {
593     FIXME("%p %p %p %u %p %s %s %p\n", RequestAddress, RequestContext,
594           ControlGuid, GuidCount, TraceGuidReg, debugstr_a(MofImagePath),
595           debugstr_a(MofResourceName), RegistrationHandle);
596     return ERROR_CALL_NOT_IMPLEMENTED;
597 }
598
599 /******************************************************************************
600  * StartTraceW [ADVAPI32.@]
601  *
602  * Register and start an event trace session
603  *
604  */
605 ULONG WINAPI StartTraceW( PTRACEHANDLE pSessionHandle, LPCWSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
606 {
607     FIXME("(%p, %s, %p) stub\n", pSessionHandle, debugstr_w(SessionName), Properties);
608     if (pSessionHandle) *pSessionHandle = 0xcafe4242;
609     return ERROR_SUCCESS;
610 }
611
612 /******************************************************************************
613  * StartTraceA [ADVAPI32.@]
614  *
615  * See StartTraceW.
616  *
617  */
618 ULONG WINAPI StartTraceA( PTRACEHANDLE pSessionHandle, LPCSTR SessionName, PEVENT_TRACE_PROPERTIES Properties )
619 {
620     FIXME("(%p, %s, %p) stub\n", pSessionHandle, debugstr_a(SessionName), Properties);
621     if (pSessionHandle) *pSessionHandle = 0xcafe4242;
622     return ERROR_SUCCESS;
623 }
624
625 /******************************************************************************
626  * TraceEvent [ADVAPI32.@]
627  */
628 ULONG WINAPI TraceEvent( TRACEHANDLE SessionHandle, PEVENT_TRACE_HEADER EventTrace )
629 {
630     FIXME("%s %p\n", wine_dbgstr_longlong(SessionHandle), EventTrace);
631     return ERROR_CALL_NOT_IMPLEMENTED;
632 }
633
634 /******************************************************************************
635  * UnregisterTraceGuids [ADVAPI32.@]
636  *
637  * See RegisterTraceGuids
638  *
639  * FIXME
640  *  Stub.
641  */
642 ULONG WINAPI UnregisterTraceGuids( TRACEHANDLE RegistrationHandle )
643 {
644     FIXME("%s: stub\n", wine_dbgstr_longlong(RegistrationHandle));
645     return ERROR_CALL_NOT_IMPLEMENTED;
646 }