[PATCH v2 1/3] mmdevapi: support VT_CLSID for containerId property in MMDevice_SetPropValue

Claire Girka wine at gitlab.winehq.org
Mon Jul 4 12:12:35 CDT 2022


From: Claire Girka <claire at sitedethib.com>

CLSID is special-cased to this property because we can't safely differentiate
an encoded VT_CLSID from an encoded VT_BLOB.
---
 dlls/mmdevapi/devenum.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c
index bfeb3f3ecd8..48f4c736217 100644
--- a/dlls/mmdevapi/devenum.c
+++ b/dlls/mmdevapi/devenum.c
@@ -225,6 +225,18 @@ static HRESULT MMDevice_SetPropValue(const GUID *devguid, DWORD flow, REFPROPERT
             ret = RegSetValueExW(regkey, buffer, 0, REG_SZ, (const BYTE*)pv->pwszVal, sizeof(WCHAR)*(1+lstrlenW(pv->pwszVal)));
             break;
         }
+        case VT_CLSID:
+        {
+            if (IsEqualPropertyKey(*key, DEVPKEY_Device_ContainerId)) {
+                BYTE value[24] = { VT_CLSID, 0, 0, 0, 1, 0, 0, 0 };
+                memcpy(value + 8, pv->puuid, sizeof(GUID));
+
+                ret = RegSetValueExW(regkey, buffer, 0, REG_BINARY, (const BYTE*)value, 24);
+                break;
+            }
+            /* If it's not containerId, fall through the default unsupported case as we can't
+               ensure it will be decoded as CLSID. */
+        }
         default:
             ret = 0;
             FIXME("Unhandled type %u\n", pv->vt);
-- 
GitLab


https://gitlab.winehq.org/wine/wine/-/merge_requests/359



More information about the wine-devel mailing list