Tim Schwartz : advapi32: service_control_dispatcher(): Fixed invalid pipe test to display GetLastError() before it gets overwritten.

Alexandre Julliard julliard at winehq.org
Wed Dec 5 06:56:58 CST 2007


Module: wine
Branch: master
Commit: 65d2f8a68d7db59c4878e9f05897a1b7554d9d58
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=65d2f8a68d7db59c4878e9f05897a1b7554d9d58

Author: Tim Schwartz <tim at sanityinternet.com>
Date:   Mon Dec  3 09:44:37 2007 -0600

advapi32: service_control_dispatcher(): Fixed invalid pipe test to display GetLastError() before it gets overwritten.

---

 dlls/advapi32/service.c |   12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/dlls/advapi32/service.c b/dlls/advapi32/service.c
index 3acab45..302d649 100644
--- a/dlls/advapi32/service.c
+++ b/dlls/advapi32/service.c
@@ -686,6 +686,11 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
     name = service_get_pipe_name(service->name);
     pipe = CreateNamedPipeW(name, PIPE_ACCESS_DUPLEX,
                   PIPE_TYPE_BYTE|PIPE_WAIT, 1, 256, 256, 10000, NULL );
+
+    if (pipe==INVALID_HANDLE_VALUE)
+        ERR("failed to create pipe for %s, error = %d\n",
+            debugstr_w(service->name), GetLastError());
+
     HeapFree(GetProcessHeap(), 0, name);
 
     /* let the process who started us know we've tried to create a pipe */
@@ -693,12 +698,7 @@ static DWORD WINAPI service_control_dispatcher(LPVOID arg)
     SetEvent(event);
     CloseHandle(event);
 
-    if (pipe==INVALID_HANDLE_VALUE)
-    {
-        ERR("failed to create pipe for %s, error = %d\n",
-            debugstr_w(service->name), GetLastError());
-        return 0;
-    }
+    if (pipe==INVALID_HANDLE_VALUE) return 0;
 
     /* dispatcher loop */
     while (1)




More information about the wine-cvs mailing list