Commit 1bd4bbb5 authored by Marcus Meissner's avatar Marcus Meissner Committed by Alexandre Julliard

Draft implementation of DispCallFunc.

parent ac36f950
......@@ -142,7 +142,7 @@
142 stdcall VarAnd(ptr ptr ptr) VarAnd
143 stub VarDiv # stdcall (ptr ptr ptr)
144 stub OACreateTypeLib2
146 stub DispCallFunc
146 stdcall DispCallFunc(ptr long long long long ptr ptr ptr) DispCallFunc
147 stdcall VariantChangeTypeEx(ptr ptr long long long) VariantChangeTypeEx
148 stdcall SafeArrayPtrOfIndex(ptr ptr ptr) SafeArrayPtrOfIndex
149 stdcall SysStringByteLen(ptr) SysStringByteLen
......
......@@ -4192,6 +4192,52 @@ _invoke(LPVOID func,CALLCONV callconv, int nrargs, DWORD *args) {
extern int const _argsize(DWORD vt);
HRESULT WINAPI
DispCallFunc(
void* pvInstance, ULONG oVft, CALLCONV cc, VARTYPE vtReturn, UINT cActuals,
VARTYPE* prgvt, VARIANTARG** prgpvarg, VARIANT* pvargResult
) {
int i, argsize, argspos;
DWORD *args;
HRESULT hres;
FIXME("(%p, %ld, %d, %d, %d, %p, %p, %p)\n",
pvInstance, oVft, cc, vtReturn, cActuals, prgvt, prgpvarg, pvargResult
);
argsize = 0;
for (i=0;i<cActuals;i++) {
FIXME("arg %d: type %d\n",i,prgvt[i]);
dump_Variant(prgpvarg[i]);
argsize += _argsize(prgvt[i]);
}
args = (DWORD*)HeapAlloc(GetProcessHeap(),0,sizeof(DWORD)*argsize);
argspos = 0;
for (i=0;i<cActuals;i++) {
int arglen;
VARIANT *arg = prgpvarg[i];
arglen = _argsize(prgvt[i]);
if (V_VT(arg) == prgvt[i]) {
memcpy(&args[argspos],&V_UNION(arg,lVal), arglen*sizeof(DWORD));
} else {
if (prgvt[i] == VT_VARIANT) {
memcpy(&args[argspos],arg, arglen*sizeof(DWORD));
} else {
ERR("Set arg %d to disparg type %d vs %d\n",i,
V_VT(arg),prgvt[i]
);
}
}
argspos += arglen;
}
FIXME("Do not know how to handle pvargResult %p. Expect crash ...\n",pvargResult);
hres = _invoke((*(DWORD***)pvInstance)[oVft/4],cc,argsize/4,args);
HeapFree(GetProcessHeap(),0,args);
return hres;
}
static HRESULT WINAPI ITypeInfo_fnInvoke(
ITypeInfo2 *iface,
VOID *pIUnk,
......
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