Forward ChangeServiceConfig2W call to services.exe
authorHervé Poussineau <hpoussin@reactos.org>
Fri, 30 Dec 2005 10:29:07 +0000 (10:29 +0000)
committerHervé Poussineau <hpoussin@reactos.org>
Fri, 30 Dec 2005 10:29:07 +0000 (10:29 +0000)
svn path=/trunk/; revision=20456

reactos/include/idl/svcctl.idl
reactos/lib/advapi32/advapi32.def
reactos/lib/advapi32/service/scm.c
reactos/subsys/system/services/rpcserver.c

index ed6e758..d270274 100644 (file)
@@ -324,7 +324,11 @@ cpp_quote("#endif")
   /* ScmrChangeServiceConfig2A */\r
 \r
   /* Function 37 */\r
-  /* ScmrChangeServiceConfig2W */\r
+  DWORD ScmrChangeServiceConfig2W([in] handle_t BindingHandle,\r
+                                  [in] SC_HANDLE hService,\r
+                                  [in] DWORD dwInfoLevel,\r
+                                  [in, size_is(dwInfoSize)] unsigned char *lpInfo,\r
+                                  [in] DWORD dwInfoSize);\r
 \r
   /* Function 38 */\r
   /* ScmrQueryServiceConfig2A */\r
index 4abe55b..bcd9f6f 100644 (file)
@@ -59,7 +59,7 @@ BuildTrusteeWithSidA@8
 BuildTrusteeWithSidW@8
 ;CancelOverlappedAccess@4
 ;ChangeServiceConfig2A@12
-;ChangeServiceConfig2W@12
+ChangeServiceConfig2W@12
 ChangeServiceConfigA@44
 ChangeServiceConfigW@44
 CheckTokenMembership@12
index f883f82..0f7997c 100644 (file)
@@ -77,6 +77,53 @@ HandleUnbind(VOID)
 #endif
 
 
+/**********************************************************************
+ *  ChangeServiceConfig2W
+ *
+ * @implemented
+ */
+BOOL WINAPI
+ChangeServiceConfig2W(SC_HANDLE hService,
+                      DWORD dwInfoLevel,
+                      LPVOID lpInfo)
+{
+    DWORD lpInfoSize;
+    DWORD dwError;
+
+    DPRINT("ChangeServiceConfig2W() called\n");
+
+    /* Determine the length of the lpInfo parameter */
+    switch (dwInfoLevel)
+    {
+        case SERVICE_CONFIG_DESCRIPTION:
+            lpInfoSize = sizeof(SERVICE_DESCRIPTION);
+        case SERVICE_CONFIG_FAILURE_ACTIONS:
+            lpInfoSize = sizeof(SERVICE_FAILURE_ACTIONS);
+        default:
+            DPRINT1("Unknown info level 0x%lx\n", dwInfoLevel);
+            SetLastError(ERROR_INVALID_PARAMETER);
+            return FALSE;
+    }
+
+    if (lpInfo == NULL)
+        return TRUE;
+
+    HandleBind();
+
+    dwError = ScmrChangeServiceConfig2W(BindingHandle,
+                                        (unsigned int)hService,
+                                        dwInfoLevel,
+                                        lpInfo,
+                                        lpInfoSize);
+    if (dwError != ERROR_SUCCESS)
+    {
+        DPRINT1("ScmrChangeServiceConfig2W() failed (Error %lu)\n", dwError);
+        SetLastError(dwError);
+        return FALSE;
+    }
+}
+
+
 /**********************************************************************
  *  ChangeServiceConfigA
  *
@@ -1553,7 +1600,7 @@ StartServiceW(
 #if 0
     DWORD dwError;
 
-    DPRINT("StartServiceW()\n", ScLock);
+    DPRINT("StartServiceW()\n");
 
     HandleBind();
 
index 58164ad..f982ab3 100644 (file)
@@ -2061,7 +2061,16 @@ ScmrGetServiceKeyNameA(handle_t BindingHandle,
 
 
 /* Function 37 */
-/* ScmrChangeServiceConfig2W */
+unsigned long
+ScmrChangeServiceConfig2W(handle_t BindingHandle,
+                          unsigned int hService,
+                          unsigned long dwInfoLevel,
+                          unsigned char *lpInfo,
+                          unsigned long dwInfoSize)
+{
+    DPRINT1("ScmrChangeServiceConfig2W() is unimplemented\n");
+    return ERROR_CALL_NOT_IMPLEMENTED;
+}
 
 
 /* Function 38 */