Sync to Wine-0_9_5:
authorGé van Geldorp <ge@gse.nl>
Fri, 6 Jan 2006 20:24:26 +0000 (20:24 +0000)
committerGé van Geldorp <ge@gse.nl>
Fri, 6 Jan 2006 20:24:26 +0000 (20:24 +0000)
Robert Shearman <rob@codeweavers.com>
- 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
reactos/lib/rpcrt4/rpc_server.c

index 42b72e3..4156a0e 100644 (file)
@@ -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;
   }
index d220071..df83b65 100644 (file)
@@ -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;
 }