From: Stian Low <wineryyyyy@gmail.com> https://bugs.winehq.org/show_bug.cgi?id=59830 --- dlls/mmdevapi/tests/propstore.c | 23 ++++++++++++++++++++--- 1 file changed, 20 insertions(+), 3 deletions(-) diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c index 2ed2afa4b58..cd1ea9d9d77 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, eRender, 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); @@ -235,7 +252,7 @@ START_TEST(propstore) hr = CoCreateInstance(&CLSID_MMDeviceEnumerator, NULL, CLSCTX_INPROC_SERVER, &IID_IMMDeviceEnumerator, (void**)&mme); ok(hr == S_OK, "Got hr %#lx.\n", hr); - hr = IMMDeviceEnumerator_EnumAudioEndpoints(mme, eRender, DEVICE_STATE_ACTIVE, &collection); + 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); @@ -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