Signed-off-by: Zebediah Figura z.figura12@gmail.com --- Mostly since running with -v is a handy way to enumerate all devices.
dlls/devenum/tests/devenum.c | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-)
diff --git a/dlls/devenum/tests/devenum.c b/dlls/devenum/tests/devenum.c index 6164efb7774..06efa3d773c 100644 --- a/dlls/devenum/tests/devenum.c +++ b/dlls/devenum/tests/devenum.c @@ -37,7 +37,7 @@
DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
-static void test_devenum(IBindCtx *bind_ctx) +static void test_devenum(void) { IEnumMoniker *enum_cat, *enum_moniker; ICreateDevEnum* create_devenum; @@ -45,6 +45,7 @@ static void test_devenum(IBindCtx *bind_ctx) IMoniker *moniker; GUID cat_guid, clsid; WCHAR *displayname; + IBindCtx *bindctx; VARIANT var; HRESULT hr; int count; @@ -58,7 +59,7 @@ static void test_devenum(IBindCtx *bind_ctx)
while (IEnumMoniker_Next(enum_cat, 1, &moniker, NULL) == S_OK) { - hr = IMoniker_BindToStorage(moniker, bind_ctx, NULL, &IID_IPropertyBag, (void **)&prop_bag); + hr = IMoniker_BindToStorage(moniker, NULL, NULL, &IID_IPropertyBag, (void **)&prop_bag); ok(hr == S_OK, "IMoniker_BindToStorage failed: %#x\n", hr);
VariantInit(&var); @@ -100,7 +101,7 @@ static void test_devenum(IBindCtx *bind_ctx) "Expected CLSID_CDeviceMoniker got %s\n", wine_dbgstr_guid(&clsid));
VariantInit(&var); - hr = IMoniker_BindToStorage(moniker, bind_ctx, NULL, &IID_IPropertyBag, (LPVOID*)&prop_bag); + hr = IMoniker_BindToStorage(moniker, NULL, NULL, &IID_IPropertyBag, (LPVOID*)&prop_bag); ok(hr == S_OK, "IMoniker_BindToStorage failed with error %x\n", hr);
hr = IPropertyBag_Read(prop_bag, L"FriendlyName", &var, NULL); @@ -110,9 +111,16 @@ static void test_devenum(IBindCtx *bind_ctx) if (winetest_debug > 1) trace(" %s %s\n", wine_dbgstr_w(displayname), wine_dbgstr_w(V_BSTR(&var)));
- hr = IMoniker_BindToObject(moniker, bind_ctx, NULL, &IID_IUnknown, NULL); + hr = IMoniker_BindToObject(moniker, NULL, NULL, &IID_IUnknown, NULL); ok(hr == E_POINTER, "got %#x\n", hr);
+ hr = CreateBindCtx(0, &bindctx); + ok(hr == S_OK, "Got hr %#x.\n", hr); + hr = IMoniker_BindToStorage(moniker, bindctx, NULL, &IID_IPropertyBag, (LPVOID*)&prop_bag); + ok(hr == S_OK, "IMoniker_BindToStorage failed with error %x\n", hr); + IPropertyBag_Release(prop_bag); + IBindCtx_Release(bindctx); + VariantClear(&var); CoTaskMemFree(displayname); IPropertyBag_Release(prop_bag); @@ -1087,21 +1095,11 @@ static void test_vfw(void)
START_TEST(devenum) { - IBindCtx *bind_ctx = NULL; HRESULT hr;
CoInitialize(NULL);
- test_devenum(NULL); - - /* IBindCtx is allowed in IMoniker_BindToStorage (IMediaCatMoniker_BindToStorage) */ - hr = CreateBindCtx(0, &bind_ctx); - ok(hr == S_OK, "Cannot create BindCtx: (res = 0x%x)\n", hr); - if (bind_ctx) { - test_devenum(bind_ctx); - IBindCtx_Release(bind_ctx); - } - + test_devenum(); test_moniker_isequal(); test_register_filter(); test_directshow_filter();
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/devenum/mediacatenum.c | 2 +- dlls/devenum/tests/devenum.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/dlls/devenum/mediacatenum.c b/dlls/devenum/mediacatenum.c index 569baffb216..15e5c9642cb 100644 --- a/dlls/devenum/mediacatenum.c +++ b/dlls/devenum/mediacatenum.c @@ -265,7 +265,7 @@ static HRESULT WINAPI property_bag_Write(IPropertyBag *iface, const WCHAR *name, } default: WARN("Unhandled type %s.\n", debugstr_vt(V_VT(var))); - return E_FAIL; + return E_INVALIDARG; }
RegCloseKey(key); diff --git a/dlls/devenum/tests/devenum.c b/dlls/devenum/tests/devenum.c index 06efa3d773c..01e6be98da7 100644 --- a/dlls/devenum/tests/devenum.c +++ b/dlls/devenum/tests/devenum.c @@ -377,7 +377,7 @@ static void test_directshow_filter(void)
V_VT(&var) = VT_LPWSTR; hr = IPropertyBag_Write(prop_bag, L"FriendlyName", &var); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); VariantClear(&var);
V_VT(&var) = VT_I4; @@ -406,7 +406,7 @@ static void test_directshow_filter(void)
V_VT(&var) = VT_UI4; hr = IPropertyBag_Write(prop_bag, L"foobar", &var); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
V_VT(&var) = VT_ARRAY | VT_UI1; V_ARRAY(&var) = SafeArrayCreate(VT_UI1, 1, &bound); @@ -513,7 +513,7 @@ static void test_codec(void)
V_VT(&var) = VT_LPWSTR; hr = IPropertyBag_Write(prop_bag, L"FriendlyName", &var); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
VariantClear(&var); V_VT(&var) = VT_EMPTY; @@ -559,7 +559,7 @@ static void test_codec(void)
V_VT(&var) = VT_UI4; hr = IPropertyBag_Write(prop_bag, L"foobar", &var); - todo_wine ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr); + ok(hr == E_INVALIDARG, "Got hr %#x.\n", hr);
V_VT(&var) = VT_ARRAY | VT_UI1; V_ARRAY(&var) = SafeArrayCreate(VT_UI1, 1, &bound);
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/devenum/devenum.rc | 1 - dlls/devenum/devenum_private.h | 2 -- 2 files changed, 3 deletions(-)
diff --git a/dlls/devenum/devenum.rc b/dlls/devenum/devenum.rc index 24da9b8d9e3..eef5c150785 100644 --- a/dlls/devenum/devenum.rc +++ b/dlls/devenum/devenum.rc @@ -21,7 +21,6 @@ #include "windef.h" #include "winbase.h" #include "winnls.h" -#include "devenum_private.h"
LANGUAGE LANG_NEUTRAL, SUBLANG_NEUTRAL
diff --git a/dlls/devenum/devenum_private.h b/dlls/devenum/devenum_private.h index 6d969ff6082..e0c693a2e95 100644 --- a/dlls/devenum/devenum_private.h +++ b/dlls/devenum/devenum_private.h @@ -22,9 +22,7 @@ * - Private file where devenum globals are declared */
-#ifndef RC_INVOKED #include <stdarg.h> -#endif
#include "windef.h" #include "winbase.h"
To avoid an invalid free in moniker_Release().
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- dlls/devenum/devenum_private.h | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/dlls/devenum/devenum_private.h b/dlls/devenum/devenum_private.h index e0c693a2e95..43a5a0c50e1 100644 --- a/dlls/devenum/devenum_private.h +++ b/dlls/devenum/devenum_private.h @@ -59,11 +59,8 @@ struct moniker CLSID class; BOOL has_class; enum device_type type; - union - { - WCHAR *name; /* for filters and codecs */ - CLSID clsid; /* for DMOs */ - }; + WCHAR *name; /* for filters and codecs */ + CLSID clsid; /* for DMOs */
IPropertyBag IPropertyBag_iface; };
Signed-off-by: Zebediah Figura z.figura12@gmail.com --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
diff --git a/MAINTAINERS b/MAINTAINERS index dd55c12db8f..d5b9133c79b 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -106,6 +106,7 @@ DirectShow M: Zebediah Figura z.figura12@gmail.com P: Andrew Eikum aeikum@codeweavers.com F: dlls/amstream/ +F: dlls/devenum/ F: dlls/mciqtz32/ F: dlls/qasf/ F: dlls/qcap/