From 5d873adf9f2ed5f9ea5b40668909a25ca2e71942 Mon Sep 17 00:00:00 2001 From: Robert Shearman Date: Tue, 19 Jul 2005 19:43:05 +0000 Subject: [PATCH] Marshal return value from IRemUnknown_RemQueryInterface. --- dlls/ole32/oleproxy.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/dlls/ole32/oleproxy.c b/dlls/ole32/oleproxy.c index ba15a75f9ab..8bf83bbf594 100644 --- a/dlls/ole32/oleproxy.c +++ b/dlls/ole32/oleproxy.c @@ -551,12 +551,15 @@ static HRESULT WINAPI RemUnkStub_Invoke(LPRPCSTUBBUFFER iface, hr = IRemUnknown_RemQueryInterface(This->iface, &ipid, cRefs, cIids, iids, &pQIResults); /* out */ - pMsg->cbBuffer = cIids * sizeof(REMQIRESULT); + pMsg->cbBuffer = cIids * sizeof(REMQIRESULT) + sizeof(HRESULT); I_RpcGetBuffer((RPC_MESSAGE *)pMsg); - if (hr) return hr; buf = pMsg->Buffer; + *(HRESULT *)buf = hr; + buf += sizeof(HRESULT); + + if (hr) return hr; /* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */ memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT)); @@ -750,8 +753,14 @@ static HRESULT WINAPI RemUnkProxy_RemQueryInterface(LPREMUNKNOWN iface, hr = IRpcChannelBuffer_SendReceive(This->chan, &msg, &status); + buf = msg.Buffer; + + if (SUCCEEDED(hr)) { + hr = *(HRESULT *)buf; + buf += sizeof(HRESULT); + } + if (SUCCEEDED(hr)) { - buf = msg.Buffer; *ppQIResults = CoTaskMemAlloc(cIids*sizeof(REMQIRESULT)); memcpy(*ppQIResults, buf, cIids*sizeof(REMQIRESULT)); }