Commit 56e625b0 authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

dispex: Call the deferred fill in function before returning from the server.

parent ce31f2da
...@@ -232,6 +232,12 @@ static HRESULT WINAPI dispex_GetDispID(IDispatchEx* iface, ...@@ -232,6 +232,12 @@ static HRESULT WINAPI dispex_GetDispID(IDispatchEx* iface,
return E_NOTIMPL; return E_NOTIMPL;
} }
static HRESULT WINAPI defer_fn(EXCEPINFO *except)
{
except->scode = E_OUTOFMEMORY;
return S_OK;
}
static HRESULT WINAPI dispex_InvokeEx(IDispatchEx* iface, static HRESULT WINAPI dispex_InvokeEx(IDispatchEx* iface,
DISPID id, DISPID id,
LCID lcid, LCID lcid,
...@@ -266,6 +272,11 @@ static HRESULT WINAPI dispex_InvokeEx(IDispatchEx* iface, ...@@ -266,6 +272,11 @@ static HRESULT WINAPI dispex_InvokeEx(IDispatchEx* iface,
{ {
ok(wFlags == 0xf, "got %04x\n", wFlags); ok(wFlags == 0xf, "got %04x\n", wFlags);
} }
else if(id == 5)
{
if(pei) pei->pfnDeferredFillIn = defer_fn;
return DISP_E_EXCEPTION;
}
return S_OK; return S_OK;
} }
...@@ -354,6 +365,7 @@ static void test_dispex(void) ...@@ -354,6 +365,7 @@ static void test_dispex(void)
DISPPARAMS params; DISPPARAMS params;
VARIANTARG args[10]; VARIANTARG args[10];
INT i; INT i;
EXCEPINFO excepinfo;
hr = CreateStreamOnHGlobal(NULL, TRUE, &stream); hr = CreateStreamOnHGlobal(NULL, TRUE, &stream);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
...@@ -399,6 +411,14 @@ todo_wine ...@@ -399,6 +411,14 @@ todo_wine
hr = IDispatchEx_InvokeEx(dispex, 4, LOCALE_SYSTEM_DEFAULT, 0xffff, &params, NULL, NULL, NULL); hr = IDispatchEx_InvokeEx(dispex, 4, LOCALE_SYSTEM_DEFAULT, 0xffff, &params, NULL, NULL, NULL);
ok(hr == S_OK, "got %08x\n", hr); ok(hr == S_OK, "got %08x\n", hr);
params.cArgs = 0;
hr = IDispatchEx_InvokeEx(dispex, 5, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &params, NULL, NULL, NULL);
ok(hr == DISP_E_EXCEPTION, "got %08x\n", hr);
hr = IDispatchEx_InvokeEx(dispex, 5, LOCALE_SYSTEM_DEFAULT, DISPATCH_METHOD, &params, NULL, &excepinfo, NULL);
ok(hr == DISP_E_EXCEPTION, "got %08x\n", hr);
ok(excepinfo.scode == E_OUTOFMEMORY, "got scode %08x\n", excepinfo.scode);
ok(excepinfo.pfnDeferredFillIn == NULL, "got non-NULL pfnDeferredFillIn\n");
IDispatchEx_Release(dispex); IDispatchEx_Release(dispex);
end_host_object(tid, thread); end_host_object(tid, thread);
} }
......
...@@ -133,6 +133,15 @@ HRESULT __RPC_STUB IDispatchEx_InvokeEx_Stub(IDispatchEx* This, DISPID id, LCID ...@@ -133,6 +133,15 @@ HRESULT __RPC_STUB IDispatchEx_InvokeEx_Stub(IDispatchEx* This, DISPID id, LCID
hr = IDispatchEx_InvokeEx(This, id, lcid, dwFlags & 0xffff, pdp, result, pei, pspCaller); hr = IDispatchEx_InvokeEx(This, id, lcid, dwFlags & 0xffff, pdp, result, pei, pspCaller);
if(hr == DISP_E_EXCEPTION)
{
if(pei && pei->pfnDeferredFillIn)
{
pei->pfnDeferredFillIn(pei);
pei->pfnDeferredFillIn = NULL;
}
}
for(arg = 0; arg < byref_args; arg++) for(arg = 0; arg < byref_args; arg++)
VariantInit(pdp->rgvarg + ref_idx[arg]); VariantInit(pdp->rgvarg + ref_idx[arg]);
......
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