[PATCH 2/3] mmdevapi: convert string representation of ContainerId property to CLSID in MMDevice_GetPropValue
Claire Girka
wine at gitlab.winehq.org
Sat Jul 2 04:53:46 CDT 2022
From: Claire Girka <claire at sitedethib.com>
---
dlls/mmdevapi/devenum.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c
index 19caf36e8d3..0ffd4fd1ad7 100644
--- a/dlls/mmdevapi/devenum.c
+++ b/dlls/mmdevapi/devenum.c
@@ -1450,6 +1450,24 @@ static HRESULT WINAPI MMDevPropStore_GetValue(IPropertyStore *iface, REFPROPERTY
if (FAILED(hres))
return hres;
+ /* Clients apps expect a CLSID */
+ if(IsEqualPropertyKey(*key,DEVPKEY_Device_ContainerId) && pv->vt == VT_LPWSTR && pv->pwszVal) {
+ LPWSTR guidstr = pv->pwszVal;
+
+ pv->puuid = CoTaskMemAlloc(sizeof(*pv->puuid));
+ if (!pv->puuid)
+ return E_OUTOFMEMORY;
+
+ hres = CLSIDFromString(guidstr, pv->puuid);
+ if (FAILED(hres))
+ return hres;
+
+ pv->vt = VT_CLSID;
+ CoTaskMemFree(guidstr);
+
+ return hres;
+ }
+
if (WARN_ON(mmdevapi))
{
if ((IsEqualPropertyKey(*key, DEVPKEY_Device_FriendlyName) ||
--
GitLab
https://gitlab.winehq.org/wine/wine/-/merge_requests/359
More information about the wine-devel
mailing list