Author: hpoussin
Date: Tue Aug 14 12:48:02 2007
New Revision: 28336
URL:
http://svn.reactos.org/svn/reactos?rev=28336&view=rev
Log:
Start the RPC server in eventlog service
Modified:
trunk/reactos/base/services/eventlog/eventlog.c
trunk/reactos/base/services/eventlog/rpc.c
Modified: trunk/reactos/base/services/eventlog/eventlog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/services/eventlog/eve…
==============================================================================
--- trunk/reactos/base/services/eventlog/eventlog.c (original)
+++ trunk/reactos/base/services/eventlog/eventlog.c Tue Aug 14 12:48:02 2007
@@ -43,7 +43,6 @@
else
CloseHandle(hThread);
-#ifdef RPC_ENABLED
hThread = CreateThread(NULL,
0,
(LPTHREAD_START_ROUTINE)
@@ -56,7 +55,6 @@
DPRINT("Can't create RpcThread\n");
else
CloseHandle(hThread);
-#endif
}
BOOL LoadLogFile(HKEY hKey, WCHAR * LogName)
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 (original)
+++ trunk/reactos/base/services/eventlog/rpc.c Tue Aug 14 12:48:02 2007
@@ -9,7 +9,15 @@
/* INCLUDES *****************************************************************/
#include "eventlog.h"
-#ifdef RPC_ENABLED
+
+#ifdef __GNUC__
+/* HACK as long as idl compiler doesn't support well PUNICODE_STRING args */
+#define PANSI_STRING LPSTR
+#define PUNICODE_STRING LPWSTR
+#define BINDING_HANDLE handle_t BindingHandle,
+#else
+#define BINDING_HANDLE
+#endif
/* FUNCTIONS ****************************************************************/
@@ -46,73 +54,80 @@
return 0;
}
-/* Function 0 */
+/* Function 0x00 */
NTSTATUS ElfrClearELFW(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ PUNICODE_STRING BackupName)
{
- DPRINT("UNIMPLEMENTED");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-/* Function 1 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+/* Function 0x01 */
NTSTATUS ElfrBackupELFW(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ PUNICODE_STRING BackupName)
{
- DPRINT("UNIMPLEMENTED");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 2 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x02 */
NTSTATUS ElfrCloseEL(
+ BINDING_HANDLE
/* [out][in] */ PLOGHANDLE Handle)
{
- DPRINT("UNIMPLEMENTED");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 3 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x03 */
NTSTATUS ElfrDeregisterEventSource(
+ BINDING_HANDLE
/* [out][in] */ PLOGHANDLE Handle)
{
- DPRINT("UNIMPLEMENTED");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 4 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x04 */
NTSTATUS ElfrNumberOfRecords(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [out] */ long __RPC_FAR * NumberOfRecords)
{
- DPRINT("UNIMPLEMENTED");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 5 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x05 */
NTSTATUS ElfrOldestRecord(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE LogHandle,
/* [out] */ long __RPC_FAR * OldestRecNumber)
{
- DPRINT("EventLogGetOldestRec UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 6 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x06 */
NTSTATUS ElfrChangeNotify(void)
{
- DPRINT("EventLogChangeNotify UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 7 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x07 */
NTSTATUS ElfrOpenELW(
+ BINDING_HANDLE
/* [unique][in] */ LPWSTR ServerName,
/* [in] */ PUNICODE_STRING FileName,
/* [in] */ PUNICODE_STRING NullStr,
@@ -120,13 +135,14 @@
/* [in] */ long MinorVer,
/* [out] */ PLOGHANDLE Handle)
{
- DPRINT("EventLogOpenW UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 8 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x08 */
NTSTATUS ElfrRegisterEventSourceW(
+ BINDING_HANDLE
/* [unique][in] */ LPWSTR ServerName,
/* [in] */ PUNICODE_STRING LogName,
/* [in] */ PUNICODE_STRING NullStr,
@@ -134,26 +150,28 @@
/* [in] */ long MinorVer,
/* [out] */ PLOGHANDLE Handle)
{
- DPRINT("EventLogRegSrcW UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 9 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x09 */
NTSTATUS ElfrOpenBELW(
+ BINDING_HANDLE
/* [unique][in] */ LPWSTR ServerName,
/* [in] */ PUNICODE_STRING BackupName,
/* [in] */ long MajorVer,
/* [in] */ long MinorVer,
/* [out] */ PLOGHANDLE Handle)
{
- DPRINT("EventLogOpenBackupW UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 10 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x0a */
NTSTATUS ElfrReadELW(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ long Flags,
/* [in] */ long Offset,
@@ -162,13 +180,14 @@
/* [out] */ long __RPC_FAR * BytesRead,
/* [out] */ long __RPC_FAR * BytesNeeded)
{
- DPRINT("EventLogReadW UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 11 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x0b */
NTSTATUS ElfrReportEventW(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ long Time,
/* [in] */ short Type,
@@ -184,33 +203,36 @@
/* [unique][out][in] */ long __RPC_FAR * unknown1,
/* [unique][out][in] */ long __RPC_FAR * unknown2)
{
- DPRINT("EventLogReportEventW UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 12 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x0c */
NTSTATUS ElfrClearELFA(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [unique][in] */ PANSI_STRING BackupName)
{
- DPRINT("EventLogClearA UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 13 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x0d */
NTSTATUS ElfrBackupELFA(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ PANSI_STRING BackupName)
{
- DPRINT("EventLogBackupA UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 14 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x0e */
NTSTATUS ElfrOpenELA(
+ BINDING_HANDLE
/* [unique][in] */ LPSTR ServerName,
/* [in] */ PANSI_STRING LogName,
/* [in] */ PANSI_STRING NullStr,
@@ -218,7 +240,7 @@
/* [in] */ long MinorVer,
/* [out] */ PLOGHANDLE Handle)
{
- UNICODE_STRING logname = { 0 }, servername = { 0 }, StrNull = { 0 };
+ UNICODE_STRING logname = { 0, }, servername = { 0, }, StrNull = { 0, };
NTSTATUS status;
if (LogName && !RtlCreateUnicodeStringFromAsciiz(&logname, LogName))
@@ -233,8 +255,8 @@
return STATUS_NO_MEMORY;
}
- status = EventLogOpenW(servername.Buffer, logname.Buffer,
- StrNull, MajorVer, MinorVer, Handle);
+ status = ElfrOpenELW(BindingHandle, servername.Buffer, logname.Buffer,
+ StrNull.Buffer, MajorVer, MinorVer, Handle);
RtlFreeUnicodeString(&servername);
RtlFreeUnicodeString(&logname);
@@ -243,8 +265,9 @@
}
-/* Function 15 */
+/* Function 0x0f */
NTSTATUS ElfrRegisterEventSourceA(
+ BINDING_HANDLE
/* [unique][in] */ LPSTR ServerName,
/* [in] */ PANSI_STRING LogName,
/* [in] */ PANSI_STRING NullStr,
@@ -252,26 +275,28 @@
/* [in] */ long MinorVer,
/* [out] */ PLOGHANDLE Handle)
{
- DPRINT("EventLogRegSrcA UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 16 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x10 */
NTSTATUS ElfrOpenBELA(
+ BINDING_HANDLE
/* [unique][in] */ LPSTR ServerName,
/* [in] */ PANSI_STRING BakckupName,
/* [in] */ long MajorVer,
/* [in] */ long MinorVer,
/* [out] */ PLOGHANDLE Handle)
{
- DPRINT("EventLogOpenBackupA UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 17 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x11 */
NTSTATUS ElfrReadELA(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ long Flags,
/* [in] */ long Offset,
@@ -280,13 +305,14 @@
/* [out] */ long __RPC_FAR * BytesRead,
/* [out] */ long __RPC_FAR * BytesNeeded)
{
- DPRINT("EventLogReadA UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 18 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x12 */
NTSTATUS ElfrReportEventA(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ long Time,
/* [in] */ short Type,
@@ -302,60 +328,58 @@
/* [unique][out][in] */ long __RPC_FAR * unknown1,
/* [unique][out][in] */ long __RPC_FAR * unknown2)
{
- DPRINT("EventLogReportEventA UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 19 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x13 */
NTSTATUS ElfrRegisterClusterSvc(void)
{
- DPRINT("EventLogRegisterClusterSvc UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 20 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x14 */
NTSTATUS ElfrDeregisterClusterSvc(void)
{
- DPRINT("EventLogDeregisterClusterSvc UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 21 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x15 */
NTSTATUS ElfrWriteClusterEvents(void)
{
- DPRINT("EventLogWriteClusterEvents UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 22 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x16 */
NTSTATUS ElfrGetLogInformation(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle,
/* [in] */ long InfoLevel,
/* [size_is][out] */unsigned char __RPC_FAR * Buffer,
/* [in] */ long BufSize,
/* [out] */ long __RPC_FAR * BytesNeeded)
{
- DPRINT("EventLogGetInfo UNIMPLEMENTED\n");
- return STATUS_NOT_IMPLEMENTED;
-}
-
-
-/* Function 23 */
+ UNIMPLEMENTED;
+ return STATUS_NOT_IMPLEMENTED;
+}
+
+
+/* Function 0x17 */
NTSTATUS ElfrFlushEL(
+ BINDING_HANDLE
/* [in] */ LOGHANDLE Handle)
{
DbgPrint("EventLogFlush UNIMPLEMENTED\n");
return STATUS_NOT_IMPLEMENTED;
}
-#else
-void func(handle_t h) { }
-#endif // RPC_ENABLED
-
void __RPC_FAR *__RPC_USER midl_user_allocate(size_t len)
{
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);