ole: Report and clean up after PostMessage failures.

This commit is contained in:
Robert Shearman 2006-01-10 20:08:22 +01:00 committed by Alexandre Julliard
parent a02cb3ebd6
commit d175f154ba
1 changed files with 13 additions and 3 deletions

View File

@ -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