Author: ekohl
Date: Thu Dec 15 21:33:46 2011
New Revision: 54656
URL:
http://svn.reactos.org/svn/reactos?rev=54656&view=rev
Log:
[EVENTLOG]
- Implement ElfrClearELFA and ElfrClearELFW.
- Fix the module name conversion in ElfrOpenELA and ElfrRegisterEventSourceA.
Modified:
trunk/reactos/base/services/eventlog/rpc.c
Modified: trunk/reactos/base/services/eventlog/rpc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/rpc…
==============================================================================
--- trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] (original)
+++ trunk/reactos/base/services/eventlog/rpc.c [iso-8859-1] Thu Dec 15 21:33:46 2011
@@ -160,8 +160,25 @@
IELF_HANDLE LogHandle,
PRPC_UNICODE_STRING BackupFileName)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ PLOGHANDLE lpLogHandle;
+ PLOGFILE lpLogFile;
+
+ lpLogHandle = ElfGetLogHandleEntryByHandle(LogHandle);
+ if (!lpLogHandle)
+ {
+ return STATUS_INVALID_HANDLE;
+ }
+
+ lpLogFile = lpLogHandle->LogFile;
+
+ if (BackupFileName->Length > 0)
+ {
+ /* FIXME: Write a backup file */
+ }
+
+ LogfInitializeNew(lpLogFile);
+
+ return STATUS_SUCCESS;
}
@@ -301,7 +318,7 @@
DWORD MinorVersion,
IELF_HANDLE *LogHandle)
{
- DPRINT1("ElfrRegisterEventSourceW()\n");
+ DPRINT("ElfrRegisterEventSourceW()\n");
if ((MajorVersion != 1) || (MinorVersion != 1))
return STATUS_INVALID_PARAMETER;
@@ -310,7 +327,7 @@
if (RegModuleName->Length > 0)
return STATUS_INVALID_PARAMETER;
- DPRINT1("ModuleName: %S\n", ModuleName->Buffer);
+ DPRINT("ModuleName: %S\n", ModuleName->Buffer);
/*FIXME: UNCServerName must specify the server or empty for local */
@@ -500,8 +517,21 @@
IELF_HANDLE LogHandle,
PRPC_STRING BackupFileName)
{
- UNIMPLEMENTED;
- return STATUS_NOT_IMPLEMENTED;
+ UNICODE_STRING BackupFileNameW;
+ NTSTATUS Status;
+
+ Status = RtlAnsiStringToUnicodeString(&BackupFileNameW,
+ (PANSI_STRING)BackupFileName,
+ TRUE);
+ if (!NT_SUCCESS(Status))
+ return Status;
+
+ Status = ElfrClearELFW(LogHandle,
+ (PRPC_UNICODE_STRING)&BackupFileNameW);
+
+ RtlFreeUnicodeString(&BackupFileNameW);
+
+ return Status;
}
@@ -525,6 +555,7 @@
IELF_HANDLE *LogHandle)
{
UNICODE_STRING ModuleNameW;
+ NTSTATUS Status;
if ((MajorVersion != 1) || (MinorVersion != 1))
return STATUS_INVALID_PARAMETER;
@@ -533,7 +564,9 @@
if (RegModuleName->Length > 0)
return STATUS_INVALID_PARAMETER;
- RtlAnsiStringToUnicodeString(&ModuleNameW, (PANSI_STRING)ModuleName, TRUE);
+ Status = RtlAnsiStringToUnicodeString(&ModuleNameW, (PANSI_STRING)ModuleName,
TRUE);
+ if (!NT_SUCCESS(Status))
+ return Status;
/* FIXME: Must verify that caller has read access */
@@ -559,12 +592,16 @@
DWORD MinorVersion,
IELF_HANDLE *LogHandle)
{
- UNICODE_STRING ModuleNameW = { 0, 0, NULL };
-
- if (ModuleName &&
- !RtlAnsiStringToUnicodeString(&ModuleNameW, (PANSI_STRING)ModuleName, TRUE))
- {
- return STATUS_NO_MEMORY;
+ UNICODE_STRING ModuleNameW;
+ NTSTATUS Status;
+
+ Status = RtlAnsiStringToUnicodeString(&ModuleNameW,
+ (PANSI_STRING)ModuleName,
+ TRUE);
+ if (!NT_SUCCESS(Status))
+ {
+ DPRINT1("RtlAnsiStringToUnicodeString failed (Status 0x%08lx)\n",
Status);
+ return Status;
}
/* RegModuleName must be an empty string */