[ADVAPI32]
authorEric Kohl <eric.kohl@reactos.org>
Thu, 15 Jun 2017 23:19:34 +0000 (23:19 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Thu, 15 Jun 2017 23:19:34 +0000 (23:19 +0000)
ScmRpcStatusToWinError: Convert STATUS_ACCESS_VIOLATION to ERROR_INVALID_HANDLE.
UnlockServiceDatabase returns ERROR_INVALID_SERVICE_LOCK instead of ERROR_INVALID_HANDLE.

svn path=/trunk/; revision=75053

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

index c5e0db8..0274a99 100644 (file)
@@ -133,6 +133,7 @@ ScmRpcStatusToWinError(RPC_STATUS Status)
 {
     switch (Status)
     {
+        case STATUS_ACCESS_VIOLATION:
         case RPC_S_INVALID_BINDING:
         case RPC_X_SS_IN_NULL_CONTEXT:
             return ERROR_INVALID_HANDLE;
@@ -2798,6 +2799,9 @@ UnlockServiceDatabase(SC_LOCK ScLock)
     }
     RpcEndExcept;
 
+    if (dwError == ERROR_INVALID_HANDLE)
+        dwError = ERROR_INVALID_SERVICE_LOCK;
+
     if (dwError != ERROR_SUCCESS)
     {
         TRACE("RUnlockServiceDatabase() failed (Error %lu)\n", dwError);