Author: hpoussin
Date: Tue Aug 14 12:49:29 2007
New Revision: 28337
URL:
http://svn.reactos.org/svn/reactos?rev=28337&view=rev
Log:
Forward RegisterEventSourceW and DeregisterEventSource to eventlog service
Added:
trunk/reactos/dll/win32/advapi32/service/rpc.c
- copied, changed from r28297, trunk/reactos/dll/win32/setupapi/rpc.c
Modified:
trunk/reactos/dll/win32/advapi32/advapi32.h
trunk/reactos/dll/win32/advapi32/advapi32.rbuild
trunk/reactos/dll/win32/advapi32/sec/misc.c
trunk/reactos/dll/win32/advapi32/service/eventlog.c
trunk/reactos/dll/win32/advapi32/service/scm.c
Modified: trunk/reactos/dll/win32/advapi32/advapi32.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.h (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.h Tue Aug 14 12:49:29 2007
@@ -28,6 +28,7 @@
#include <services/services.h>
#include "svcctl_c.h"
#include "lsa_c.h"
+#include "eventlogrpc_c.h"
#ifndef HAS_FN_PROGRESSW
#define FN_PROGRESSW FN_PROGRESS
@@ -35,6 +36,16 @@
#ifndef HAS_FN_PROGRESSA
#define FN_PROGRESSA FN_PROGRESS
#endif
+
+/* rpc.c */
+
+RPC_STATUS EvtBindRpc(LPCWSTR pszMachine,
+ RPC_BINDING_HANDLE* BindingHandle);
+RPC_STATUS EvtUnbindRpc(RPC_BINDING_HANDLE *BindingHandle);
+
+BOOL
+EvtGetLocalHandle(RPC_BINDING_HANDLE *BindingHandle);
+RPC_STATUS EvtUnbindLocalHandle(void);
/* Interface to ntmarta.dll **************************************************/
Modified: trunk/reactos/dll/win32/advapi32/advapi32.rbuild
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.rbuild (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.rbuild Tue Aug 14 12:49:29 2007
@@ -4,6 +4,7 @@
<include base="advapi32">.</include>
<include base="scm_client">.</include>
<include base="lsa_client">.</include>
+ <include base="eventlog_client">.</include>
<define name="__USE_W32API" />
<define name="WINVER">0x600</define>
<define name="_WIN32_IE">0x0500</define>
@@ -12,6 +13,7 @@
<define name="_UNICODE"></define>
<library>scm_client</library>
<library>lsa_client</library>
+ <library>eventlog_client</library>
<library>ntdll</library>
<library>rpcrt4</library>
<library>wine</library>
@@ -49,6 +51,7 @@
</directory>
<directory name="service">
<file>eventlog.c</file>
+ <file>rpc.c</file>
<file>scm.c</file>
<file>sctrl.c</file>
<file>undoc.c</file>
Modified: trunk/reactos/dll/win32/advapi32/sec/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/sec/mis…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/sec/misc.c (original)
+++ trunk/reactos/dll/win32/advapi32/sec/misc.c Tue Aug 14 12:49:29 2007
@@ -899,7 +899,7 @@
PSID_NAME_USE peUse )
{
LSA_UNICODE_STRING SystemName;
- LSA_OBJECT_ATTRIBUTES ObjectAttributes = {0};
+ LSA_OBJECT_ATTRIBUTES ObjectAttributes = {0};
LSA_HANDLE PolicyHandle = NULL;
NTSTATUS Status;
PLSA_REFERENCED_DOMAIN_LIST ReferencedDomain = NULL;
Modified: trunk/reactos/dll/win32/advapi32/service/eventlog.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/eventlog.c (original)
+++ trunk/reactos/dll/win32/advapi32/service/eventlog.c Tue Aug 14 12:49:29 2007
@@ -97,10 +97,30 @@
* RETURNS STD
*/
BOOL WINAPI
-DeregisterEventSource (HANDLE hEventLog)
-{
- DPRINT1("(%p): stub\n",hEventLog);
- return TRUE;
+DeregisterEventSource(
+ IN HANDLE hEventLog)
+{
+ RPC_BINDING_HANDLE BindingHandle = NULL;
+ LOGHANDLE Handle = (LOGHANDLE)hEventLog;
+ NTSTATUS Status;
+
+ DPRINT("%p\n", hEventLog);
+
+ if (!EvtGetLocalHandle(&BindingHandle))
+ {
+ SetLastError(ERROR_GEN_FAILURE);
+ return FALSE;
+ }
+
+ Status = ElfrDeregisterEventSource(
+ BindingHandle,
+ &Handle);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return FALSE;
+ }
+ return TRUE;
}
@@ -291,12 +311,44 @@
* Failure: NULL
*/
HANDLE WINAPI
-RegisterEventSourceW (LPCWSTR lpUNCServerName,
- LPCWSTR lpSourceName)
-{
- DPRINT1("(%S, %S): stub\n",
- lpUNCServerName, lpSourceName);
- return (HANDLE)1;
+RegisterEventSourceW(
+ IN LPCWSTR lpUNCServerName,
+ IN LPCWSTR lpSourceName)
+{
+ RPC_BINDING_HANDLE BindingHandle = NULL;
+ LOGHANDLE Handle;
+ NTSTATUS Status;
+
+ DPRINT("%S, %S\n", lpUNCServerName, lpSourceName);
+
+ if (lpUNCServerName != NULL)
+ {
+ DPRINT1("lpUNCServerName argument not supported\n");
+ SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ return NULL;
+ }
+
+ if (!EvtGetLocalHandle(&BindingHandle))
+ {
+ SetLastError(ERROR_GEN_FAILURE);
+ return NULL;
+ }
+
+ Status = ElfrRegisterEventSourceW(
+ BindingHandle,
+ (LPWSTR)lpUNCServerName,
+ (LPWSTR)lpSourceName,
+ L"",
+ 0,
+ 0,
+ &Handle);
+ if (!NT_SUCCESS(Status))
+ {
+ SetLastError(RtlNtStatusToDosError(Status));
+ return NULL;
+ }
+
+ return (HANDLE)Handle;
}
@@ -415,6 +467,10 @@
DPRINT1("Warning: %S\n", lpStrings[i]);
break;
+ case EVENTLOG_INFORMATION_TYPE:
+ DPRINT1("Info: %S\n", lpStrings[i]);
+ break;
+
default:
DPRINT1("Type %hu: %S\n", wType, lpStrings[i]);
break;
Copied: trunk/reactos/dll/win32/advapi32/service/rpc.c (from r28297,
trunk/reactos/dll/win32/setupapi/rpc.c)
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/setupapi/rpc.c (original)
+++ trunk/reactos/dll/win32/advapi32/service/rpc.c Tue Aug 14 12:49:29 2007
@@ -1,33 +1,19 @@
/*
- * RPC support routines
- *
- * Copyright 2005 Eric Kohl
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
+ * COPYRIGHT: See COPYING in the top level directory
+ * PROJECT: ReactOS system libraries
+ * FILE: lib/advapi32/service/rpc.c
+ * PURPOSE: RPC support routines
+ * PROGRAMMER: Eric Kohl
*/
-#include "setupapi_private.h"
+/* INCLUDES ******************************************************************/
-WINE_DEFAULT_DEBUG_CHANNEL(setupapi);
+#include <advapi32.h>
static RPC_BINDING_HANDLE LocalBindingHandle = NULL;
-static HSTRING_TABLE LocalStringTable = NULL;
-
RPC_STATUS
-PnpBindRpc(LPCWSTR pszMachine,
+EvtBindRpc(LPCWSTR pszMachine,
RPC_BINDING_HANDLE* BindingHandle)
{
PWSTR pszStringBinding = NULL;
@@ -36,7 +22,7 @@
Status = RpcStringBindingComposeW(NULL,
L"ncacn_np",
(LPWSTR)pszMachine,
- L"\\pipe\\umpnpmgr",
+ L"\\pipe\\EventLog",
NULL,
&pszStringBinding);
if (Status != RPC_S_OK)
@@ -50,9 +36,8 @@
return Status;
}
-
RPC_STATUS
-PnpUnbindRpc(RPC_BINDING_HANDLE *BindingHandle)
+EvtUnbindRpc(RPC_BINDING_HANDLE *BindingHandle)
{
if (BindingHandle != NULL)
{
@@ -63,52 +48,31 @@
return RPC_S_OK;
}
-
BOOL
-PnpGetLocalHandles(RPC_BINDING_HANDLE *BindingHandle,
- HSTRING_TABLE *StringTable)
+EvtGetLocalHandle(RPC_BINDING_HANDLE *BindingHandle)
{
if (LocalBindingHandle != NULL)
{
if (BindingHandle != NULL)
*BindingHandle = LocalBindingHandle;
- if (StringTable != NULL)
- *StringTable = LocalStringTable;
-
return TRUE;
}
- LocalStringTable = StringTableInitialize();
- if (LocalStringTable == NULL)
+ if (EvtBindRpc(NULL, &LocalBindingHandle) != RPC_S_OK)
return FALSE;
-
- if (PnpBindRpc(NULL, &LocalBindingHandle) != RPC_S_OK)
- {
- StringTableDestroy(LocalStringTable);
- return FALSE;
- }
-
- StringTableAddString(LocalStringTable, L"PLT", 1);
if (BindingHandle != NULL)
*BindingHandle = LocalBindingHandle;
- if (StringTable != NULL)
- *StringTable = LocalStringTable;
-
return TRUE;
}
-
RPC_STATUS
-PnpUnbindLocalBindingHandle(VOID)
+EvtUnbindLocalHandle(VOID)
{
- StringTableDestroy(LocalStringTable);
- LocalStringTable = NULL;
- return PnpUnbindRpc(&LocalBindingHandle);
+ return EvtUnbindRpc(&LocalBindingHandle);
}
-
void __RPC_FAR * __RPC_USER
midl_user_allocate(size_t len)
Modified: trunk/reactos/dll/win32/advapi32/service/scm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/scm.c (original)
+++ trunk/reactos/dll/win32/advapi32/service/scm.c Tue Aug 14 12:49:29 2007
@@ -2163,16 +2163,4 @@
return TRUE;
}
-
-void __RPC_FAR * __RPC_USER midl_user_allocate(size_t len)
-{
- return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
-}
-
-
-void __RPC_USER midl_user_free(void __RPC_FAR * ptr)
-{
- HeapFree(GetProcessHeap(), 0, ptr);
-}
-
/* EOF */