source: trunk/src/advapi32/eventlog.cpp@ 2912

Last change on this file since 2912 was 2152, checked in by sandervl, 26 years ago

Event log changes

File size: 15.9 KB
Line 
1/* $Id: eventlog.cpp,v 1.1 1999-12-20 10:12:05 sandervl Exp $ */
2
3/*
4 * Win32 advanced API functions for OS/2
5 *
6 * 1998/06/12
7 *
8 * Copyright 1998 Sander van Leeuwen
9 * Copyright 1998 Patrick Haller
10 *
11 *
12 * NOTE: Uses registry key for service as handle
13 *
14 * Project Odin Software License can be found in LICENSE.TXT
15 *
16 */
17
18#include <os2win.h>
19#include <stdlib.h>
20#include <stdarg.h>
21#include <string.h>
22#include <odinwrap.h>
23#include "misc.h"
24#include "advapi32.h"
25#include "unicode.h"
26#include "winreg.h"
27#include <heapstring.h>
28
29ODINDEBUGCHANNEL(ADVAPI32-EVENTLOG)
30
31
32BOOL WIN32API ReportEventA( /*PLF Sat 98-03-07 00:36:43*/
33 HANDLE hEventLog,
34 WORD wType,
35 WORD wCategory,
36 DWORD dwEventID,
37 PSID lpUserSid,
38 WORD wNumStrings,
39 DWORD dwDataSize,
40 LPCSTR *lpStrings,
41 LPVOID lpRawData
42 )
43{
44 dprintf(("ReportEventA(): NIY\n"));
45 return TRUE;
46}
47
48
49BOOL WIN32API ReportEventW( /*PLF Sat 98-03-07 00:36:43*/
50 HANDLE hEventLog,
51 WORD wType,
52 WORD wCategory,
53 DWORD dwEventID,
54 PSID lpUserSid,
55 WORD wNumStrings,
56 DWORD dwDataSize,
57 LPCWSTR *lpStrings,
58 LPVOID lpRawData
59 )
60{
61 dprintf(("ReportEventW(): NIY\n"));
62 return TRUE;
63}
64
65
66/*PLF Sat 98-03-07 02:59:20*/
67HANDLE WIN32API RegisterEventSourceA(LPCSTR lpUNCServerName, LPCSTR lpSourceName)
68{
69 dprintf(("ADVAPI32: RegisterEventSourceA() %s %s", lpUNCServerName, lpSourceName));
70
71 return 0xCAFECAFE;
72}
73
74/*PLF Sat 98-03-07 02:59:20*/
75HANDLE WIN32API RegisterEventSourceW(LPCWSTR lpUNCServerName, LPCWSTR lpSourceName)
76{
77 LPSTR lpUNCServerNameA = NULL, lpSourceNameA = NULL;
78 HANDLE hEvent;
79
80 dprintf(("ADVAPI32: RegisterEventSourceW()"));
81 if(lpUNCServerName)
82 lpUNCServerNameA = HEAP_strdupWtoA(GetProcessHeap(), 0, lpUNCServerName);
83 if(lpSourceName)
84 lpSourceNameA = HEAP_strdupWtoA(GetProcessHeap(), 0, lpSourceName);
85
86 hEvent = RegisterEventSourceA(lpUNCServerNameA, lpSourceNameA);
87
88 if(lpUNCServerNameA)
89 HeapFree(GetProcessHeap(), 0, lpUNCServerNameA);
90 if(lpSourceNameA)
91 HeapFree(GetProcessHeap(), 0, lpSourceNameA);
92
93 return hEvent;
94}
95
96
97/*PLF Sat 98-03-07 02:59:20*/
98BOOL WIN32API DeregisterEventSource(HANDLE hEventLog)
99{
100 dprintf(("DeregisterEventSource() NIY\n"));
101 return FALSE;
102}
103
104/*****************************************************************************
105 * Name : BackupEventLogA
106 * Purpose : The BackupEventLog function saves the specified event log to a
107 * backup file. The function does not clear the event log.
108 * Parameters: HANDLE hEventLog handle to event log
109 * LPCSTR lpBackupFileName name of backup file
110 * Variables :
111 * Result :
112 * Remark :
113 * Status : UNTESTED STUB
114 *
115 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
116 *****************************************************************************/
117
118BOOL WIN32API BackupEventLogA(HANDLE hEventLog,
119 LPCSTR lpBackupFileName)
120{
121 dprintf(("ADVAPI32: BackupEventLogA(%08xh,%s) not implemented.\n",
122 hEventLog,
123 lpBackupFileName));
124
125 return (FALSE); /* signal failure */
126}
127
128
129/*****************************************************************************
130 * Name : BackupEventLogW
131 * Purpose : The BackupEventLog function saves the specified event log to a
132 * backup file. The function does not clear the event log.
133 * Parameters: HANDLE hEventLog handle to event log
134 * LPCWSTR lpBackupFileName name of backup file
135 * Variables :
136 * Result :
137 * Remark :
138 * Status : UNTESTED STUB
139 *
140 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
141 *****************************************************************************/
142
143BOOL WIN32API BackupEventLogW(HANDLE hEventLog,
144 LPCWSTR lpBackupFileName)
145{
146 dprintf(("ADVAPI32: BackupEventLogW() not implemented.\n",
147 hEventLog,
148 lpBackupFileName));
149
150 return (FALSE); /* signal failure */
151}
152
153
154/*****************************************************************************
155 * Name : ClearEventLogA
156 * Purpose : The ClearEventLog function clears the specified event log, and
157 * optionally saves the current copy of the logfile to a backup file.
158 * Parameters: HANDLE hEventLog handle to event log
159 * LPCSTR lpBackupFileName name of backup file
160 * Variables :
161 * Result :
162 * Remark :
163 * Status : UNTESTED STUB
164 *
165 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
166 *****************************************************************************/
167
168BOOL WIN32API ClearEventLogA(HANDLE hEventLog,
169 LPCSTR lpBackupFileName)
170{
171 dprintf(("ADVAPI32: ClearEventLogA(%08xh,%s) not implemented.\n",
172 hEventLog,
173 lpBackupFileName));
174
175 return (FALSE); /* signal failure */
176}
177
178
179/*****************************************************************************
180 * Name : ClearEventLogW
181 * Purpose : The ClearEventLog function clears the specified event log, and
182 * optionally saves the current copy of the logfile to a backup file.
183 * Parameters: HANDLE hEventLog handle to event log
184 * LPCSTR lpBackupFileName name of backup file
185 * Variables :
186 * Result :
187 * Remark :
188 * Status : UNTESTED STUB
189 *
190 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
191 *****************************************************************************/
192
193BOOL WIN32API ClearEventLogW(HANDLE hEventLog,
194 LPCWSTR lpBackupFileName)
195{
196 dprintf(("ADVAPI32: ClearEventLogW(%08xh,%s) not implemented.\n",
197 hEventLog,
198 lpBackupFileName));
199
200 return (FALSE); /* signal failure */
201}
202
203
204/*****************************************************************************
205 * Name : CloseEventLog
206 * Purpose : The CloseEventLog function closes the specified event log.
207 * Parameters: HANDLE hEventLog handle to event log
208 * Variables :
209 * Result :
210 * Remark :
211 * Status : UNTESTED STUB
212 *
213 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
214 *****************************************************************************/
215
216BOOL WIN32API CloseEventLog(HANDLE hEventLog)
217{
218 dprintf(("ADVAPI32: CloseEventLog(%08xh) not implemented.\n",
219 hEventLog));
220
221 return (FALSE); /* signal failure */
222}
223
224/*****************************************************************************
225 * Name : GetNumberOfEventLogRecords
226 * Purpose : The GetNumberOfEventLogRecords function retrieves the number of
227 * records in the specified event log.
228 * Parameters: HANDLE hEventLog handle to event log
229 * LPDWORD NumberOfRecords buffer for number of records
230 * Variables :
231 * Result :
232 * Remark :
233 * Status : UNTESTED STUB
234 *
235 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
236 *****************************************************************************/
237
238BOOL WIN32API GetNumberOfEventLogRecords(HANDLE hEventLog,
239 LPDWORD NumberOfRecords)
240{
241 dprintf(("ADVAPI32: GetNumberOfEventLogRecords(%08xh,%08xh) not implemented.\n",
242 hEventLog,
243 NumberOfRecords));
244
245 return (FALSE); /* signal failure */
246}
247
248
249/*****************************************************************************
250 * Name : GetOldestEventLogRecord
251 * Purpose : The GetOldestEventLogRecord function retrieves the absolute
252 * record number of the oldest record in the specified event log.
253 * Parameters: HANDLE hEventLog handle to event log
254 * LPDWORD OldestRecord buffer for number of oldest record
255 * Variables :
256 * Result :
257 * Remark :
258 * Status : UNTESTED STUB
259 *
260 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
261 *****************************************************************************/
262
263BOOL WIN32API GetOldestEventLogRecord(HANDLE hEventLog,
264 LPDWORD OldestRecord)
265{
266 dprintf(("ADVAPI32: GetOldestEventLogRecord(%08xh,%08xh) not implemented.\n",
267 hEventLog,
268 OldestRecord));
269
270 return (FALSE); /* signal failure */
271}
272
273/*****************************************************************************
274 * Name : NotifyChangeEventLog
275 * Purpose : The NotifyChangeEventLog function lets an application receive
276 * notification when an event is written to the event log file
277 * specified by hEventLog. When the event is written to the event
278 * log file, the function causes the event object specified by
279 * hEvent to become signaled.
280 * Parameters: HANDLE hEventLog special default locale value to be converted
281 * HANDLE hEvent special default locale value to be converted
282 * Variables :
283 * Result :
284 * Remark :
285 * Status : UNTESTED STUB
286 *
287 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
288 *****************************************************************************/
289
290BOOL WIN32API NotifyChangeEventLog(HANDLE hEventLog,
291 HANDLE hEvent)
292{
293 dprintf(("ADVAPI32: NotifyChangeEventLog(%08xh,%08xh) not implemented.\n",
294 hEventLog,
295 hEvent));
296
297 return (FALSE); /* signal failure */
298}
299
300/*****************************************************************************
301 * Name : OpenBackupEventLogA
302 * Purpose : The OpenBackupEventLog function opens a handle of a backup event
303 * log. This handle can be used with the BackupEventLog function.
304 * Parameters: LPCSTR lpszUNCServerName backup file server name
305 * LPCSTR lpszFileName backup filename
306 * Variables :
307 * Result :
308 * Remark :
309 * Status : UNTESTED STUB
310 *
311 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
312 *****************************************************************************/
313
314HANDLE WIN32API OpenBackupEventLogA(LPCSTR lpszUNCServerName,
315 LPCSTR lpszFileName)
316{
317 dprintf(("ADVAPI32: OpenBackupEventLogA(%s,%s) not implemented.\n",
318 lpszUNCServerName,
319 lpszFileName));
320
321 return (NULL); /* signal failure */
322}
323
324
325/*****************************************************************************
326 * Name : OpenBackupEventLogW
327 * Purpose : The OpenBackupEventLog function opens a handle of a backup event
328 * log. This handle can be used with the BackupEventLog function.
329 * Parameters: LPCWSTR lpszUNCServerName backup file server name
330 * LPCWSTR lpszFileName backup filename
331 * Variables :
332 * Result :
333 * Remark :
334 * Status : UNTESTED STUB
335 *
336 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
337 *****************************************************************************/
338
339HANDLE WIN32API OpenBackupEventLogW(LPCWSTR lpszUNCServerName,
340 LPCWSTR lpszFileName)
341{
342 dprintf(("ADVAPI32: OpenBackupEventLogW(%s,%s) not implemented.\n",
343 lpszUNCServerName,
344 lpszFileName));
345
346 return (NULL); /* signal failure */
347}
348
349
350/*****************************************************************************
351 * Name : OpenEventLogA
352 * Purpose : The OpenEventLog function opens a handle of an event log.
353 * Parameters: LPCSTR lpszUNCServerName
354 * LPCSTR lpszSourceName
355 * Variables :
356 * Result :
357 * Remark :
358 * Status : UNTESTED STUB
359 *
360 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
361 *****************************************************************************/
362
363HANDLE WIN32API OpenEventLogA(LPCSTR lpszUNCServerName,
364 LPCSTR lpszSourceName)
365{
366 dprintf(("ADVAPI32: OpenEventLogA(%s,%s) not implemented.\n",
367 lpszUNCServerName,
368 lpszSourceName));
369
370 return (NULL); /* signal failure */
371}
372
373
374/*****************************************************************************
375 * Name : OpenEventLogW
376 * Purpose : The OpenEventLog function opens a handle of an event log.
377 * Parameters: LPCWSTR lpszUNCServerName
378 * LPCWSTR lpszSourceName
379 * Variables :
380 * Result :
381 * Remark :
382 * Status : UNTESTED STUB
383 *
384 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
385 *****************************************************************************/
386
387HANDLE WIN32API OpenEventLogW(LPCWSTR lpszUNCServerName,
388 LPCWSTR lpszSourceName)
389{
390 dprintf(("ADVAPI32: OpenEventLogW(%s,%s) not implemented.\n",
391 lpszUNCServerName,
392 lpszSourceName));
393
394 return (NULL); /* signal failure */
395}
396
397/*****************************************************************************
398 * Name : ReadEventLogW
399 * Purpose : The ReadEventLog function reads a whole number of entries from
400 * the specified event log. The function can be used to read log
401 * entries in forward or reverse chronological order.
402 * Parameters: HANDLE hEventLog handle of event log
403 * DWORD dwReadFlags specifies how to read log
404 * DWORD dwRecordOffset number of first record
405 * LPVOID lpBuffer address of buffer for read data
406 * DWORD nNumberOfBytesToRead number of bytes to read
407 * DWORD *pnBytesRea number of bytes read
408 * DWORD *pnMinNumberOfBytesNeeded number of bytes required for next record
409 * Variables :
410 * Result :
411 * Remark :
412 * Status : UNTESTED STUB
413 *
414 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
415 *****************************************************************************/
416
417BOOL WIN32API ReadEventLogW(HANDLE hEventLog,
418 DWORD dwReadFlags,
419 DWORD dwRecordOffset,
420 LPVOID lpBuffer,
421 DWORD nNumberOfBytesToRead,
422 DWORD *pnBytesRead,
423 DWORD *pnMinNumberOfBytesNeeded)
424{
425 dprintf(("ADVAPI32: ReadEventLogW(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
426 hEventLog,
427 dwReadFlags,
428 dwRecordOffset,
429 lpBuffer,
430 nNumberOfBytesToRead,
431 pnBytesRead,
432 pnMinNumberOfBytesNeeded));
433
434 return (FALSE); /* signal failure */
435}
436
437
438/*****************************************************************************
439 * Name : ReadEventLogA
440 * Purpose : The ReadEventLog function reads a whole number of entries from
441 * the specified event log. The function can be used to read log
442 * entries in forward or reverse chronological order.
443 * Parameters: HANDLE hEventLog handle of event log
444 * DWORD dwReadFlags specifies how to read log
445 * DWORD dwRecordOffset number of first record
446 * LPVOID lpBuffer address of buffer for read data
447 * DWORD nNumberOfBytesToRead number of bytes to read
448 * DWORD *pnBytesRea number of bytes read
449 * DWORD *pnMinNumberOfBytesNeeded number of bytes required for next record
450 * Variables :
451 * Result :
452 * Remark :
453 * Status : UNTESTED STUB
454 *
455 * Author : Patrick Haller [Tue, 1998/06/16 23:00]
456 *****************************************************************************/
457
458BOOL WIN32API ReadEventLogA(HANDLE hEventLog,
459 DWORD dwReadFlags,
460 DWORD dwRecordOffset,
461 LPVOID lpBuffer,
462 DWORD nNumberOfBytesToRead,
463 DWORD *pnBytesRead,
464 DWORD *pnMinNumberOfBytesNeeded)
465{
466 dprintf(("ADVAPI32: ReadEventLogA(%08xh,%08xh,%08xh,%08xh,%08xh,%08xh,%08xh) not implemented.\n",
467 hEventLog,
468 dwReadFlags,
469 dwRecordOffset,
470 lpBuffer,
471 nNumberOfBytesToRead,
472 pnBytesRead,
473 pnMinNumberOfBytesNeeded));
474
475 return (FALSE); /* signal failure */
476}
477
Note: See TracBrowser for help on using the repository browser.