Commit 3018974c authored by Robert Shearman's avatar Robert Shearman Committed by Alexandre Julliard

- Make proxy manager use IMultiQI instead of IInternalUnknown as tests

show that IInternalUnknown isn't exposed. - Implement IMultiQI on top of IRemUnknown calls. - Silence some fixmes that occur during tests and don't give us any useful information. - Fix typo in class factory proxy that caused us to use the wrong offset into the CFProxy structure, causing us to not call the outer_unknown properly.
parent b6317bd5
......@@ -100,7 +100,7 @@ struct ifproxy
/* imported object / proxy manager */
struct proxy_manager
{
const IInternalUnknownVtbl *lpVtbl;
const IMultiQIVtbl *lpVtbl;
struct apartment *parent; /* owning apartment (RO) */
struct list entry; /* entry in apartment (CS parent->cs) */
LPRPCCHANNELBUFFER chan; /* channel to object (CS cs) */
......
......@@ -319,7 +319,7 @@ static void WINAPI IRpcProxyBufferImpl_Disconnect(LPRPCPROXYBUFFER iface) {
static HRESULT WINAPI
CFProxy_QueryInterface(LPCLASSFACTORY iface,REFIID riid, LPVOID *ppv) {
ICOM_THIS_MULTI(CFProxy,lpvtbl_proxy,iface);
ICOM_THIS_MULTI(CFProxy,lpvtbl_cf,iface);
if (This->outer_unknown) return IUnknown_QueryInterface(This->outer_unknown, riid, ppv);
*ppv = NULL;
if (IsEqualIID(&IID_IClassFactory,riid) || IsEqualIID(&IID_IUnknown,riid)) {
......
......@@ -129,6 +129,11 @@ read_pipe(HANDLE hf, LPVOID ptr, DWORD size) {
return E_FAIL;
}
if (res!=size) {
if (!res)
{
WARN("%p disconnected\n", hf);
return RPC_E_DISCONNECTED;
}
FIXME("Read only %ld of %ld bytes from %p.\n",res,size,hf);
return E_FAIL;
}
......@@ -310,10 +315,8 @@ COM_InvokeAndRpcSend(struct rpc *req) {
DWORD reqtype;
if (!(stub = ipid_to_stubbuffer(&(req->reqh.ipid))))
{
ERR("Stub not found?\n");
return E_FAIL;
}
/* ipid_to_stubbuffer will already have logged the error */
return RPC_E_DISCONNECTED;
IUnknown_AddRef(stub);
msg.Buffer = req->Buffer;
......@@ -417,8 +420,9 @@ PipeBuf_SendReceive(LPRPCCHANNELBUFFER iface,RPCOLEMESSAGE* msg,ULONG *status)
static HRESULT WINAPI
PipeBuf_FreeBuffer(LPRPCCHANNELBUFFER iface,RPCOLEMESSAGE* msg)
{
FIXME("(%p), stub!\n",msg);
return E_FAIL;
TRACE("(%p)\n",msg);
HeapFree(GetProcessHeap(), 0, msg->Buffer);
return S_OK;
}
static HRESULT WINAPI
......
......@@ -539,6 +539,7 @@ static HRESULT WINAPI RemUnknown_RemQueryInterface(IRemUnknown *iface,
{
HRESULT hr;
USHORT i;
USHORT successful_qis = 0;
APARTMENT *apt;
struct stub_manager *stubmgr;
......@@ -551,15 +552,22 @@ static HRESULT WINAPI RemUnknown_RemQueryInterface(IRemUnknown *iface,
for (i = 0; i < cIids; i++)
{
(*ppQIResults)[i].hResult = register_ifstub(apt, &(*ppQIResults)[i].std,
&iids[i], stubmgr->object,
MSHLFLAGS_NORMAL);
HRESULT hrobj = register_ifstub(apt, &(*ppQIResults)[i].std, &iids[i],
stubmgr->object, MSHLFLAGS_NORMAL);
if (hrobj == S_OK)
successful_qis++;
(*ppQIResults)[i].hResult = hrobj;
}
stub_manager_int_release(stubmgr);
COM_ApartmentRelease(apt);
return hr;
if (successful_qis == cIids)
return S_OK; /* we got all requested interfaces */
else if (successful_qis == 0)
return E_NOINTERFACE; /* we didn't get any interfaces */
else
return S_FALSE; /* we got some interfaces */
}
static HRESULT WINAPI RemUnknown_RemAddRef(IRemUnknown *iface,
......
......@@ -876,7 +876,7 @@ static void test_proxy_interfaces()
if (hr == S_OK) IUnknown_Release(pOtherUnknown);
hr = IUnknown_QueryInterface(pProxy, &IID_IMultiQI, (LPVOID*)&pOtherUnknown);
todo_wine { ok_ole_success(hr, IUnknown_QueryInterface IID_IMultiQI); }
ok_ole_success(hr, IUnknown_QueryInterface IID_IMultiQI);
if (hr == S_OK) IUnknown_Release(pOtherUnknown);
hr = IUnknown_QueryInterface(pProxy, &IID_IMarshal, (LPVOID*)&pOtherUnknown);
......
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