Created the named pipes with the FILE_FLAG_OVERLAPPED flag, otherwise
the call to ConnectNamedPipe() will block the server thread if no
connection can be established, which causes the rpc server to dead-lock
during startup.

- Thomas


-- 
P.S.: Please let me know if there's something wrong with this patch or
tell me why it was rejected. Otherwise I'm going to assume the fixes
aren't appreciated or necessary because the implementation is considered
mature and stable.
Index: dlls/rpcrt4/rpc_binding.c
===================================================================
RCS file: /home/wine/wine/dlls/rpcrt4/rpc_binding.c,v
retrieving revision 1.39
diff -u -r1.39 rpc_binding.c
--- dlls/rpcrt4/rpc_binding.c   6 Sep 2005 10:26:14 -0000       1.39
+++ dlls/rpcrt4/rpc_binding.c   16 Jan 2006 23:00:15 -0000
@@ -142,7 +142,7 @@
         pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + 
strlen(Connection->Endpoint) + 1);
         strcat(strcpy(pname, prefix), Connection->Endpoint);
         TRACE("listening on %s\n", pname);
-        Connection->conn = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX,
+        Connection->conn = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX | 
FILE_FLAG_OVERLAPPED,
                                          PIPE_TYPE_MESSAGE | 
PIPE_READMODE_MESSAGE, PIPE_UNLIMITED_INSTANCES,
                                          RPC_MAX_PACKET_SIZE, 
RPC_MAX_PACKET_SIZE, 5000, NULL);
         HeapFree(GetProcessHeap(), 0, pname);
@@ -166,7 +166,7 @@
         pname = HeapAlloc(GetProcessHeap(), 0, strlen(prefix) + 
strlen(Connection->Endpoint) + 1);
         strcat(strcpy(pname, prefix), Connection->Endpoint);
         TRACE("listening on %s\n", pname);
-        Connection->conn = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX,
+        Connection->conn = CreateNamedPipeA(pname, PIPE_ACCESS_DUPLEX | 
FILE_FLAG_OVERLAPPED,
                                          PIPE_TYPE_MESSAGE | 
PIPE_READMODE_MESSAGE | PIPE_WAIT, PIPE_UNLIMITED_INSTANCES,
                                          RPC_MAX_PACKET_SIZE, 
RPC_MAX_PACKET_SIZE, 5000, NULL);
         HeapFree(GetProcessHeap(), 0, pname);



Reply via email to