Commit afb1a08b authored by Huw Davies's avatar Huw Davies Committed by Alexandre Julliard

dispex: Use the upper WORD of the flags parameter to indicate whether the…

dispex: Use the upper WORD of the flags parameter to indicate whether the optional [out] parameters are NULL.
parent 594de90c
......@@ -244,9 +244,7 @@ static HRESULT WINAPI dispex_InvokeEx(IDispatchEx* iface,
if(id == 1)
{
ok(pdp->cArgs == 0, "got %d\n", pdp->cArgs);
todo_wine
ok(pei == NULL, "got non-NULL excepinfo\n");
todo_wine
ok(pvarRes == NULL, "got non-NULL result\n");
}
else if(id == 2)
......@@ -266,7 +264,6 @@ todo_wine
}
else if(id == 4)
{
todo_wine
ok(wFlags == 0xf, "got %04x\n", wFlags);
}
return S_OK;
......
......@@ -37,6 +37,9 @@
WINE_DEFAULT_DEBUG_CHANNEL(ole);
#define NULL_RESULT 0x20000
#define NULL_EXCEPINFO 0x40000
HRESULT CALLBACK IDispatchEx_InvokeEx_Proxy(IDispatchEx* This, DISPID id, LCID lcid, WORD wFlags,
DISPPARAMS *pdp, VARIANT *pvarRes, EXCEPINFO *pei,
IServiceProvider *pspCaller)
......@@ -47,12 +50,22 @@ HRESULT CALLBACK IDispatchEx_InvokeEx_Proxy(IDispatchEx* This, DISPID id, LCID l
UINT byref_args, arg;
VARIANT dummy_arg, *ref_arg = &dummy_arg, *copy_arg, *orig_arg = NULL;
UINT *ref_idx = NULL;
DWORD dword_flags = wFlags & 0xf;
TRACE("(%p)->(%08x, %04x, %04x, %p, %p, %p, %p)\n", This, id, lcid, wFlags,
pdp, pvarRes, pei, pspCaller);
if(!pvarRes) pvarRes = &result;
if(!pei) pei = &excep_info;
if(!pvarRes)
{
pvarRes = &result;
dword_flags |= NULL_RESULT;
}
if(!pei)
{
pei = &excep_info;
dword_flags |= NULL_EXCEPINFO;
}
for(arg = 0, byref_args = 0; arg < pdp->cArgs; arg++)
if(V_ISBYREF(pdp->rgvarg + arg)) byref_args++;
......@@ -86,7 +99,7 @@ HRESULT CALLBACK IDispatchEx_InvokeEx_Proxy(IDispatchEx* This, DISPID id, LCID l
pdp->rgvarg = copy_arg;
}
hr = IDispatchEx_RemoteInvokeEx_Proxy(This, id, lcid, wFlags, pdp, pvarRes, pei, pspCaller,
hr = IDispatchEx_RemoteInvokeEx_Proxy(This, id, lcid, dword_flags, pdp, pvarRes, pei, pspCaller,
byref_args, ref_idx, ref_arg);
if(byref_args)
......@@ -95,14 +108,6 @@ HRESULT CALLBACK IDispatchEx_InvokeEx_Proxy(IDispatchEx* This, DISPID id, LCID l
pdp->rgvarg = orig_arg;
}
if(pvarRes == &result) VariantClear(pvarRes);
if(pei == &excep_info)
{
SysFreeString(pei->bstrSource);
SysFreeString(pei->bstrDescription);
SysFreeString(pei->bstrHelpFile);
}
return hr;
}
......@@ -123,7 +128,10 @@ HRESULT __RPC_STUB IDispatchEx_InvokeEx_Stub(IDispatchEx* This, DISPID id, LCID
for(arg = 0; arg < byref_args; arg++)
pdp->rgvarg[ref_idx[arg]] = ref_arg[arg];
hr = IDispatchEx_InvokeEx(This, id, lcid, dwFlags, pdp, result, pei, pspCaller);
if(dwFlags & NULL_RESULT) result = NULL;
if(dwFlags & NULL_EXCEPINFO) pei = NULL;
hr = IDispatchEx_InvokeEx(This, id, lcid, dwFlags & 0xffff, pdp, result, pei, pspCaller);
for(arg = 0; arg < byref_args; 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