https://git.reactos.org/?p=reactos.git;a=commitdiff;h=90155f749fa92205620c9aed5d27b8c9f0743f45

commit 90155f749fa92205620c9aed5d27b8c9f0743f45
Author:     Amine Khaldi <[email protected]>
AuthorDate: Sat Jan 20 13:13:03 2018 +0100
Commit:     Amine Khaldi <[email protected]>
CommitDate: Sat Jan 20 13:13:03 2018 +0100

    [RPCRT4] Sync with Wine 3.0. CORE-14225
---
 dll/win32/rpcrt4/cstub.c         |  2 +-
 dll/win32/rpcrt4/ndr_stubless.c  | 17 ++++++++---------
 dll/win32/rpcrt4/rpc_server.c    |  2 --
 dll/win32/rpcrt4/rpc_transport.c |  4 ++++
 media/doc/README.WINE            |  2 +-
 5 files changed, 14 insertions(+), 13 deletions(-)

diff --git a/dll/win32/rpcrt4/cstub.c b/dll/win32/rpcrt4/cstub.c
index 6b1e47d02f..7c78f1c82e 100644
--- a/dll/win32/rpcrt4/cstub.c
+++ b/dll/win32/rpcrt4/cstub.c
@@ -41,7 +41,7 @@ typedef struct
 
 static inline cstdstubbuffer_delegating_t *impl_from_delegating( 
IRpcStubBuffer *iface )
 {
-    return CONTAINING_RECORD((void *)iface, cstdstubbuffer_delegating_t, 
stub_buffer);
+    return CONTAINING_RECORD(iface, cstdstubbuffer_delegating_t, stub_buffer);
 }
 
 HRESULT CStdStubBuffer_Construct(REFIID riid,
diff --git a/dll/win32/rpcrt4/ndr_stubless.c b/dll/win32/rpcrt4/ndr_stubless.c
index 0a16cae8e2..f3e0399ef3 100644
--- a/dll/win32/rpcrt4/ndr_stubless.c
+++ b/dll/win32/rpcrt4/ndr_stubless.c
@@ -1116,6 +1116,11 @@ LONG_PTR __cdecl call_server_func(SERVER_ROUTINE func, 
unsigned char * args, uns
 }
 #endif
 
+static inline BOOL param_needs_alloc( PARAM_ATTRIBUTES attr )
+{
+    return attr.IsOut && !attr.IsIn && !attr.IsBasetype && !attr.IsByValue;
+}
+
 static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE *pStubMsg,
                               PFORMAT_STRING pFormat, enum stubless_phase 
phase,
                               unsigned short number_of_params)
@@ -1151,20 +1156,14 @@ static LONG_PTR *stub_do_args(MIDL_STUB_MESSAGE 
*pStubMsg,
             {
                 HeapFree(GetProcessHeap(), 0, *(void **)pArg);
             }
-            else if (params[i].attr.IsOut &&
-                     !params[i].attr.IsIn &&
-                     !params[i].attr.IsBasetype &&
-                     !params[i].attr.IsByValue)
+            else if (param_needs_alloc(params[i].attr) &&
+                     (!params[i].attr.MustFree || params[i].attr.IsSimpleRef))
             {
                 if (*pTypeFormat != RPC_FC_BIND_CONTEXT) 
pStubMsg->pfnFree(*(void **)pArg);
             }
             break;
         case STUBLESS_INITOUT:
-            if (!params[i].attr.IsIn &&
-                params[i].attr.IsOut &&
-                !params[i].attr.IsBasetype &&
-                !params[i].attr.ServerAllocSize &&
-                !params[i].attr.IsByValue)
+            if (param_needs_alloc(params[i].attr) && 
!params[i].attr.ServerAllocSize)
             {
                 if (*pTypeFormat == RPC_FC_BIND_CONTEXT)
                 {
diff --git a/dll/win32/rpcrt4/rpc_server.c b/dll/win32/rpcrt4/rpc_server.c
index 25722691dd..57d64ff0fc 100644
--- a/dll/win32/rpcrt4/rpc_server.c
+++ b/dll/win32/rpcrt4/rpc_server.c
@@ -784,10 +784,8 @@ static RPC_STATUS RPCRT4_stop_listen(BOOL auto_listen)
 
   if (stop_listen) {
     RpcServerProtseq *cps;
-    EnterCriticalSection(&server_cs);
     LIST_FOR_EACH_ENTRY(cps, &protseqs, RpcServerProtseq, entry)
       RPCRT4_sync_with_server_thread(cps);
-    LeaveCriticalSection(&server_cs);
   }
 
   if (!auto_listen)
diff --git a/dll/win32/rpcrt4/rpc_transport.c b/dll/win32/rpcrt4/rpc_transport.c
index 6897db6241..0a2c9a5fb0 100644
--- a/dll/win32/rpcrt4/rpc_transport.c
+++ b/dll/win32/rpcrt4/rpc_transport.c
@@ -151,6 +151,10 @@ static RPC_STATUS rpcrt4_conn_open_pipe(RpcConnection 
*Connection, LPCSTR pname,
     if (pipe != INVALID_HANDLE_VALUE) break;
     err = GetLastError();
     if (err == ERROR_PIPE_BUSY) {
+      if (WaitNamedPipeA(pname, NMPWAIT_USE_DEFAULT_WAIT)) {
+        TRACE("retrying busy server\n");
+        continue;
+      }
       TRACE("connection failed, error=%x\n", err);
       return RPC_S_SERVER_TOO_BUSY;
     }
diff --git a/media/doc/README.WINE b/media/doc/README.WINE
index 4b6fadfe70..2f9a3b8ed4 100644
--- a/media/doc/README.WINE
+++ b/media/doc/README.WINE
@@ -160,7 +160,7 @@ reactos/dll/win32/rasapi32            # Synced to 
WineStaging-2.9
 reactos/dll/win32/resutils            # Synced to WineStaging-2.9
 reactos/dll/win32/riched20            # Synced to Wine-3.0
 reactos/dll/win32/riched32            # Synced to WineStaging-2.9
-reactos/dll/win32/rpcrt4              # Synced to WineStaging-2.16
+reactos/dll/win32/rpcrt4              # Synced to Wine-3.0
 reactos/dll/win32/rsabase             # Synced to WineStaging-2.9
 reactos/dll/win32/rsaenh              # Synced to WineStaging-2.9
 reactos/dll/win32/sccbase             # Synced to WineStaging-2.9

Reply via email to