Commit ba0475e7 authored by Mike Hearn's avatar Mike Hearn Committed by Alexandre Julliard

Force context switch on chanbuf disconnect to avoid a race in the test

suite.
parent 7b3d092c
......@@ -302,6 +302,7 @@ PipeBuf_Release(LPRPCCHANNELBUFFER iface) {
wine_rpc_disconnect_header header;
HANDLE pipe;
DWORD reqtype = REQTYPE_DISCONNECT;
DWORD magic;
ref = InterlockedDecrement(&This->ref);
if (ref)
......@@ -316,6 +317,12 @@ PipeBuf_Release(LPRPCCHANNELBUFFER iface) {
TRACE("written disconnect packet\n");
/* prevent a disconnect race with the other side: this isn't
* necessary for real dcom but the test suite needs it */
read_pipe(pipe, &magic, sizeof(magic));
if (magic != 0xcafebabe) ERR("bad disconnection magic: expecting 0xcafebabe but got 0x%lx", magic);
HeapFree(GetProcessHeap(),0,This);
return 0;
}
......@@ -776,6 +783,7 @@ COM_RpcReceive(wine_pipe *xpipe) {
if (reqtype == REQTYPE_DISCONNECT) { /* only received by servers */
wine_rpc_disconnect_header header;
struct stub_manager *stubmgr;
DWORD magic = 0xcafebabe;
hres = read_pipe(xhPipe, &header, sizeof(header));
if (hres) {
......@@ -795,6 +803,8 @@ COM_RpcReceive(wine_pipe *xpipe) {
stub_manager_int_release(stubmgr);
write_pipe(xhPipe, &magic, sizeof(magic));
goto end;
} else if (reqtype == REQTYPE_REQUEST) {
wine_rpc_request *xreq;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment