SEH-Protect the call to RSetServiceStatus in SetServiceStatus. This keeps services...
authorEric Kohl <eric.kohl@reactos.org>
Mon, 8 Mar 2010 20:42:48 +0000 (20:42 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Mon, 8 Mar 2010 20:42:48 +0000 (20:42 +0000)
svn path=/trunk/; revision=46002

reactos/dll/win32/advapi32/service/sctrl.c

index 60516cd..ca6f164 100644 (file)
@@ -651,9 +651,18 @@ SetServiceStatus(SERVICE_STATUS_HANDLE hServiceStatus,
     TRACE("SetServiceStatus() called\n");
     TRACE("hServiceStatus %lu\n", hServiceStatus);
 
-    /* Call to services.exe using RPC */
-    dwError = RSetServiceStatus((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
-                                lpServiceStatus);
+    RpcTryExcept
+    {
+        /* Call to services.exe using RPC */
+        dwError = RSetServiceStatus((RPC_SERVICE_STATUS_HANDLE)hServiceStatus,
+                                    lpServiceStatus);
+    }
+    RpcExcept(EXCEPTION_EXECUTE_HANDLER)
+    {
+        dwError = ScmRpcStatusToWinError(RpcExceptionCode());
+    }
+    RpcEndExcept;
+
     if (dwError != ERROR_SUCCESS)
     {
         ERR("ScmrSetServiceStatus() failed (Error %lu)\n", dwError);