aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/backends/mmdevapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'Alc/backends/mmdevapi.c')
-rw-r--r--Alc/backends/mmdevapi.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/Alc/backends/mmdevapi.c b/Alc/backends/mmdevapi.c
index 17f94c23..564dd629 100644
--- a/Alc/backends/mmdevapi.c
+++ b/Alc/backends/mmdevapi.c
@@ -134,8 +134,10 @@ static void get_device_name(IMMDevice *device, al_string *name)
hr = IPropertyStore_GetValue(ps, (const PROPERTYKEY*)&DEVPKEY_Device_FriendlyName, &pvname);
if(FAILED(hr))
WARN("GetValue Device_FriendlyName failed: 0x%08lx\n", hr);
- else
+ else if(pvname.vt == VT_LPWSTR)
al_string_copy_wcstr(name, pvname.pwszVal);
+ else
+ WARN("Unexpected PROPVARIANT type: 0x%04x\n", pvname.vt);
PropVariantClear(&pvname);
IPropertyStore_Release(ps);
@@ -159,8 +161,12 @@ static void get_device_formfactor(IMMDevice *device, EndpointFormFactor *formfac
hr = IPropertyStore_GetValue(ps, &PKEY_AudioEndpoint_FormFactor, &pvform);
if(FAILED(hr))
WARN("GetValue AudioEndpoint_FormFactor failed: 0x%08lx\n", hr);
- else
+ else if(pvform.vt == VT_UI4)
*formfactor = pvform.ulVal;
+ else if(pvform.vt == VT_EMPTY)
+ *formfactor = UnknownFormFactor;
+ else
+ WARN("Unexpected PROPVARIANT type: 0x%04x\n", pvform.vt);
PropVariantClear(&pvform);
IPropertyStore_Release(ps);