From 82997149528bf50c61d91feb0ab2b431214cd571 Mon Sep 17 00:00:00 2001 From: Andrey Turkin Date: Fri, 4 May 2007 10:46:36 +0400 Subject: [PATCH] shlwapi: Implement IUnknown_CPContainerInvokeParam. --- dlls/shlwapi/ordinal.c | 77 +++++++++++++++++++++++++++++++++++++++ dlls/shlwapi/shlwapi.spec | 2 +- 2 files changed, 78 insertions(+), 1 deletion(-) diff --git a/dlls/shlwapi/ordinal.c b/dlls/shlwapi/ordinal.c index f4804827d5..213980c086 100644 --- a/dlls/shlwapi/ordinal.c +++ b/dlls/shlwapi/ordinal.c @@ -2961,6 +2961,83 @@ HRESULT WINAPI IConnectionPoint_OnChanged(IConnectionPoint* lpCP, DISPID dispID) return hRet; } +/************************************************************************* + * @ [SHLWAPI.286] + * + * IUnknown_CPContainerInvokeParam + */ +HRESULT WINAPIV IUnknown_CPContainerInvokeParam( + IUnknown *container, + REFIID riid, + DISPID dispId, + VARIANTARG* buffer, + DWORD cParams, ...) +{ + HRESULT result; + IConnectionPoint *iCP; + IConnectionPointContainer *iCPC; + + if (!container) + return E_NOINTERFACE; + + result = IUnknown_QueryInterface(container, &IID_IConnectionPointContainer,(LPVOID*) &iCPC); + if (SUCCEEDED(result)) + { + result = IConnectionPointContainer_FindConnectionPoint(iCPC, riid, &iCP); + IConnectionPointContainer_Release(iCPC); + } + + if (SUCCEEDED(result)) + { + ULONG cnt; + VARIANTARG *curvar = buffer+cParams-1; + DISPPARAMS dispParams = {buffer, NULL, cParams, 0}; + va_list valist; + + va_start(valist, cParams); + for(cnt=cParams;cnt>0;cnt--,curvar--) /* backwards for some reason */ + { + enum VARENUM vt = va_arg(valist, enum VARENUM); + memset(curvar, 0, sizeof(*curvar)); + if (vt & VT_BYREF) + { + V_VT(curvar) = vt; + V_BYREF(curvar) = va_arg(valist, LPVOID); + } else + switch(vt) + { + case VT_BSTR: + V_VT(curvar) = vt; + V_BSTR(curvar) = va_arg(valist, BSTR); + break; + case VT_DISPATCH: + V_VT(curvar) = vt; + V_DISPATCH(curvar) = va_arg(valist, IDispatch*); + break; + case VT_BOOL: + V_VT(curvar) = vt; + V_BOOL(curvar) = va_arg(valist, int); + break; + case VT_UNKNOWN: + V_VT(curvar) = vt; + V_UNKNOWN(curvar) = va_arg(valist, IUnknown*); + break; + case VT_I4: + default: + V_VT(curvar) = VT_I4; + V_I4(curvar) = va_arg(valist, LONG); + break; + } + } + va_end(valist); + + result = SHLWAPI_InvokeByIID(iCP, riid, dispId, &dispParams); + IConnectionPoint_Release(iCP); + } + + return result; +} + /************************************************************************* * @ [SHLWAPI.287] * diff --git a/dlls/shlwapi/shlwapi.spec b/dlls/shlwapi/shlwapi.spec index cca778d172..ec7d259435 100644 --- a/dlls/shlwapi/shlwapi.spec +++ b/dlls/shlwapi/shlwapi.spec @@ -283,7 +283,7 @@ 283 stub -noname IConnectionPoint_InvokeWithCancel 284 stdcall -noname IConnectionPoint_SimpleInvoke(ptr long ptr) 285 stdcall -noname IConnectionPoint_OnChanged(ptr long) -286 stub -noname IUnknown_CPContainerInvokeParam +286 varargs -noname IUnknown_CPContainerInvokeParam(ptr ptr long ptr long) 287 stdcall -noname IUnknown_CPContainerOnChanged(ptr long) 288 stub -noname IUnknown_CPContainerInvokeIndirect 289 stdcall -noname PlaySoundWrapW(wstr long long) -- 2.32.0.93.g670b81a890