ReactOS  0.4.15-dev-1206-g731eddf
undocelfapi.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

NTSTATUS NTAPI ElfBackupEventLogFileA (IN HANDLE hEventLog, IN PANSI_STRING BackupFileNameA)
 
NTSTATUS NTAPI ElfBackupEventLogFileW (IN HANDLE hEventLog, IN PUNICODE_STRING BackupFileNameU)
 
NTSTATUS NTAPI ElfClearEventLogFileA (IN HANDLE hEventLog, IN PANSI_STRING BackupFileNameA)
 
NTSTATUS NTAPI ElfClearEventLogFileW (IN HANDLE hEventLog, IN PUNICODE_STRING BackupFileNameU)
 
NTSTATUS NTAPI ElfCloseEventLog (IN HANDLE hEventLog)
 
NTSTATUS NTAPI ElfDeregisterEventSource (IN HANDLE hEventLog)
 
NTSTATUS NTAPI ElfNumberOfRecords (IN HANDLE hEventLog, OUT PULONG NumberOfRecords)
 
NTSTATUS NTAPI ElfOldestRecord (IN HANDLE hEventLog, OUT PULONG OldestRecordNumber)
 
NTSTATUS NTAPI ElfChangeNotify (IN HANDLE hEventLog, IN HANDLE hEvent)
 
NTSTATUS NTAPI ElfOpenBackupEventLogA (IN PANSI_STRING UNCServerNameA, IN PANSI_STRING BackupFileNameA, OUT PHANDLE phEventLog)
 
NTSTATUS NTAPI ElfOpenBackupEventLogW (IN PUNICODE_STRING UNCServerNameU, IN PUNICODE_STRING BackupFileNameU, OUT PHANDLE phEventLog)
 
NTSTATUS NTAPI ElfOpenEventLogA (IN PANSI_STRING UNCServerNameA, IN PANSI_STRING SourceNameA, OUT PHANDLE phEventLog)
 
NTSTATUS NTAPI ElfOpenEventLogW (IN PUNICODE_STRING UNCServerNameU, IN PUNICODE_STRING SourceNameU, OUT PHANDLE phEventLog)
 
NTSTATUS NTAPI ElfReadEventLogA (IN HANDLE hEventLog, IN ULONG ReadFlags, IN ULONG RecordOffset, OUT LPVOID Buffer, IN ULONG NumberOfBytesToRead, OUT PULONG NumberOfBytesRead, OUT PULONG MinNumberOfBytesNeeded)
 
NTSTATUS NTAPI ElfReadEventLogW (IN HANDLE hEventLog, IN ULONG ReadFlags, IN ULONG RecordOffset, OUT LPVOID Buffer, IN ULONG NumberOfBytesToRead, OUT PULONG NumberOfBytesRead, OUT PULONG MinNumberOfBytesNeeded)
 
NTSTATUS NTAPI ElfRegisterEventSourceA (IN PANSI_STRING UNCServerNameA, IN PANSI_STRING SourceNameA, OUT PHANDLE phEventLog)
 
NTSTATUS NTAPI ElfRegisterEventSourceW (IN PUNICODE_STRING UNCServerNameU, IN PUNICODE_STRING SourceNameU, OUT PHANDLE phEventLog)
 
NTSTATUS NTAPI ElfReportEventA (IN HANDLE hEventLog, IN USHORT EventType, IN USHORT EventCategory, IN ULONG EventID, IN PSID UserSID, IN USHORT NumStrings, IN ULONG DataSize, IN PANSI_STRING *Strings, IN PVOID Data, IN USHORT Flags, IN OUT PULONG RecordNumber, IN OUT PULONG TimeWritten)
 
NTSTATUS NTAPI ElfReportEventW (IN HANDLE hEventLog, IN USHORT EventType, IN USHORT EventCategory, IN ULONG EventID, IN PSID UserSID, IN USHORT NumStrings, IN ULONG DataSize, IN PUNICODE_STRING *Strings, IN PVOID Data, IN USHORT Flags, IN OUT PULONG RecordNumber, IN OUT PULONG TimeWritten)
 
NTSTATUS NTAPI ElfReportEventAndSourceW (IN HANDLE hEventLog, IN ULONG Time, IN PUNICODE_STRING ComputerName, IN USHORT EventType, IN USHORT EventCategory, IN ULONG EventID, IN PSID UserSID, IN PUNICODE_STRING SourceName, IN USHORT NumStrings, IN ULONG DataSize, IN PUNICODE_STRING *Strings, IN PVOID Data, IN USHORT Flags, IN OUT PULONG RecordNumber, IN OUT PULONG TimeWritten)
 
NTSTATUS NTAPI ElfFlushEventLog (IN HANDLE hEventLog)
 

Function Documentation

◆ ElfBackupEventLogFileA()

NTSTATUS NTAPI ElfBackupEventLogFileA ( IN HANDLE  hEventLog,
IN PANSI_STRING  BackupFileNameA 
)

Definition at line 154 of file eventlog.c.

156 {
158 
159  if (!BackupFileNameA || (BackupFileNameA->Length == 0))
161 
163  {
164  Status = ElfrBackupELFA(hEventLog,
165  (PRPC_STRING)BackupFileNameA);
166  }
168  {
170  }
171  RpcEndExcept;
172 
173  return Status;
174 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS WINAPI ElfrBackupELFA(IELF_HANDLE LogHandle, PRPC_STRING BackupFileName)
Definition: rpc.c:787
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

◆ ElfBackupEventLogFileW()

NTSTATUS NTAPI ElfBackupEventLogFileW ( IN HANDLE  hEventLog,
IN PUNICODE_STRING  BackupFileNameU 
)

Definition at line 222 of file eventlog.c.

224 {
226 
227  if (!BackupFileNameU || (BackupFileNameU->Length == 0))
229 
231  {
232  Status = ElfrBackupELFW(hEventLog,
233  (PRPC_UNICODE_STRING)BackupFileNameU);
234  }
236  {
238  }
239  RpcEndExcept;
240 
241  return Status;
242 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI ElfrBackupELFW(IELF_HANDLE LogHandle, PRPC_UNICODE_STRING BackupFileName)
Definition: rpc.c:313
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by BackupEventLogW().

◆ ElfChangeNotify()

NTSTATUS NTAPI ElfChangeNotify ( IN HANDLE  hEventLog,
IN HANDLE  hEvent 
)

Definition at line 646 of file eventlog.c.

648 {
650  CLIENT_ID ClientId = NtCurrentTeb()->ClientId;
651  RPC_CLIENT_ID RpcClientId;
652 
655 
657  {
658  Status = ElfrChangeNotify(hEventLog, RpcClientId, HandleToUlong(hEvent));
659  }
661  {
663  }
664  RpcEndExcept;
665 
666  return Status;
667 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define HandleToUlong(h)
Definition: basetsd.h:79
HANDLE UniqueProcess
Definition: compat.h:684
static HANDLE hEvent
Definition: comm.c:54
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI ElfrChangeNotify(IELF_HANDLE LogHandle, RPC_CLIENT_ID ClientId, ULONG Event)
Definition: rpc.c:433
#define RpcExceptionCode()
Definition: rpc.h:132
_Out_ PCLIENT_ID ClientId
Definition: kefuncs.h:1163
HANDLE UniqueThread
Definition: compat.h:685
Status
Definition: gdiplustypes.h:24
FORCEINLINE struct _TEB * NtCurrentTeb(VOID)
Definition: psfuncs.h:420
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by NotifyChangeEventLog().

◆ ElfClearEventLogFileA()

NTSTATUS NTAPI ElfClearEventLogFileA ( IN HANDLE  hEventLog,
IN PANSI_STRING  BackupFileNameA 
)

Definition at line 285 of file eventlog.c.

287 {
289 
291  {
292  Status = ElfrClearELFA(hEventLog,
293  (PRPC_STRING)BackupFileNameA);
294  }
296  {
298  }
299  RpcEndExcept;
300 
301  return Status;
302 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS WINAPI ElfrClearELFA(IELF_HANDLE LogHandle, PRPC_STRING BackupFileName)
Definition: rpc.c:762
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

◆ ElfClearEventLogFileW()

NTSTATUS NTAPI ElfClearEventLogFileW ( IN HANDLE  hEventLog,
IN PUNICODE_STRING  BackupFileNameU 
)

Definition at line 347 of file eventlog.c.

349 {
351 
353  {
354  Status = ElfrClearELFW(hEventLog,
355  (PRPC_UNICODE_STRING)BackupFileNameU);
356  }
358  {
360  }
361  RpcEndExcept;
362 
363  return Status;
364 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI ElfrClearELFW(IELF_HANDLE LogHandle, PRPC_UNICODE_STRING BackupFileName)
Definition: rpc.c:289
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by ClearEventLogW().

◆ ElfCloseEventLog()

NTSTATUS NTAPI ElfCloseEventLog ( IN HANDLE  hEventLog)

Definition at line 409 of file eventlog.c.

410 {
412 
414  {
415  Status = ElfrCloseEL(&hEventLog);
416  }
418  {
420  }
421  RpcEndExcept;
422 
423  return Status;
424 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI ElfrCloseEL(PIELF_HANDLE LogHandle)
Definition: rpc.c:333
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by CloseEventLog().

◆ ElfDeregisterEventSource()

NTSTATUS NTAPI ElfDeregisterEventSource ( IN HANDLE  hEventLog)

Definition at line 455 of file eventlog.c.

456 {
458 
460  {
461  Status = ElfrDeregisterEventSource(&hEventLog);
462  }
464  {
466  }
467  RpcEndExcept;
468 
469  return Status;
470 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI ElfrDeregisterEventSource(PIELF_HANDLE LogHandle)
Definition: rpc.c:343
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by DeregisterEventSource(), and UserpLogHardError().

◆ ElfFlushEventLog()

NTSTATUS NTAPI ElfFlushEventLog ( IN HANDLE  hEventLog)

Definition at line 1633 of file eventlog.c.

1634 {
1635  NTSTATUS Status;
1636 
1637  RpcTryExcept
1638  {
1639  Status = ElfrFlushEL(hEventLog);
1640  }
1642  {
1644  }
1645  RpcEndExcept;
1646 
1647  return Status;
1648 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI ElfrFlushEL(IELF_HANDLE LogHandle)
Definition: rpc.c:1196
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

◆ ElfNumberOfRecords()

NTSTATUS NTAPI ElfNumberOfRecords ( IN HANDLE  hEventLog,
OUT PULONG  NumberOfRecords 
)

Definition at line 548 of file eventlog.c.

550 {
552 
553  if (!NumberOfRecords)
555 
557  {
558  Status = ElfrNumberOfRecords(hEventLog, NumberOfRecords);
559  }
561  {
563  }
564  RpcEndExcept;
565 
566  return Status;
567 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
NTSTATUS WINAPI ElfrNumberOfRecords(IELF_HANDLE LogHandle, PULONG NumberOfRecords)
Definition: rpc.c:353
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by GetNumberOfEventLogRecords().

◆ ElfOldestRecord()

NTSTATUS NTAPI ElfOldestRecord ( IN HANDLE  hEventLog,
OUT PULONG  OldestRecordNumber 
)

Definition at line 597 of file eventlog.c.

599 {
601 
602  if (!OldestRecordNumber)
604 
606  {
607  Status = ElfrOldestRecord(hEventLog, OldestRecordNumber);
608  }
610  {
612  }
613  RpcEndExcept;
614 
615  return Status;
616 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
NTSTATUS WINAPI ElfrOldestRecord(IELF_HANDLE LogHandle, PULONG OldestRecordNumber)
Definition: rpc.c:402
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by GetOldestEventLogRecord().

◆ ElfOpenBackupEventLogA()

NTSTATUS NTAPI ElfOpenBackupEventLogA ( IN PANSI_STRING  UNCServerNameA,
IN PANSI_STRING  BackupFileNameA,
OUT PHANDLE  phEventLog 
)

Definition at line 693 of file eventlog.c.

696 {
698  PSTR pUNCServerName = NULL;
699 
700  if (!phEventLog || !BackupFileNameA || (BackupFileNameA->Length == 0))
702 
703  if (UNCServerNameA && (UNCServerNameA->Length != 0))
704  pUNCServerName = UNCServerNameA->Buffer;
705 
706  *phEventLog = NULL;
707 
709  {
710  Status = ElfrOpenBELA(pUNCServerName,
711  (PRPC_STRING)BackupFileNameA,
712  1, 1,
713  (IELF_HANDLE*)phEventLog);
714  }
716  {
718  }
719  RpcEndExcept;
720 
721  return Status;
722 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI ElfrOpenBELA(EVENTLOG_HANDLE_A UNCServerName, PRPC_STRING BackupFileName, ULONG MajorVersion, ULONG MinorVersion, PIELF_HANDLE LogHandle)
Definition: rpc.c:897
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
signed char * PSTR
Definition: retypes.h:7
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

◆ ElfOpenBackupEventLogW()

NTSTATUS NTAPI ElfOpenBackupEventLogW ( IN PUNICODE_STRING  UNCServerNameU,
IN PUNICODE_STRING  BackupFileNameU,
OUT PHANDLE  phEventLog 
)

Definition at line 797 of file eventlog.c.

800 {
802  PWSTR pUNCServerName = NULL;
803 
804  if (!phEventLog || !BackupFileNameU || (BackupFileNameU->Length == 0))
806 
807  if (UNCServerNameU && (UNCServerNameU->Length != 0))
808  pUNCServerName = UNCServerNameU->Buffer;
809 
810  *phEventLog = NULL;
811 
813  {
814  Status = ElfrOpenBELW(pUNCServerName,
815  (PRPC_UNICODE_STRING)BackupFileNameU,
816  1,
817  1,
818  (IELF_HANDLE*)phEventLog);
819  }
821  {
823  }
824  RpcEndExcept;
825 
826  return Status;
827 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
uint16_t * PWSTR
Definition: typedefs.h:56
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI ElfrOpenBELW(EVENTLOG_HANDLE_W UNCServerName, PRPC_UNICODE_STRING BackupFileName, ULONG MajorVersion, ULONG MinorVersion, PIELF_HANDLE LogHandle)
Definition: rpc.c:506
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by OpenBackupEventLogW().

◆ ElfOpenEventLogA()

NTSTATUS NTAPI ElfOpenEventLogA ( IN PANSI_STRING  UNCServerNameA,
IN PANSI_STRING  SourceNameA,
OUT PHANDLE  phEventLog 
)

Definition at line 885 of file eventlog.c.

888 {
890  PSTR pUNCServerName = NULL;
891 
892  if (!phEventLog || !SourceNameA || (SourceNameA->Length == 0))
894 
895  if (UNCServerNameA && (UNCServerNameA->Length != 0))
896  pUNCServerName = UNCServerNameA->Buffer;
897 
898  *phEventLog = NULL;
899 
901  {
902  Status = ElfrOpenELA(pUNCServerName,
903  (PRPC_STRING)SourceNameA,
904  &EmptyStringA,
905  1,
906  1,
907  (IELF_HANDLE*)phEventLog);
908  }
910  {
912  }
913  RpcEndExcept;
914 
915  return Status;
916 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
static RPC_STRING EmptyStringA
Definition: eventlog.c:34
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
NTSTATUS WINAPI ElfrOpenELA(EVENTLOG_HANDLE_A UNCServerName, PRPC_STRING ModuleName, PRPC_STRING RegModuleName, ULONG MajorVersion, ULONG MinorVersion, PIELF_HANDLE LogHandle)
Definition: rpc.c:812
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
signed char * PSTR
Definition: retypes.h:7
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by OpenEventLogA().

◆ ElfOpenEventLogW()

NTSTATUS NTAPI ElfOpenEventLogW ( IN PUNICODE_STRING  UNCServerNameU,
IN PUNICODE_STRING  SourceNameU,
OUT PHANDLE  phEventLog 
)

Definition at line 951 of file eventlog.c.

954 {
956  PWSTR pUNCServerName = NULL;
957 
958  if (!phEventLog || !SourceNameU || (SourceNameU->Length == 0))
960 
961  if (UNCServerNameU && (UNCServerNameU->Length != 0))
962  pUNCServerName = UNCServerNameU->Buffer;
963 
964  *phEventLog = NULL;
965 
967  {
968  Status = ElfrOpenELW(pUNCServerName,
969  (PRPC_UNICODE_STRING)SourceNameU,
970  &EmptyStringU,
971  1,
972  1,
973  (IELF_HANDLE*)phEventLog);
974  }
976  {
978  }
979  RpcEndExcept;
980 
981  return Status;
982 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
uint16_t * PWSTR
Definition: typedefs.h:56
LONG NTSTATUS
Definition: precomp.h:26
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
NTSTATUS WINAPI ElfrOpenELW(EVENTLOG_HANDLE_W UNCServerName, PRPC_UNICODE_STRING ModuleName, PRPC_UNICODE_STRING RegModuleName, ULONG MajorVersion, ULONG MinorVersion, PIELF_HANDLE LogHandle)
Definition: rpc.c:446
Status
Definition: gdiplustypes.h:24
static RPC_UNICODE_STRING EmptyStringU
Definition: eventlog.c:33
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by OpenEventLogW().

◆ ElfReadEventLogA()

NTSTATUS NTAPI ElfReadEventLogA ( IN HANDLE  hEventLog,
IN ULONG  ReadFlags,
IN ULONG  RecordOffset,
OUT LPVOID  Buffer,
IN ULONG  NumberOfBytesToRead,
OUT PULONG  NumberOfBytesRead,
OUT PULONG  MinNumberOfBytesNeeded 
)

Definition at line 1013 of file eventlog.c.

1020 {
1021  NTSTATUS Status;
1022  ULONG Flags;
1023 
1024  if (!Buffer || !NumberOfBytesRead || !MinNumberOfBytesNeeded)
1025  {
1026  return STATUS_INVALID_PARAMETER;
1027  }
1028 
1031  {
1032  return STATUS_INVALID_PARAMETER;
1033  }
1034 
1037  {
1038  return STATUS_INVALID_PARAMETER;
1039  }
1040 
1041  RpcTryExcept
1042  {
1043  Status = ElfrReadELA(hEventLog,
1044  ReadFlags,
1045  RecordOffset,
1046  NumberOfBytesToRead,
1047  Buffer,
1048  NumberOfBytesRead,
1049  MinNumberOfBytesNeeded);
1050  }
1052  {
1054  }
1055  RpcEndExcept;
1056 
1057  return Status;
1058 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define EVENTLOG_BACKWARDS_READ
Definition: winnt_old.h:2698
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define EVENTLOG_SEQUENTIAL_READ
Definition: winnt_old.h:2695
Status
Definition: gdiplustypes.h:24
#define EVENTLOG_SEEK_READ
Definition: winnt_old.h:2696
NTSTATUS WINAPI ElfrReadELA(IELF_HANDLE LogHandle, ULONG ReadFlags, ULONG RecordOffset, RULONG NumberOfBytesToRead, PBYTE Buffer, PULONG NumberOfBytesRead, PULONG MinNumberOfBytesNeeded)
Definition: rpc.c:940
#define EVENTLOG_FORWARDS_READ
Definition: winnt_old.h:2697
unsigned int ULONG
Definition: retypes.h:1
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by ReadEventLogA().

◆ ElfReadEventLogW()

NTSTATUS NTAPI ElfReadEventLogW ( IN HANDLE  hEventLog,
IN ULONG  ReadFlags,
IN ULONG  RecordOffset,
OUT LPVOID  Buffer,
IN ULONG  NumberOfBytesToRead,
OUT PULONG  NumberOfBytesRead,
OUT PULONG  MinNumberOfBytesNeeded 
)

Definition at line 1106 of file eventlog.c.

1113 {
1114  NTSTATUS Status;
1115  ULONG Flags;
1116 
1117  if (!Buffer || !NumberOfBytesRead || !MinNumberOfBytesNeeded)
1118  {
1119  return STATUS_INVALID_PARAMETER;
1120  }
1121 
1124  {
1125  return STATUS_INVALID_PARAMETER;
1126  }
1127 
1130  {
1131  return STATUS_INVALID_PARAMETER;
1132  }
1133 
1134  RpcTryExcept
1135  {
1136  Status = ElfrReadELW(hEventLog,
1137  ReadFlags,
1138  RecordOffset,
1139  NumberOfBytesToRead,
1140  Buffer,
1141  NumberOfBytesRead,
1142  MinNumberOfBytesNeeded);
1143  }
1145  {
1147  }
1148  RpcEndExcept;
1149 
1150  return Status;
1151 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS WINAPI ElfrReadELW(IELF_HANDLE LogHandle, ULONG ReadFlags, ULONG RecordOffset, RULONG NumberOfBytesToRead, PBYTE Buffer, PULONG NumberOfBytesRead, PULONG MinNumberOfBytesNeeded)
Definition: rpc.c:530
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
#define EVENTLOG_BACKWARDS_READ
Definition: winnt_old.h:2698
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
Definition: bufpool.h:45
#define RpcExceptionCode()
Definition: rpc.h:132
#define EVENTLOG_SEQUENTIAL_READ
Definition: winnt_old.h:2695
Status
Definition: gdiplustypes.h:24
#define EVENTLOG_SEEK_READ
Definition: winnt_old.h:2696
#define EVENTLOG_FORWARDS_READ
Definition: winnt_old.h:2697
unsigned int ULONG
Definition: retypes.h:1
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by ReadEventLogW().

◆ ElfRegisterEventSourceA()

NTSTATUS NTAPI ElfRegisterEventSourceA ( IN PANSI_STRING  UNCServerNameA,
IN PANSI_STRING  SourceNameA,
OUT PHANDLE  phEventLog 
)

Definition at line 1190 of file eventlog.c.

1193 {
1194  NTSTATUS Status;
1195  PSTR pUNCServerName = NULL;
1196 
1197  if (!phEventLog || !SourceNameA || (SourceNameA->Length == 0))
1198  return STATUS_INVALID_PARAMETER;
1199 
1200  if (UNCServerNameA && (UNCServerNameA->Length != 0))
1201  pUNCServerName = UNCServerNameA->Buffer;
1202 
1203  *phEventLog = NULL;
1204 
1205  RpcTryExcept
1206  {
1207  Status = ElfrRegisterEventSourceA(pUNCServerName,
1208  (PRPC_STRING)SourceNameA,
1209  &EmptyStringA,
1210  1,
1211  1,
1212  (IELF_HANDLE*)phEventLog);
1213  }
1215  {
1217  }
1218  RpcEndExcept;
1219 
1220  return Status;
1221 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
LONG NTSTATUS
Definition: precomp.h:26
static RPC_STRING EmptyStringA
Definition: eventlog.c:34
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
signed char * PSTR
Definition: retypes.h:7
NTSTATUS WINAPI ElfrRegisterEventSourceA(EVENTLOG_HANDLE_A UNCServerName, PRPC_STRING ModuleName, PRPC_STRING RegModuleName, ULONG MajorVersion, ULONG MinorVersion, PIELF_HANDLE LogHandle)
Definition: rpc.c:849
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by RegisterEventSourceA().

◆ ElfRegisterEventSourceW()

NTSTATUS NTAPI ElfRegisterEventSourceW ( IN PUNICODE_STRING  UNCServerNameU,
IN PUNICODE_STRING  SourceNameU,
OUT PHANDLE  phEventLog 
)

Definition at line 1261 of file eventlog.c.

1264 {
1265  NTSTATUS Status;
1266  PWSTR pUNCServerName = NULL;
1267 
1268  if (!phEventLog || !SourceNameU || (SourceNameU->Length == 0))
1269  return STATUS_INVALID_PARAMETER;
1270 
1271  if (UNCServerNameU && (UNCServerNameU->Length != 0))
1272  pUNCServerName = UNCServerNameU->Buffer;
1273 
1274  *phEventLog = NULL;
1275 
1276  RpcTryExcept
1277  {
1278  Status = ElfrRegisterEventSourceW(pUNCServerName,
1279  (PRPC_UNICODE_STRING)SourceNameU,
1280  &EmptyStringU,
1281  1,
1282  1,
1283  (IELF_HANDLE*)phEventLog);
1284  }
1286  {
1288  }
1289  RpcEndExcept;
1290 
1291  return Status;
1292 }
#define RpcEndExcept
Definition: rpc.h:128
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
uint16_t * PWSTR
Definition: typedefs.h:56
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS WINAPI ElfrRegisterEventSourceW(EVENTLOG_HANDLE_W UNCServerName, PRPC_UNICODE_STRING ModuleName, PRPC_UNICODE_STRING RegModuleName, ULONG MajorVersion, ULONG MinorVersion, PIELF_HANDLE LogHandle)
Definition: rpc.c:474
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
smooth NULL
Definition: ftsmooth.c:416
#define RpcExceptionCode()
Definition: rpc.h:132
Status
Definition: gdiplustypes.h:24
static RPC_UNICODE_STRING EmptyStringU
Definition: eventlog.c:33
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by RegisterEventSourceW(), and UserpLogHardError().

◆ ElfReportEventA()

NTSTATUS NTAPI ElfReportEventA ( IN HANDLE  hEventLog,
IN USHORT  EventType,
IN USHORT  EventCategory,
IN ULONG  EventID,
IN PSID  UserSID,
IN USHORT  NumStrings,
IN ULONG  DataSize,
IN PANSI_STRING Strings,
IN PVOID  Data,
IN USHORT  Flags,
IN OUT PULONG  RecordNumber,
IN OUT PULONG  TimeWritten 
)

Definition at line 1323 of file eventlog.c.

1335 {
1336  NTSTATUS Status;
1337  LARGE_INTEGER SystemTime;
1338  ULONG Time;
1339  ULONG dwSize;
1340  ANSI_STRING ComputerName;
1341  CHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1342 
1343  dwSize = ARRAYSIZE(szComputerName);
1344  GetComputerNameA(szComputerName, &dwSize);
1345  RtlInitAnsiString(&ComputerName, szComputerName);
1346 
1347  NtQuerySystemTime(&SystemTime);
1348  RtlTimeToSecondsSince1970(&SystemTime, &Time);
1349 
1350  RpcTryExcept
1351  {
1352  Status = ElfrReportEventA(hEventLog,
1353  Time,
1354  EventType,
1355  EventCategory,
1356  EventID,
1357  NumStrings,
1358  DataSize,
1359  (PRPC_STRING)&ComputerName,
1360  (PRPC_SID)UserSID,
1361  (PRPC_STRING*)Strings,
1362  Data,
1363  Flags,
1364  RecordNumber,
1365  TimeWritten);
1366  }
1368  {
1370  }
1371  RpcEndExcept;
1372 
1373  return Status;
1374 }
BOOL WINAPI SHIM_OBJ_NAME() GetComputerNameA(LPSTR lpBuffer, LPDWORD lpnSize)
Definition: shimtest.c:21
#define RpcEndExcept
Definition: rpc.h:128
char CHAR
Definition: xmlstorage.h:175
LONG NTSTATUS
Definition: precomp.h:26
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
NTSYSAPI VOID NTAPI RtlInitAnsiString(PANSI_STRING DestinationString, PCSZ SourceString)
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT NumStrings
Definition: ndis.h:4751
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
static const WCHAR Strings[]
Definition: reg.c:35
Status
Definition: gdiplustypes.h:24
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
NTSTATUS WINAPI ElfrReportEventA(IELF_HANDLE LogHandle, ULONG Time, USHORT EventType, USHORT EventCategory, ULONG EventID, USHORT NumStrings, ULONG DataSize, PRPC_STRING ComputerName, PRPC_SID UserSID, PRPC_STRING Strings[], PBYTE Data, USHORT Flags, PULONG RecordNumber, PULONG TimeWritten)
Definition: rpc.c:992
unsigned int ULONG
Definition: retypes.h:1
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:417
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE EventType
Definition: exfuncs.h:165
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
static PLARGE_INTEGER Time
Definition: time.c:105
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by ReportEventA().

◆ ElfReportEventAndSourceW()

NTSTATUS NTAPI ElfReportEventAndSourceW ( IN HANDLE  hEventLog,
IN ULONG  Time,
IN PUNICODE_STRING  ComputerName,
IN USHORT  EventType,
IN USHORT  EventCategory,
IN ULONG  EventID,
IN PSID  UserSID,
IN PUNICODE_STRING  SourceName,
IN USHORT  NumStrings,
IN ULONG  DataSize,
IN PUNICODE_STRING Strings,
IN PVOID  Data,
IN USHORT  Flags,
IN OUT PULONG  RecordNumber,
IN OUT PULONG  TimeWritten 
)

Definition at line 1586 of file eventlog.c.

1601 {
1602  NTSTATUS Status;
1603 
1604  RpcTryExcept
1605  {
1606  Status = ElfrReportEventAndSourceW(hEventLog,
1607  Time,
1608  EventType,
1609  EventCategory,
1610  EventID,
1612  NumStrings,
1613  DataSize,
1614  (PRPC_UNICODE_STRING)ComputerName,
1615  (PRPC_SID)UserSID,
1617  (PBYTE)Data,
1618  Flags,
1619  RecordNumber,
1620  TimeWritten);
1621  }
1623  {
1625  }
1626  RpcEndExcept;
1627 
1628  return Status;
1629 }
#define RpcEndExcept
Definition: rpc.h:128
LONG NTSTATUS
Definition: precomp.h:26
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT NumStrings
Definition: ndis.h:4751
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
static const WCHAR Strings[]
Definition: reg.c:35
Status
Definition: gdiplustypes.h:24
WCHAR SourceName[256]
Definition: arping.c:28
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE EventType
Definition: exfuncs.h:165
BYTE * PBYTE
Definition: pedump.c:66
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
static PLARGE_INTEGER Time
Definition: time.c:105
NTSTATUS WINAPI ElfrReportEventAndSourceW(IELF_HANDLE LogHandle, ULONG Time, USHORT EventType, USHORT EventCategory, ULONG EventID, PRPC_UNICODE_STRING SourceName, USHORT NumStrings, ULONG DataSize, PRPC_UNICODE_STRING ComputerName, PRPC_SID UserSID, PRPC_UNICODE_STRING Strings[], PBYTE Data, USHORT Flags, PULONG RecordNumber, PULONG TimeWritten)
Definition: rpc.c:1224
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

◆ ElfReportEventW()

NTSTATUS NTAPI ElfReportEventW ( IN HANDLE  hEventLog,
IN USHORT  EventType,
IN USHORT  EventCategory,
IN ULONG  EventID,
IN PSID  UserSID,
IN USHORT  NumStrings,
IN ULONG  DataSize,
IN PUNICODE_STRING Strings,
IN PVOID  Data,
IN USHORT  Flags,
IN OUT PULONG  RecordNumber,
IN OUT PULONG  TimeWritten 
)

Definition at line 1462 of file eventlog.c.

1474 {
1475  NTSTATUS Status;
1476  LARGE_INTEGER SystemTime;
1477  ULONG Time;
1478  ULONG dwSize;
1479  UNICODE_STRING ComputerName;
1480  WCHAR szComputerName[MAX_COMPUTERNAME_LENGTH + 1];
1481 
1482  dwSize = ARRAYSIZE(szComputerName);
1483  GetComputerNameW(szComputerName, &dwSize);
1484  RtlInitUnicodeString(&ComputerName, szComputerName);
1485 
1486  NtQuerySystemTime(&SystemTime);
1487  RtlTimeToSecondsSince1970(&SystemTime, &Time);
1488 
1489  RpcTryExcept
1490  {
1491  Status = ElfrReportEventW(hEventLog,
1492  Time,
1493  EventType,
1494  EventCategory,
1495  EventID,
1496  NumStrings,
1497  DataSize,
1498  (PRPC_UNICODE_STRING)&ComputerName,
1499  (PRPC_SID)UserSID,
1501  Data,
1502  Flags,
1503  RecordNumber,
1504  TimeWritten);
1505  }
1507  {
1509  }
1510  RpcEndExcept;
1511 
1512  return Status;
1513 }
#define RpcEndExcept
Definition: rpc.h:128
NTSTATUS WINAPI ElfrReportEventW(IELF_HANDLE LogHandle, ULONG Time, USHORT EventType, USHORT EventCategory, ULONG EventID, USHORT NumStrings, ULONG DataSize, PRPC_UNICODE_STRING ComputerName, PRPC_SID UserSID, PRPC_UNICODE_STRING Strings[], PBYTE Data, USHORT Flags, PULONG RecordNumber, PULONG TimeWritten)
Definition: rpc.c:724
LONG NTSTATUS
Definition: precomp.h:26
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
BOOL WINAPI GetComputerNameW(LPWSTR lpBuffer, LPDWORD lpnSize)
Definition: compname.c:446
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT NumStrings
Definition: ndis.h:4751
#define RpcTryExcept
Definition: rpc.h:126
#define EXCEPTION_EXECUTE_HANDLER
Definition: excpt.h:85
#define RpcExceptionCode()
Definition: rpc.h:132
__wchar_t WCHAR
Definition: xmlstorage.h:180
static const WCHAR Strings[]
Definition: reg.c:35
Status
Definition: gdiplustypes.h:24
#define MAX_COMPUTERNAME_LENGTH
Definition: winbase.h:240
BOOLEAN NTAPI RtlTimeToSecondsSince1970(PLARGE_INTEGER Time, PULONG ElapsedSeconds)
unsigned int ULONG
Definition: retypes.h:1
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtQuerySystemTime(OUT PLARGE_INTEGER SystemTime)
Definition: time.c:417
_In_ ACCESS_MASK _In_opt_ POBJECT_ATTRIBUTES _In_ EVENT_TYPE EventType
Definition: exfuncs.h:165
_In_ NDIS_STATUS _In_ ULONG _In_ USHORT _In_opt_ PVOID _In_ ULONG DataSize
Definition: ndis.h:4751
PSDBQUERYRESULT_VISTA PVOID DWORD * dwSize
Definition: env.c:54
static PLARGE_INTEGER Time
Definition: time.c:105
#define RpcExcept(expr)
Definition: rpc.h:127
LONG WINAPI I_RpcMapWin32Status(RPC_STATUS status)
Definition: rpcrt4_main.c:738

Referenced by ReportEventW(), and UserpLogHardError().