Commit d175f154 authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

ole: Report and clean up after PostMessage failures.

parent a02cb3eb
......@@ -254,7 +254,11 @@ static HRESULT WINAPI RpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER iface, RPC
TRACE("Calling apartment thread 0x%08lx...\n", apt->tid);
PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params);
if (!PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params))
{
ERR("PostMessage failed with error %ld\n", GetLastError());
hr = HRESULT_FROM_WIN32(GetLastError());
}
}
else
{
......@@ -505,8 +509,14 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg)
TRACE("Calling apartment thread 0x%08lx...\n", apt->tid);
PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params);
WaitForSingleObject(params->handle, INFINITE);
if (PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params))
WaitForSingleObject(params->handle, INFINITE);
else
{
ERR("PostMessage failed with error %ld\n", GetLastError());
IRpcChannelBuffer_Release(params->chan);
IRpcStubBuffer_Release(params->stub);
}
CloseHandle(params->handle);
}
else
......
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