From 8f6437a0a05d4001b684309a40274f99b0cf5a93 Mon Sep 17 00:00:00 2001 From: =?utf8?q?G=C3=A9=20van=20Geldorp?= Date: Fri, 6 Jan 2006 20:24:26 +0000 Subject: [PATCH] Sync to Wine-0_9_5: Robert Shearman - rpcrt4: Fix race condition in RpcServerListen. The DontWait parameter is used for forcing the function not to wait for the server to finish. - rpcrt4: Implement callback conformance. svn path=/trunk/; revision=20624 --- reactos/lib/rpcrt4/ndr_marshall.c | 10 +++++++++- reactos/lib/rpcrt4/rpc_server.c | 5 +++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/reactos/lib/rpcrt4/ndr_marshall.c b/reactos/lib/rpcrt4/ndr_marshall.c index 42b72e3b77a..4156a0e3421 100644 --- a/reactos/lib/rpcrt4/ndr_marshall.c +++ b/reactos/lib/rpcrt4/ndr_marshall.c @@ -375,9 +375,17 @@ PFORMAT_STRING ComputeConformanceOrVariance( ptr = *(LPVOID*)ptr; break; case RPC_FC_CALLBACK: + { + unsigned char *old_stack_top = pStubMsg->StackTop; + pStubMsg->StackTop = ptr; + /* ofs is index into StubDesc->apfnExprEval */ - FIXME("handle callback\n"); + TRACE("callback conformance into apfnExprEval[%d]\n", ofs); + pStubMsg->StubDesc->apfnExprEval[ofs](pStubMsg); + + pStubMsg->StackTop = old_stack_top; goto finish_conf; + } default: break; } diff --git a/reactos/lib/rpcrt4/rpc_server.c b/reactos/lib/rpcrt4/rpc_server.c index d2200718463..df83b65d548 100644 --- a/reactos/lib/rpcrt4/rpc_server.c +++ b/reactos/lib/rpcrt4/rpc_server.c @@ -989,6 +989,9 @@ RPC_STATUS WINAPI RpcServerListen( UINT MinimumCallThreads, UINT MaxCalls, UINT status = RPCRT4_start_listen(FALSE); + if (status == RPC_S_OK) + RPCRT4_sync_with_server_thread(); + if (DontWait || (status != RPC_S_OK)) return status; return RpcMgmtWaitServerListen(); @@ -1010,8 +1013,6 @@ RPC_STATUS WINAPI RpcMgmtWaitServerListen( void ) LeaveCriticalSection(&listen_cs); - RPCRT4_sync_with_server_thread(); - return RPC_S_OK; } -- 2.17.1