From: Fabian Maurer dark.shadow4@web.de
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=56666 --- dlls/oleaut32/tests/typelib.c | 12 ------------ dlls/oleaut32/typelib.c | 21 +++++++++++++++++++++ 2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/dlls/oleaut32/tests/typelib.c b/dlls/oleaut32/tests/typelib.c index ce60e99aa9d..eb5407f034f 100644 --- a/dlls/oleaut32/tests/typelib.c +++ b/dlls/oleaut32/tests/typelib.c @@ -1241,49 +1241,41 @@ static void test_TypeInfo(void) /* call propget with DISPATCH_PROPERTYPUT on HRESULT func(out int) - 0 params */ dispparams.cArgs = 0; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 5, DISPATCH_PROPERTYPUT, &dispparams, &res, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on HRESULT func(out int) - 1 param */ dispparams.cArgs = 1; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 5, DISPATCH_PROPERTYPUT, &dispparams, &res, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on HRESULT func(out int) - 0 params - NULL result passed */ dispparams.cArgs = 0; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 5, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on on HRESULT func(out int) - 1 params - NULL result passed */ dispparams.cArgs = 1; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 5, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on int func() - 0 params */ dispparams.cArgs = 0; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 6, DISPATCH_PROPERTYPUT, &dispparams, &res, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on int func() - 1 params */ dispparams.cArgs = 1; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 6, DISPATCH_PROPERTYPUT, &dispparams, &res, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on int func() - 0 params - NULL result passed */ dispparams.cArgs = 0; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 6, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on int func() - 1 param - NULL result passed */ dispparams.cArgs = 1; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 6, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on int func(int) - 0 param - NULL result passed */ @@ -1299,7 +1291,6 @@ static void test_TypeInfo(void) /* call propget with DISPATCH_PROPERTYPUT on int func(int) - 2 params - NULL result passed */ dispparams.cArgs = 2; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 7, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on int func(int) - 3 params - NULL result passed */ @@ -1320,7 +1311,6 @@ static void test_TypeInfo(void) /* call propget with DISPATCH_PROPERTYPUT on HRESULT func(out int, int) - 2 params - NULL result passed */ dispparams.cArgs = 2; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 8, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on HRESULT func(out int, int) - 3 params - NULL result passed */ @@ -1346,7 +1336,6 @@ static void test_TypeInfo(void) /* call propget with DISPATCH_PROPERTYPUT on int func(int, int) - 3 params - NULL result passed */ dispparams.cArgs = 3; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 9, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* call propget with DISPATCH_PROPERTYPUT on void func(int, int) - 0 params - NULL result passed */ @@ -1367,7 +1356,6 @@ static void test_TypeInfo(void) /* call propget with DISPATCH_PROPERTYPUT on void func(int, int) - 3 params - NULL result passed */ dispparams.cArgs = 3; hr = ITypeInfo_Invoke(pTypeInfo, &invoketest, 10, DISPATCH_PROPERTYPUT, &dispparams, NULL, NULL, &i); - todo_wine ok(hr == DISP_E_BADPARAMCOUNT, "got 0x%08lx\n", hr);
/* If there's get and put, the put must work */ diff --git a/dlls/oleaut32/typelib.c b/dlls/oleaut32/typelib.c index b1fbcdfed0a..836b54f4b37 100644 --- a/dlls/oleaut32/typelib.c +++ b/dlls/oleaut32/typelib.c @@ -7547,6 +7547,27 @@ func_fail: return E_NOTIMPL; }
+ /* not found, check for special error cases */ + for (fdc = 0; fdc < This->typeattr.cFuncs; ++fdc){ + const FUNCDESC *func_desc = &This->funcdescs[fdc].funcdesc; + if (memid == func_desc->memid) + { + if ((wFlags & INVOKE_PROPERTYPUT) && (func_desc->invkind & INVOKE_PROPERTYGET)) + { + int count_inputs = 0; + for (i = 0; i < func_desc->cParams; i++) + { + USHORT wParamFlags = func_desc->lprgelemdescParam[i].paramdesc.wParamFlags; + if (!(wParamFlags & PARAMFLAG_FRETVAL)) + count_inputs++; + } + + if (count_inputs == 0 || pDispParams->cArgs == count_inputs + 1) + return DISP_E_BADPARAMCOUNT; + } + } + } + /* not found, look for it in inherited interfaces */ ITypeInfo2_GetTypeKind(iface, &type_kind); if(type_kind == TKIND_INTERFACE || type_kind == TKIND_DISPATCH) {