mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 12:23:31 +00:00
[OLEAUT32_WINETEST] Sync with Wine Staging 2.2. CORE-12823
svn path=/trunk/; revision=74111
This commit is contained in:
@@ -1523,14 +1523,9 @@ static HRESULT WINAPI NoStatStreamImpl_QueryInterface(
|
||||
NoStatStreamImpl* const This = impl_from_IStream(iface);
|
||||
if (ppvObject==0) return E_INVALIDARG;
|
||||
*ppvObject = 0;
|
||||
if (IsEqualIID(&IID_IUnknown, riid))
|
||||
{
|
||||
*ppvObject = This;
|
||||
}
|
||||
else if (IsEqualIID(&IID_IStream, riid))
|
||||
{
|
||||
*ppvObject = This;
|
||||
}
|
||||
|
||||
if (IsEqualIID(&IID_IUnknown, riid) || IsEqualIID(&IID_IStream, riid))
|
||||
*ppvObject = &This->IStream_iface;
|
||||
|
||||
if ((*ppvObject)==0)
|
||||
return E_NOINTERFACE;
|
||||
|
||||
@@ -1372,7 +1372,7 @@ static void test_typelibmarshal(void)
|
||||
ok(!lstrcmpW(bstr, szCat), "IWidget_get_Name should have returned string \"Cat\" instead of %s\n", wine_dbgstr_w(bstr));
|
||||
SysFreeString(bstr);
|
||||
|
||||
/* call DoSomething */
|
||||
/* call DoSomething without optional arguments */
|
||||
VariantInit(&vararg[0]);
|
||||
VariantInit(&vararg[1]);
|
||||
V_VT(&vararg[1]) = VT_R8;
|
||||
@@ -1387,6 +1387,43 @@ static void test_typelibmarshal(void)
|
||||
ok(V_VT(&varresult) == VT_EMPTY, "varresult should be VT_EMPTY\n");
|
||||
VariantClear(&varresult);
|
||||
|
||||
/* call DoSomething with optional argument set to VT_EMPTY */
|
||||
VariantInit(&vararg[0]);
|
||||
VariantInit(&vararg[1]);
|
||||
VariantInit(&vararg[2]);
|
||||
V_VT(&vararg[2]) = VT_R8;
|
||||
V_R8(&vararg[2]) = 3.141;
|
||||
dispparams.cNamedArgs = 0;
|
||||
dispparams.cArgs = 3;
|
||||
dispparams.rgdispidNamedArgs = NULL;
|
||||
dispparams.rgvarg = vararg;
|
||||
VariantInit(&varresult);
|
||||
hr = IDispatch_Invoke(pDispatch, DISPID_TM_DOSOMETHING, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
|
||||
ok_ole_success(hr, IDispatch_Invoke);
|
||||
ok(V_VT(&varresult) == VT_EMPTY, "varresult should be VT_EMPTY\n");
|
||||
VariantClear(&varresult);
|
||||
|
||||
/* call DoSomething with optional arguments set to VT_ERROR/DISP_E_PARAMNOTFOUND */
|
||||
VariantInit(&vararg[0]);
|
||||
VariantInit(&vararg[1]);
|
||||
VariantInit(&vararg[2]);
|
||||
VariantInit(&vararg[3]);
|
||||
V_VT(&vararg[3]) = VT_R8;
|
||||
V_R8(&vararg[3]) = 3.141;
|
||||
V_VT(&vararg[1]) = VT_ERROR;
|
||||
V_ERROR(&vararg[1]) = DISP_E_PARAMNOTFOUND;
|
||||
V_VT(&vararg[0]) = VT_ERROR;
|
||||
V_ERROR(&vararg[0]) = DISP_E_PARAMNOTFOUND;
|
||||
dispparams.cNamedArgs = 0;
|
||||
dispparams.cArgs = 4;
|
||||
dispparams.rgdispidNamedArgs = NULL;
|
||||
dispparams.rgvarg = vararg;
|
||||
VariantInit(&varresult);
|
||||
hr = IDispatch_Invoke(pDispatch, DISPID_TM_DOSOMETHING, &IID_NULL, LOCALE_NEUTRAL, DISPATCH_METHOD, &dispparams, &varresult, &excepinfo, NULL);
|
||||
ok_ole_success(hr, IDispatch_Invoke);
|
||||
ok(V_VT(&varresult) == VT_EMPTY, "varresult should be VT_EMPTY\n");
|
||||
VariantClear(&varresult);
|
||||
|
||||
/* call get_State */
|
||||
dispparams.cNamedArgs = 0;
|
||||
dispparams.cArgs = 0;
|
||||
|
||||
@@ -1086,11 +1086,41 @@ static HRESULT WINAPI ret_false_func(void)
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static const void *vtable[] = { NULL, NULL, NULL, inst_func };
|
||||
static const WCHAR testW[] = { 'T','e','s','t',0 };
|
||||
|
||||
static void WINAPI variant_func2(VARIANT *ret, VARIANT v1, VARIANT v2)
|
||||
{
|
||||
ok(V_VT(&v1) == VT_I4, "unexpected %d\n", V_VT(&v1));
|
||||
ok(V_I4(&v1) == 2, "unexpected %d\n", V_I4(&v1));
|
||||
ok(V_VT(&v2) == VT_BSTR, "unexpected %d\n", V_VT(&v2));
|
||||
ok(lstrcmpW(V_BSTR(&v2), testW) == 0, "unexpected %s\n", wine_dbgstr_w(V_BSTR(&v2)));
|
||||
|
||||
V_VT(ret) = VT_UI4;
|
||||
V_I4(ret) = 4321;
|
||||
}
|
||||
|
||||
static void WINAPI inst_func2(void *inst, VARIANT *ret, VARIANT v1, VARIANT v2)
|
||||
{
|
||||
ok( (*(void ***)inst)[3] == inst_func2, "wrong ptr %p\n", inst );
|
||||
|
||||
ok(V_VT(ret) == VT_I4 || broken(V_VT(ret) == VT_VARIANT) /* win64 */, "unexpected %d\n", V_VT(ret));
|
||||
ok(V_I4(ret) == 1234, "unexpected %d\n", V_I4(ret));
|
||||
|
||||
ok(V_VT(&v1) == VT_I4, "unexpected %d\n", V_VT(&v1));
|
||||
ok(V_I4(&v1) == 2, "unexpected %d\n", V_I4(&v1));
|
||||
ok(V_VT(&v2) == VT_BSTR, "unexpected %d\n", V_VT(&v2));
|
||||
ok(lstrcmpW(V_BSTR(&v2), testW) == 0, "unexpected %s\n", wine_dbgstr_w(V_BSTR(&v2)));
|
||||
|
||||
V_VT(ret) = VT_UI4;
|
||||
V_I4(ret) = 4321;
|
||||
}
|
||||
|
||||
static void *vtable[] = { NULL, NULL, NULL, inst_func };
|
||||
static void *vtable2[] = { NULL, NULL, NULL, inst_func2 };
|
||||
|
||||
static void test_DispCallFunc(void)
|
||||
{
|
||||
const void **inst = vtable;
|
||||
void **inst;
|
||||
HRESULT res;
|
||||
VARIANT result, args[5];
|
||||
VARIANTARG *pargs[5];
|
||||
@@ -1099,6 +1129,30 @@ static void test_DispCallFunc(void)
|
||||
|
||||
for (i = 0; i < 5; i++) pargs[i] = &args[i];
|
||||
|
||||
memset( args, 0x55, sizeof(args) );
|
||||
|
||||
types[0] = VT_VARIANT;
|
||||
V_VT(&args[0]) = VT_I4;
|
||||
V_I4(&args[0]) = 2;
|
||||
types[1] = VT_VARIANT;
|
||||
V_VT(&args[1]) = VT_BSTR;
|
||||
V_BSTR(&args[1]) = SysAllocString(testW);
|
||||
memset( &result, 0xcc, sizeof(result) );
|
||||
res = DispCallFunc(NULL, (ULONG_PTR)variant_func2, CC_STDCALL, VT_VARIANT, 2, types, pargs, &result);
|
||||
ok(res == S_OK, "DispCallFunc error %#x\n", res);
|
||||
ok(V_VT(&result) == VT_UI4, "wrong result type %d\n", V_VT(&result));
|
||||
ok(V_UI4(&result) == 4321, "wrong result %u\n", V_UI4(&result));
|
||||
|
||||
V_VT(&result) = VT_I4;
|
||||
V_UI4(&result) = 1234;
|
||||
inst = vtable2;
|
||||
res = DispCallFunc(&inst, 3 * sizeof(void *), CC_STDCALL, VT_VARIANT, 2, types, pargs, &result);
|
||||
ok(res == S_OK, "DispCallFunc error %#x\n", res);
|
||||
ok(V_VT(&result) == VT_UI4, "wrong result type %d\n", V_VT(&result));
|
||||
ok(V_UI4(&result) == 4321, "wrong result %u\n", V_UI4(&result));
|
||||
|
||||
VariantClear(&args[1]);
|
||||
|
||||
memset( args, 0x55, sizeof(args) );
|
||||
types[0] = VT_UI4;
|
||||
V_UI4(&args[0]) = 1;
|
||||
@@ -1197,6 +1251,7 @@ static void test_DispCallFunc(void)
|
||||
types[0] = VT_I4;
|
||||
V_I4(&args[0]) = 3;
|
||||
memset( &result, 0xcc, sizeof(result) );
|
||||
inst = vtable;
|
||||
res = DispCallFunc( &inst, 3 * sizeof(void*), CC_STDCALL, VT_I4, 1, types, pargs, &result );
|
||||
ok( res == S_OK, "DispCallFunc failed %x\n", res );
|
||||
ok( V_VT(&result) == VT_I4, "wrong result type %d\n", V_VT(&result) );
|
||||
@@ -5198,6 +5253,7 @@ static void test_SetFuncAndParamNames(void)
|
||||
ok(infos[0] && !infos[1] && !infos[2], "got wrong typeinfo\n");
|
||||
ok(memids[0] == 0, "got wrong memid[0]\n");
|
||||
ok(memids[1] == 0xdeadbeef && memids[2] == 0xdeadbeef, "got wrong memids\n");
|
||||
ITypeInfo_Release(infos[0]);
|
||||
|
||||
found = 3;
|
||||
memset(infos, 0, sizeof(infos));
|
||||
@@ -5210,6 +5266,8 @@ static void test_SetFuncAndParamNames(void)
|
||||
ok(infos[0] && infos[1] && infos[0] != infos[1], "got same typeinfo\n");
|
||||
ok(memids[0] == 0, "got wrong memid[0]\n");
|
||||
ok(memids[1] == 0, "got wrong memid[1]\n");
|
||||
ITypeInfo_Release(infos[0]);
|
||||
ITypeInfo_Release(infos[1]);
|
||||
|
||||
ITypeLib_Release(tl);
|
||||
ICreateTypeLib2_Release(ctl);
|
||||
|
||||
Reference in New Issue
Block a user