From: Patrick Hibbs hibbsncc1701@gmail.com
V2: Don't give errors about non-existent wine devices. Remove unnecessary patch.
Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=58204 --- programs/winecfg/audio.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/programs/winecfg/audio.c b/programs/winecfg/audio.c index b98efbc2ec6..b0fa6e8f390 100644 --- a/programs/winecfg/audio.c +++ b/programs/winecfg/audio.c @@ -184,12 +184,15 @@ static BOOL get_driver_name(IMMDeviceEnumerator *devenum, PROPVARIANT *pv) IPropertyStore *ps; HRESULT hr;
- hr = IMMDeviceEnumerator_GetDevice(devenum, L"Wine info device", &device); - if(FAILED(hr)) + hr = IMMDeviceEnumerator_GetDefaultAudioEndpoint(devenum, eRender, eConsole, &device); + if(FAILED(hr)) { + ERR("Could not get default audio endpoint.\n"); return FALSE; + }
hr = IMMDevice_OpenPropertyStore(device, STGM_READ, &ps); if(FAILED(hr)){ + ERR("Could not get property store for default audio endpoint (0x%p).\n", device); IMMDevice_Release(device); return FALSE; } @@ -198,8 +201,10 @@ static BOOL get_driver_name(IMMDeviceEnumerator *devenum, PROPVARIANT *pv) (const PROPERTYKEY *)&DEVPKEY_Device_Driver, pv); IPropertyStore_Release(ps); IMMDevice_Release(device); - if(FAILED(hr)) + if(FAILED(hr) || pv == NULL || pv->pwszVal == NULL) { + ERR("Could not get device driver property value.\n"); return FALSE; + }
return TRUE; }