[ADVAPI32]
authorEric Kohl <eric.kohl@reactos.org>
Thu, 15 Jun 2017 09:29:22 +0000 (09:29 +0000)
committerEric Kohl <eric.kohl@reactos.org>
Thu, 15 Jun 2017 09:29:22 +0000 (09:29 +0000)
OpenServiceA/W: Call SetLastError() in case of success too.

svn path=/trunk/; revision=75044

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

index 1449e4e..c122259 100644 (file)
@@ -1906,10 +1906,10 @@ OpenServiceA(SC_HANDLE hSCManager,
     }
     RpcEndExcept;
 
+    SetLastError(dwError);
     if (dwError != ERROR_SUCCESS)
     {
         TRACE("ROpenServiceA() failed (Error %lu)\n", dwError);
-        SetLastError(dwError);
         return NULL;
     }
 
@@ -1955,10 +1955,10 @@ OpenServiceW(SC_HANDLE hSCManager,
     }
     RpcEndExcept;
 
+    SetLastError(dwError);
     if (dwError != ERROR_SUCCESS)
     {
         TRACE("ROpenServiceW() failed (Error %lu)\n", dwError);
-        SetLastError(dwError);
         return NULL;
     }