Marshal return value from IRemUnknown_RemQueryInterface.
This commit is contained in:
parent
d8780c7546
commit
5d873adf9f
|
@ -551,12 +551,15 @@ static HRESULT WINAPI RemUnkStub_Invoke(LPRPCSTUBBUFFER iface,
|
||||||
hr = IRemUnknown_RemQueryInterface(This->iface, &ipid, cRefs, cIids, iids, &pQIResults);
|
hr = IRemUnknown_RemQueryInterface(This->iface, &ipid, cRefs, cIids, iids, &pQIResults);
|
||||||
|
|
||||||
/* out */
|
/* out */
|
||||||
pMsg->cbBuffer = cIids * sizeof(REMQIRESULT);
|
pMsg->cbBuffer = cIids * sizeof(REMQIRESULT) + sizeof(HRESULT);
|
||||||
|
|
||||||
I_RpcGetBuffer((RPC_MESSAGE *)pMsg);
|
I_RpcGetBuffer((RPC_MESSAGE *)pMsg);
|
||||||
if (hr) return hr;
|
|
||||||
|
|
||||||
buf = pMsg->Buffer;
|
buf = pMsg->Buffer;
|
||||||
|
*(HRESULT *)buf = hr;
|
||||||
|
buf += sizeof(HRESULT);
|
||||||
|
|
||||||
|
if (hr) return hr;
|
||||||
/* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */
|
/* FIXME: pQIResults is a unique pointer so pQIResults can be NULL! */
|
||||||
memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT));
|
memcpy(buf, pQIResults, cIids * sizeof(REMQIRESULT));
|
||||||
|
|
||||||
|
@ -750,8 +753,14 @@ static HRESULT WINAPI RemUnkProxy_RemQueryInterface(LPREMUNKNOWN iface,
|
||||||
|
|
||||||
hr = IRpcChannelBuffer_SendReceive(This->chan, &msg, &status);
|
hr = IRpcChannelBuffer_SendReceive(This->chan, &msg, &status);
|
||||||
|
|
||||||
|
buf = msg.Buffer;
|
||||||
|
|
||||||
|
if (SUCCEEDED(hr)) {
|
||||||
|
hr = *(HRESULT *)buf;
|
||||||
|
buf += sizeof(HRESULT);
|
||||||
|
}
|
||||||
|
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
buf = msg.Buffer;
|
|
||||||
*ppQIResults = CoTaskMemAlloc(cIids*sizeof(REMQIRESULT));
|
*ppQIResults = CoTaskMemAlloc(cIids*sizeof(REMQIRESULT));
|
||||||
memcpy(*ppQIResults, buf, cIids*sizeof(REMQIRESULT));
|
memcpy(*ppQIResults, buf, cIids*sizeof(REMQIRESULT));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue