From 7b8dbc477661bf1ac151f499bb1c56557f30ff26 Mon Sep 17 00:00:00 2001 From: Mark Harmstone Date: Mon, 26 Jan 2015 22:28:12 +0000 Subject: [PATCH] mmdevapi: Allow PKEY_AudioEndpoint_PhysicalSpeakers to be overridden. --- dlls/mmdevapi/devenum.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c index c1404371768..9a27520f2bc 100644 --- a/dlls/mmdevapi/devenum.c +++ b/dlls/mmdevapi/devenum.c @@ -372,7 +372,17 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st } if (flow != eCapture) - set_driver_prop_value(id, flow, &PKEY_AudioEndpoint_PhysicalSpeakers); + { + PROPVARIANT pv2; + + PropVariantInit(&pv2); + + /* make read-write by not overwriting if already set */ + if (FAILED(MMDevice_GetPropValue(id, flow, &PKEY_AudioEndpoint_PhysicalSpeakers, &pv2)) || pv2.vt != VT_UI4) + set_driver_prop_value(id, flow, &PKEY_AudioEndpoint_PhysicalSpeakers); + + PropVariantClear(&pv2); + } RegCloseKey(keyprop); }