Rob Shearman : rpcrt4: Only start the RpcSs process for handles to the local server.

Alexandre Julliard julliard at winehq.org
Mon Sep 8 07:41:13 CDT 2008


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

Author: Rob Shearman <robertshearman at gmail.com>
Date:   Fri Sep  5 22:09:11 2008 +0100

rpcrt4: Only start the RpcSs process for handles to the local server.

---

 dlls/rpcrt4/rpc_epmap.c |   17 +++++++++++++++--
 1 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/dlls/rpcrt4/rpc_epmap.c b/dlls/rpcrt4/rpc_epmap.c
index 6f77475..5776d22 100644
--- a/dlls/rpcrt4/rpc_epmap.c
+++ b/dlls/rpcrt4/rpc_epmap.c
@@ -114,6 +114,17 @@ static BOOL start_rpcss(void)
     return rslt;
 }
 
+static inline BOOL is_epm_destination_local(RPC_BINDING_HANDLE handle)
+{
+    RpcBinding *bind = (RpcBinding *)handle;
+    const char *protseq = bind->Protseq;
+    const char *network_addr = bind->NetworkAddr;
+
+    return ((!strcmp(protseq, "ncalrpc") && !network_addr) ||
+            (!strcmp(protseq, "ncacn_np") &&
+                (!network_addr || !strcmp(network_addr, "."))));
+}
+
 static RPC_STATUS get_epm_handle_client(RPC_BINDING_HANDLE handle, RPC_BINDING_HANDLE *epm_handle)
 {
     RpcBinding *bind = (RpcBinding *)handle;
@@ -243,7 +254,8 @@ RPC_STATUS WINAPI RpcEpRegisterA( RPC_IF_HANDLE IfSpec, RPC_BINDING_VECTOR *Bind
               status2 = GetExceptionCode();
           }
           __ENDTRY
-          if (status2 == RPC_S_SERVER_UNAVAILABLE)
+          if (status2 == RPC_S_SERVER_UNAVAILABLE &&
+              is_epm_destination_local(handle))
           {
               if (start_rpcss())
                   continue;
@@ -407,7 +419,8 @@ RPC_STATUS WINAPI RpcEpResolveBinding( RPC_BINDING_HANDLE Binding, RPC_IF_HANDLE
       status2 = GetExceptionCode();
     }
     __ENDTRY
-    if (status2 == RPC_S_SERVER_UNAVAILABLE)
+    if (status2 == RPC_S_SERVER_UNAVAILABLE &&
+        is_epm_destination_local(handle))
     {
       if (start_rpcss())
         continue;




More information about the wine-cvs mailing list