Author: ekohl
Date: Sat Sep 13 15:04:51 2008
New Revision: 36200
URL:
http://svn.reactos.org/svn/reactos?rev=36200&view=rev
Log:
Implement I_ScSetServiceBitsA/W and SetServiceBits.
Removed:
trunk/reactos/dll/win32/advapi32/service/undoc.c
Modified:
trunk/reactos/base/system/services/rpcserver.c
trunk/reactos/dll/win32/advapi32/advapi32.def
trunk/reactos/dll/win32/advapi32/advapi32.h
trunk/reactos/dll/win32/advapi32/advapi32.rbuild
trunk/reactos/dll/win32/advapi32/service/scm.c
trunk/reactos/dll/win32/advapi32/service/sctrl.c
trunk/reactos/include/reactos/idl/svcctl.idl
Modified: trunk/reactos/base/system/services/rpcserver.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/services/rpcse…
==============================================================================
--- trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/services/rpcserver.c [iso-8859-1] Sat Sep 13 15:04:51 2008
@@ -1035,7 +1035,7 @@
/* Function 10 */
-DWORD RSetServiceBitsW(
+DWORD RI_ScSetServiceBitsW(
handle_t BindingHandle,
SC_RPC_HANDLE hServiceStatus,
DWORD dwServiceBits,
@@ -2819,7 +2819,7 @@
/* Function 22 */
-DWORD RSetServiceBitsA(
+DWORD RI_ScSetServiceBitsA(
handle_t BindingHandle,
SC_RPC_HANDLE hServiceStatus,
DWORD dwServiceBits,
Modified: trunk/reactos/dll/win32/advapi32/advapi32.def
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/advapi3…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/advapi32.def [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.def [iso-8859-1] Sat Sep 13 15:04:51 2008
@@ -307,8 +307,8 @@
;I_ScIsSecurityProcess
;I_ScPnPGetServiceName
;I_ScSendTSMessage
-;I_ScSetServiceBitsA@20
-;I_ScSetServiceBitsW@20
+I_ScSetServiceBitsA@20
+I_ScSetServiceBitsW@20
;IdentifyCodeAuthzLevelW
ImpersonateAnonymousToken@4
ImpersonateLoggedOnUser@4
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 [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.h [iso-8859-1] Sat Sep 13 15:04:51 2008
@@ -49,6 +49,10 @@
BOOL
EvtGetLocalHandle(RPC_BINDING_HANDLE *BindingHandle);
RPC_STATUS EvtUnbindLocalHandle(void);
+
+/* scm.c */
+DWORD
+ScmRpcStatusToWinError(RPC_STATUS Status);
/* 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 [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/advapi32.rbuild [iso-8859-1] Sat Sep 13 15:04:51
2008
@@ -53,7 +53,6 @@
<file>rpc.c</file>
<file>scm.c</file>
<file>sctrl.c</file>
- <file>undoc.c</file>
</directory>
<directory name="token">
<file>privilege.c</file>
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 [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/scm.c [iso-8859-1] Sat Sep 13 15:04:51 2008
@@ -78,7 +78,7 @@
#endif
-static DWORD
+DWORD
ScmRpcStatusToWinError(RPC_STATUS Status)
{
switch (Status)
Modified: trunk/reactos/dll/win32/advapi32/service/sctrl.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/sctrl.c [iso-8859-1] Sat Sep 13 15:04:51
2008
@@ -529,9 +529,87 @@
/**********************************************************************
+ * I_ScSetServiceBitsA
+ *
+ * Undocumented
+ *
+ * @implemented
+ */
+BOOL STDCALL
+I_ScSetServiceBitsA(SC_RPC_HANDLE hServiceStatus,
+ DWORD dwServiceBits,
+ BOOL bSetBitsOn,
+ BOOL bUpdateImmediately,
+ LPSTR lpString)
+{
+ BOOL bResult;
+
+ HandleBind();
+
+ _SEH_TRY
+ {
+ /* Call to services.exe using RPC */
+ bResult = RI_ScSetServiceBitsA(BindingHandle,
+ (SC_RPC_HANDLE)hServiceStatus,
+ dwServiceBits,
+ bSetBitsOn,
+ bUpdateImmediately,
+ lpString);
+ }
+ _SEH_HANDLE
+ {
+ SetLastError(ScmRpcStatusToWinError(RpcExceptionCode()));
+ bResult = FALSE;
+ }
+ _SEH_END;
+
+ return bResult;
+}
+
+
+/**********************************************************************
+ * I_ScSetServiceBitsW
+ *
+ * Undocumented
+ *
+ * @implemented
+ */
+BOOL STDCALL
+I_ScSetServiceBitsW(SC_RPC_HANDLE hServiceStatus,
+ DWORD dwServiceBits,
+ BOOL bSetBitsOn,
+ BOOL bUpdateImmediately,
+ LPWSTR lpString)
+{
+ BOOL bResult;
+
+ HandleBind();
+
+ _SEH_TRY
+ {
+ /* Call to services.exe using RPC */
+ bResult = RI_ScSetServiceBitsW(BindingHandle,
+ (SC_RPC_HANDLE)hServiceStatus,
+ dwServiceBits,
+ bSetBitsOn,
+ bUpdateImmediately,
+ lpString);
+ }
+ _SEH_HANDLE
+ {
+ SetLastError(ScmRpcStatusToWinError(RpcExceptionCode()));
+ bResult = FALSE;
+ }
+ _SEH_END;
+
+ return bResult;
+}
+
+
+/**********************************************************************
* SetServiceBits
*
- * @unimplemented
+ * @implemented
*/
BOOL STDCALL
SetServiceBits(SERVICE_STATUS_HANDLE hServiceStatus,
@@ -539,8 +617,11 @@
BOOL bSetBitsOn,
BOOL bUpdateImmediately)
{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return FALSE;
+ return I_ScSetServiceBitsW(hServiceStatus,
+ dwServiceBits,
+ bSetBitsOn,
+ bUpdateImmediately,
+ NULL);
}
Removed: trunk/reactos/dll/win32/advapi32/service/undoc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/advapi32/service…
==============================================================================
--- trunk/reactos/dll/win32/advapi32/service/undoc.c [iso-8859-1] (original)
+++ trunk/reactos/dll/win32/advapi32/service/undoc.c (removed)
@@ -1,51 +1,0 @@
-/* $Id$
- *
- * COPYRIGHT: See COPYING in the top level directory
- * PROJECT: ReactOS system libraries
- * FILE: lib/advapi32/service/undoc.c
- * PURPOSE: Undocumented service functions
- * PROGRAMMER: Emanuele Aliberti
- * UPDATE HISTORY:
- * 19990413 EA created
- * 19990515 EA
- */
-
-/* INCLUDES ******************************************************************/
-
-#include <advapi32.h>
-
-
-/* FUNCTIONS *****************************************************************/
-
-/**********************************************************************
- * I_ScSetServiceBitsA
- *
- * Undocumented
- *
- * Return value unknown.
- */
-DWORD
-STDCALL
-I_ScSetServiceBitsA(VOID)
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 1;
-}
-
-
-/**********************************************************************
- * I_ScSetServiceBitsW
- *
- * Undocumented
- *
- * Return value unknown.
- */
-DWORD
-STDCALL
-I_ScSetServiceBitsW(VOID)
-{
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
- return 1;
-}
-
-
Modified: trunk/reactos/include/reactos/idl/svcctl.idl
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/idl/svcctl…
==============================================================================
--- trunk/reactos/include/reactos/idl/svcctl.idl [iso-8859-1] (original)
+++ trunk/reactos/include/reactos/idl/svcctl.idl [iso-8859-1] Sat Sep 13 15:04:51 2008
@@ -366,7 +366,7 @@
[in] DWORD BootAcceptable);
/* Function 10 */
- DWORD RSetServiceBitsW(
+ DWORD RI_ScSetServiceBitsW(
[in] handle_t BindingHandle,
[in] SC_RPC_HANDLE hServiceStatus,
[in] DWORD dwServiceBits,
@@ -490,7 +490,7 @@
[in, out] DWORD* lpcchBuffer);
/* Function 22 */
- DWORD RSetServiceBitsA(
+ DWORD RI_ScSetServiceBitsA(
[in] handle_t BindingHandle,
[in] SC_RPC_HANDLE hServiceStatus,
[in] DWORD dwServiceBits,