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

ole: Add an accessor function for an apartment's window.

parent d175f154
......@@ -422,6 +422,12 @@ static LRESULT CALLBACK apartment_wndproc(HWND hWnd, UINT msg, WPARAM wParam, LP
}
}
HWND apartment_getwindow(struct apartment *apt)
{
assert(apt->model & COINIT_APARTMENTTHREADED);
return apt->win;
}
void apartment_joinmta(void)
{
apartment_addref(MTA);
......
......@@ -230,6 +230,7 @@ static inline HRESULT apartment_getoxid(struct apartment *apt, OXID *oxid)
*oxid = apt->oxid;
return S_OK;
}
HWND apartment_getwindow(struct apartment *apt);
void apartment_joinmta(void);
......
......@@ -254,7 +254,7 @@ static HRESULT WINAPI RpcChannelBuffer_SendReceive(LPRPCCHANNELBUFFER iface, RPC
TRACE("Calling apartment thread 0x%08lx...\n", apt->tid);
if (!PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params))
if (!PostMessageW(apartment_getwindow(apt), DM_EXECUTERPC, 0, (LPARAM)params))
{
ERR("PostMessage failed with error %ld\n", GetLastError());
hr = HRESULT_FROM_WIN32(GetLastError());
......@@ -509,7 +509,7 @@ static void __RPC_STUB dispatch_rpc(RPC_MESSAGE *msg)
TRACE("Calling apartment thread 0x%08lx...\n", apt->tid);
if (PostMessageW(apt->win, DM_EXECUTERPC, 0, (LPARAM)params))
if (PostMessageW(apartment_getwindow(apt), DM_EXECUTERPC, 0, (LPARAM)params))
WaitForSingleObject(params->handle, INFINITE);
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