[PATCH v18 0/2] MR11083: mmdevapi: Reverse load_devices_from_reg() as outputs then inputs
https://bugs.winehq.org/show_bug.cgi?id=59830 -- v18: mmdevapi: Reverse load_devices_from_reg() as outputs then inputs mmdevapi/tests: EnumAudioEndpoints eAll lists eRender first if exists matching MS https://gitlab.winehq.org/wine/wine/-/merge_requests/11083
From: Stian Low <wineryyyyy@gmail.com> mmdevapi/tests: EnumAudioEndpoints eAll lists eRender first if exists matching MS --- dlls/mmdevapi/tests/propstore.c | 35 +++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c index 2ed2afa4b58..5ab8cdebb3b 100644 --- a/dlls/mmdevapi/tests/propstore.c +++ b/dlls/mmdevapi/tests/propstore.c @@ -275,6 +275,41 @@ START_TEST(propstore) IMMDevice_Release(dev); } + if (count > 0) + { + PROPVARIANT pv; + + trace("EnumAudioEndpoints eAll[0] eRender listed first?\n"); + hr = IMMDeviceEnumerator_EnumAudioEndpoints(mme, eAll, DEVICE_STATE_ACTIVE, &collection); + ok(hr == S_OK, "Got EnumAudioEndpoints eAll hr %#lx.\n", hr); + hr = IMMDeviceCollection_GetCount(collection, &count); + ok(hr == S_OK, "Got GetCount eAll hr %#lx.\n", hr); + + if (count > 0) + { + IMMDevice *dev; + + hr = IMMDeviceCollection_Item(collection, 0, &dev); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + + store = NULL; + hr = IMMDevice_OpenPropertyStore(dev, STGM_READWRITE, &store); + if (hr == E_ACCESSDENIED) + hr = IMMDevice_OpenPropertyStore(dev, STGM_READ, &store); + ok(hr == S_OK, "Opening valid store returned %08lx\n", hr); + + pv.vt = VT_EMPTY; + hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_Device_DeviceDesc, &pv); + ok(hr == S_OK, "Failed with %#lx\n", hr); + ok(pv.vt == VT_LPWSTR && pv.pwszVal, "Device_DeviceDesc value had wrong type: %#x or was NULL\n", pv.vt); + todo_wine ok(!wcscmp(L"Speakers", pv.pwszVal), "Expected EnumAudioEndpoints eAll[0] to be eRender but DeviceDesc != 'Speakers'\n"); + + IPropertyStore_Release(store); + IMMDevice_Release(dev); + } + } + + IMMDeviceCollection_Release(collection); IMMDeviceEnumerator_Release(mme); CoUninitialize(); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11083
From: Stian Low <wineryyyyy@gmail.com> --- dlls/mmdevapi/devenum.c | 10 +++++----- dlls/mmdevapi/tests/propstore.c | 2 +- 2 files changed, 6 insertions(+), 6 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; } diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c index 5ab8cdebb3b..55f62c3ccb8 100644 --- a/dlls/mmdevapi/tests/propstore.c +++ b/dlls/mmdevapi/tests/propstore.c @@ -302,7 +302,7 @@ START_TEST(propstore) hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_Device_DeviceDesc, &pv); ok(hr == S_OK, "Failed with %#lx\n", hr); ok(pv.vt == VT_LPWSTR && pv.pwszVal, "Device_DeviceDesc value had wrong type: %#x or was NULL\n", pv.vt); - todo_wine ok(!wcscmp(L"Speakers", pv.pwszVal), "Expected EnumAudioEndpoints eAll[0] to be eRender but DeviceDesc != 'Speakers'\n"); + ok(!wcscmp(L"Speakers", pv.pwszVal), "Expected EnumAudioEndpoints eAll[0] to be eRender but DeviceDesc != 'Speakers'\n"); IPropertyStore_Release(store); IMMDevice_Release(dev); -- GitLab https://gitlab.winehq.org/wine/wine/-/merge_requests/11083
On Fri Jun 19 04:39:45 2026 +0000, Huw Davies wrote:
The tests seem to succeed for me even without your implementation change, so that'll need looking at more. More generally, in cases like this, where the tests are simple, it's usually better to have a commit with the tests first, using `todo_wine`s as appropriate. Then follow that with the implementation change, removing the `todo_wine`s in the tests. That way it's clear that the implementation change is doing what the tests are testing. @huw thanks for reviewing.
You are correct that test succeed even without the patch so I must have mistaken a previous test build, which failed as expected, for changes pushed afterwards which pass erroneously after rebuilding tests. Latest commits have been reworked with `todo_wine` that introduces test fail which is removed for next commit containing patch per your suggestions. Sorry for inconvenience and thanks for test case guidance which I'll use going forward. -- https://gitlab.winehq.org/wine/wine/-/merge_requests/11083#note_143619
participants (2)
-
Stian Low -
Stian Low (@stianlow)