[PATCH v6 0/2] MR11083: mmdevapi: Reverse load_devices_from_reg() as outputs then inputs
https://bugs.winehq.org/show_bug.cgi?id=59830 -- v6: mmdevapi/tests: Check EnumAudioEndpoints eAll lists eRender first when exists same as MS https://gitlab.winehq.org/wine/wine/-/merge_requests/11083
From: Stian Low <wineryyyyy@gmail.com> https://bugs.winehq.org/show_bug.cgi?id=59830 --- dlls/mmdevapi/devenum.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index 11d20f29957..409307a56ea 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -588,8 +588,8 @@ HRESULT load_devices_from_reg(void) if (ret == ERROR_SUCCESS) ret = RegCreateKeyExW(root, L"Render", 0, NULL, 0, KEY_READ|KEY_WRITE|KEY_WOW64_64KEY, NULL, &key_render, NULL); RegCloseKey(root); - cur = key_capture; - curflow = eCapture; + cur = key_render; + curflow = eRender; if (ret != ERROR_SUCCESS) { RegCloseKey(key_capture); @@ -608,10 +608,10 @@ HRESULT load_devices_from_reg(void) ret = RegEnumKeyExW(cur, i++, guidvalue, &len, NULL, NULL, NULL, NULL); if (ret == ERROR_NO_MORE_ITEMS) { - if (cur == key_capture) + if (cur == key_render) { - cur = key_render; - curflow = eRender; + cur = key_capture; + curflow = eCapture; i = 0; continue; } -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11083
From: Stian Low <wineryyyyy@gmail.com> https://bugs.winehq.org/show_bug.cgi?id=59830 mmdevapi/tests: Check EnumAudioEndpoints eAll lists eRender first when exists same as MS https://bugs.winehq.org/show_bug.cgi?id=59830 mmdevapi/tests: Check EnumAudioEndpoints eAll lists eRender first when exists same as MS https://bugs.winehq.org/show_bug.cgi?id=59830 --- dlls/mmdevapi/tests/propstore.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c index 2ed2afa4b58..c7829d8f29b 100644 --- a/dlls/mmdevapi/tests/propstore.c +++ b/dlls/mmdevapi/tests/propstore.c @@ -38,7 +38,7 @@ static const WCHAR software_renderW[] = L"Software\\Microsoft\\Windows\\CurrentVersion\\MMDevices\\Audio\\Render"; -static void test_propertystore(IPropertyStore *store) +static void test_propertystore(IPropertyStore *store, IMMDeviceEnumerator *mme, int i) { const WAVEFORMATEXTENSIBLE *format; WCHAR temp[256]; @@ -56,11 +56,28 @@ static void test_propertystore(IPropertyStore *store) hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_FriendlyName, &pv); ok(hr == S_OK, "Failed with %08lx\n", hr); ok(pv.vt == VT_LPWSTR && pv.pwszVal, "FriendlyName value had wrong type: 0x%x or was NULL\n", pv.vt); + trace("FriendlyName: %s\n", debugstr_w(pv.pwszVal)); pv2.vt = VT_EMPTY; hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_Device_DeviceDesc, &pv2); ok(hr == S_OK, "Failed with %#lx\n", hr); ok(pv2.vt == VT_LPWSTR && pv2.pwszVal, "Device_DeviceDesc value had wrong type: %#x or was NULL\n", pv2.vt); + trace("DeviceDesc: %s\n", debugstr_w(pv2.pwszVal)); + + if (i == 0) + { + IMMDeviceCollection *collection; + unsigned count; + trace("EnumAudioEndpoints eAll[0] eRender listed first?\n"); + hr = IMMDeviceEnumerator_EnumAudioEndpoints(mme, eAll, DEVICE_STATE_ACTIVE, &collection); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + hr = IMMDeviceCollection_GetCount(collection, &count); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + if (count > 0) + { + ok(!wcscmp(L"Speakers", pv2.pwszVal), "Expected EnumAudioEndpoints eAll[0] to be eRender but DeviceDesc != 'Speakers'\n"); + } + } swprintf(temp, ARRAY_SIZE(temp), L"%ls (%ls)", pv2.pwszVal, pv.pwszVal); @@ -265,7 +282,7 @@ START_TEST(propstore) hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, &store); ok(hr == S_OK, "Opening valid store returned %08lx\n", hr); - test_propertystore(store); + test_propertystore(store, mme, i); test_deviceinterface(store); test_getat(store); if (is_wow64) -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11083
participants (2)
-
Stian Low -
Stian Low (@stianlow)