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 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, 18 insertions(+), 3 deletions(-) diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c index 2ed2afa4b58..ff6173a5698 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]; @@ -49,7 +49,6 @@ static void test_propertystore(IPropertyStore *store) hr = IPropertyStore_GetValue(store, &PKEY_AudioEndpoint_GUID, &pv); ok(hr == S_OK, "Failed with %08lx\n", hr); ok(pv.vt == VT_LPWSTR, "Value should be %i, is %i\n", VT_LPWSTR, pv.vt); - trace("guid: %s\n", debugstr_w(pv.pwszVal)); PropVariantClear(&pv); pv.vt = VT_EMPTY; @@ -62,6 +61,22 @@ static void test_propertystore(IPropertyStore *store) 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); + 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 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) + { + 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); PropVariantClear(&pv); @@ -265,7 +280,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