Author: akhaldi
Date: Sat Jun 3 17:29:09 2017
New Revision: 74775
URL:
http://svn.reactos.org/svn/reactos?rev=74775&view=rev
Log:
[DEVENUM_WINETEST] Sync with Wine Staging 2.9. CORE-13362
Modified:
trunk/rostests/winetests/devenum/devenum.c
Modified: trunk/rostests/winetests/devenum/devenum.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/devenum/devenum…
==============================================================================
--- trunk/rostests/winetests/devenum/devenum.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/devenum/devenum.c [iso-8859-1] Sat Jun 3 17:29:09 2017
@@ -84,6 +84,15 @@
IPropertyBag* prop_bag = NULL;
VARIANT var;
HRESULT hr;
+ CLSID clsid = {0};
+
+ hr = IMoniker_GetClassID(moniker, NULL);
+ ok(hr == E_INVALIDARG, "IMoniker_GetClassID should failed
%x\n", hr);
+
+ hr = IMoniker_GetClassID(moniker, &clsid);
+ ok(hr == S_OK, "IMoniker_GetClassID failed with error %x\n",
hr);
+ ok(IsEqualGUID(&clsid, &CLSID_CDeviceMoniker),
+ "Expected CLSID_CDeviceMoniker got %s\n",
wine_dbgstr_guid(&clsid));
VariantInit(&var);
hr = IMoniker_BindToStorage(moniker, bind_ctx, NULL,
&IID_IPropertyBag, (LPVOID*)&prop_bag);
@@ -131,6 +140,94 @@
if(sizeof(void*) == 4)
ok(have_mrle, "mrle codec not found\n");
}
+static void test_moniker_isequal(void)
+{
+ HRESULT res;
+ ICreateDevEnum *create_devenum = NULL;
+ IEnumMoniker *enum_moniker0 = NULL, *enum_moniker1 = NULL;
+ IMoniker *moniker0 = NULL, *moniker1 = NULL;
+
+ res = CoCreateInstance(&CLSID_SystemDeviceEnum, NULL, CLSCTX_INPROC,
+ &IID_ICreateDevEnum, (LPVOID*)&create_devenum);
+ if (FAILED(res))
+ {
+ skip("Cannot create SystemDeviceEnum object (%x)\n", res);
+ return;
+ }
+
+ res = ICreateDevEnum_CreateClassEnumerator(create_devenum,
&CLSID_LegacyAmFilterCategory, &enum_moniker0, 0);
+ ok(SUCCEEDED(res), "Cannot create enum moniker (res = %x)\n", res);
+ if (SUCCEEDED(res))
+ {
+ if (SUCCEEDED(IEnumMoniker_Next(enum_moniker0, 1, &moniker0, NULL))
&&
+ SUCCEEDED(IEnumMoniker_Next(enum_moniker0, 1, &moniker1, NULL)))
+ {
+ res = IMoniker_IsEqual(moniker0, moniker1);
+ ok(res == S_FALSE, "IMoniker_IsEqual should fail (res = %x)\n",
res);
+
+ res = IMoniker_IsEqual(moniker1, moniker0);
+ ok(res == S_FALSE, "IMoniker_IsEqual should fail (res = %x)\n",
res);
+
+ IMoniker_Release(moniker0);
+ IMoniker_Release(moniker1);
+ }
+ else
+ skip("Cannot get moniker for testing.\n");
+ }
+ IEnumMoniker_Release(enum_moniker0);
+
+ res = ICreateDevEnum_CreateClassEnumerator(create_devenum,
&CLSID_LegacyAmFilterCategory, &enum_moniker0, 0);
+ ok(SUCCEEDED(res), "Cannot create enum moniker (res = %x)\n", res);
+ res = ICreateDevEnum_CreateClassEnumerator(create_devenum,
&CLSID_AudioRendererCategory, &enum_moniker1, 0);
+ ok(SUCCEEDED(res), "Cannot create enum moniker (res = %x)\n", res);
+ if (SUCCEEDED(res))
+ {
+ if (SUCCEEDED(IEnumMoniker_Next(enum_moniker0, 1, &moniker0, NULL))
&&
+ SUCCEEDED(IEnumMoniker_Next(enum_moniker1, 1, &moniker1, NULL)))
+ {
+ res = IMoniker_IsEqual(moniker0, moniker1);
+ ok(res == S_FALSE, "IMoniker_IsEqual should failed (res = %x)\n",
res);
+
+ res = IMoniker_IsEqual(moniker1, moniker0);
+ ok(res == S_FALSE, "IMoniker_IsEqual should failed (res = %x)\n",
res);
+
+ IMoniker_Release(moniker0);
+ IMoniker_Release(moniker1);
+ }
+ else
+ skip("Cannot get moniker for testing.\n");
+ }
+ IEnumMoniker_Release(enum_moniker0);
+ IEnumMoniker_Release(enum_moniker1);
+
+ res = ICreateDevEnum_CreateClassEnumerator(create_devenum,
&CLSID_LegacyAmFilterCategory, &enum_moniker0, 0);
+ ok(SUCCEEDED(res), "Cannot create enum moniker (res = %x)\n", res);
+ res = ICreateDevEnum_CreateClassEnumerator(create_devenum,
&CLSID_LegacyAmFilterCategory, &enum_moniker1, 0);
+ ok(SUCCEEDED(res), "Cannot create enum moniker (res = %x)\n", res);
+ if (SUCCEEDED(res))
+ {
+ if (SUCCEEDED(IEnumMoniker_Next(enum_moniker0, 1, &moniker0, NULL))
&&
+ SUCCEEDED(IEnumMoniker_Next(enum_moniker1, 1, &moniker1, NULL)))
+ {
+ res = IMoniker_IsEqual(moniker0, moniker1);
+ ok(res == S_OK, "IMoniker_IsEqual failed (res = %x)\n", res);
+
+ res = IMoniker_IsEqual(moniker1, moniker0);
+ ok(res == S_OK, "IMoniker_IsEqual failed (res = %x)\n", res);
+
+ IMoniker_Release(moniker0);
+ IMoniker_Release(moniker1);
+ }
+ else
+ skip("Cannot get moniker for testing.\n");
+ }
+ IEnumMoniker_Release(enum_moniker0);
+ IEnumMoniker_Release(enum_moniker1);
+
+ ICreateDevEnum_Release(create_devenum);
+
+ return;
+}
/* CLSID_CDeviceMoniker */
@@ -151,5 +248,7 @@
IBindCtx_Release(bind_ctx);
}
+ test_moniker_isequal();
+
CoUninitialize();
}