[RPCRT4] Sync with Wine 3.0. CORE-14225
authorAmine Khaldi <amine.khaldi@reactos.org>
Sat, 20 Jan 2018 12:13:03 +0000 (13:13 +0100)
committerAmine Khaldi <amine.khaldi@reactos.org>
Sat, 20 Jan 2018 12:13:03 +0000 (13:13 +0100)
dll/win32/rpcrt4/cstub.c
dll/win32/rpcrt4/ndr_stubless.c
dll/win32/rpcrt4/rpc_server.c
dll/win32/rpcrt4/rpc_transport.c
media/doc/README.WINE

index 6b1e47d..7c78f1c 100644 (file)
@@ -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,
index 0a16cae..f3e0399 100644 (file)
@@ -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)
                 {
index 2572269..57d64ff 100644 (file)
@@ -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)
index 6897db6..0a2c9a5 100644 (file)
@@ -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;
     }
index 4b6fadf..2f9a3b8 100644 (file)
@@ -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