Andrew Eikum : mmdevapi: Store device interface in registry.

Alexandre Julliard julliard at winehq.org
Fri Apr 6 14:43:23 CDT 2012


Module: wine
Branch: master
Commit: e6638bd86f6f5d3666ef71efea0d2214dd84ab9a
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=e6638bd86f6f5d3666ef71efea0d2214dd84ab9a

Author: Andrew Eikum <aeikum at codeweavers.com>
Date:   Thu Apr  5 14:16:40 2012 -0500

mmdevapi: Store device interface in registry.

---

 dlls/mmdevapi/devenum.c         |    9 +++++++++
 dlls/mmdevapi/tests/propstore.c |   18 ++++++++++++++++++
 2 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c
index b41bfa5..501ea4c 100644
--- a/dlls/mmdevapi/devenum.c
+++ b/dlls/mmdevapi/devenum.c
@@ -268,6 +268,10 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st
     WCHAR guidstr[39];
     DWORD i;
 
+    static const PROPERTYKEY deviceinterface_key = {
+        {0x233164c8, 0x1b2c, 0x4c7d, {0xbc, 0x68, 0xb6, 0x71, 0x68, 0x7a, 0x25, 0x67}}, 1
+    };
+
     for (i = 0; i < MMDevice_count; ++i)
     {
         MMDevice *device = MMDevice_head[i];
@@ -319,10 +323,15 @@ static MMDevice *MMDevice_Create(WCHAR *name, GUID *id, EDataFlow flow, DWORD st
         if (!RegCreateKeyExW(key, reg_properties, 0, NULL, 0, KEY_WRITE|KEY_READ, NULL, &keyprop, NULL))
         {
             PROPVARIANT pv;
+
             pv.vt = VT_LPWSTR;
             pv.u.pwszVal = name;
             MMDevice_SetPropValue(id, flow, (const PROPERTYKEY*)&DEVPKEY_Device_FriendlyName, &pv);
             MMDevice_SetPropValue(id, flow, (const PROPERTYKEY*)&DEVPKEY_Device_DeviceDesc, &pv);
+
+            pv.u.pwszVal = guidstr;
+            MMDevice_SetPropValue(id, flow, &deviceinterface_key, &pv);
+
             RegCloseKey(keyprop);
         }
         RegCloseKey(key);
diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c
index a16dee1..482e439 100644
--- a/dlls/mmdevapi/tests/propstore.c
+++ b/dlls/mmdevapi/tests/propstore.c
@@ -64,6 +64,23 @@ static void test_propertystore(IPropertyStore *store)
     ok(pv.vt == VT_EMPTY, "Key should not be found\n");
 }
 
+static void test_deviceinterface(IPropertyStore *store)
+{
+    HRESULT hr;
+    PROPVARIANT pv;
+
+    static const PROPERTYKEY deviceinterface_key = {
+        {0x233164c8, 0x1b2c, 0x4c7d, {0xbc, 0x68, 0xb6, 0x71, 0x68, 0x7a, 0x25, 0x67}}, 1
+    };
+
+    pv.vt = VT_EMPTY;
+    hr = IPropertyStore_GetValue(store, &deviceinterface_key, &pv);
+    ok(hr == S_OK, "GetValue failed: %08x\n", hr);
+    ok(pv.vt == VT_LPWSTR, "Got wrong variant type: 0x%x\n", pv.vt);
+    trace("device interface: %s\n", wine_dbgstr_w(pv.u.pwszVal));
+    CoTaskMemFree(pv.u.pwszVal);
+}
+
 START_TEST(propstore)
 {
     HRESULT hr;
@@ -109,6 +126,7 @@ START_TEST(propstore)
     if (store)
     {
         test_propertystore(store);
+        test_deviceinterface(store);
         IPropertyStore_Release(store);
     }
     IMMDevice_Release(dev);




More information about the wine-cvs mailing list