Maarten Lankhorst : mmdevapi: Add some DEVPKEY's to property tests.

Alexandre Julliard julliard at winehq.org
Mon Apr 26 13:59:29 CDT 2010


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

Author: Maarten Lankhorst <m.b.lankhorst at gmail.com>
Date:   Thu Apr 22 22:59:58 2010 +0200

mmdevapi: Add some DEVPKEY's to property tests.

---

 dlls/mmdevapi/devenum.c         |    1 +
 dlls/mmdevapi/tests/mmdevenum.c |    1 +
 dlls/mmdevapi/tests/propstore.c |   24 ++++++++++++++++++++----
 3 files changed, 22 insertions(+), 4 deletions(-)

diff --git a/dlls/mmdevapi/devenum.c b/dlls/mmdevapi/devenum.c
index a5f49a6..0a7a661 100644
--- a/dlls/mmdevapi/devenum.c
+++ b/dlls/mmdevapi/devenum.c
@@ -1211,6 +1211,7 @@ static HRESULT WINAPI MMDevPropStore_GetValue(IPropertyStore *iface, REFPROPERTY
     /* Special case */
     if (IsEqualPropertyKey(*key, PKEY_AudioEndpoint_GUID))
     {
+        pv->vt = VT_LPWSTR;
         pv->u.pwszVal = CoTaskMemAlloc(39 * sizeof(WCHAR));
         if (!pv->u.pwszVal)
             return E_OUTOFMEMORY;
diff --git a/dlls/mmdevapi/tests/mmdevenum.c b/dlls/mmdevapi/tests/mmdevenum.c
index 014cbf3..f2b8f13 100644
--- a/dlls/mmdevapi/tests/mmdevenum.c
+++ b/dlls/mmdevapi/tests/mmdevenum.c
@@ -26,6 +26,7 @@
 #include "audioclient.h"
 #include "dshow.h"
 #include "dsound.h"
+#include "devpkey.h"
 
 DEFINE_GUID(GUID_NULL,0,0,0,0,0,0,0,0,0,0,0);
 
diff --git a/dlls/mmdevapi/tests/propstore.c b/dlls/mmdevapi/tests/propstore.c
index bb9ff16..13d6f75 100644
--- a/dlls/mmdevapi/tests/propstore.c
+++ b/dlls/mmdevapi/tests/propstore.c
@@ -29,22 +29,38 @@
 #include "unknwn.h"
 #include "uuids.h"
 #include "mmdeviceapi.h"
+#include "devpkey.h"
 
 static void test_propertystore(IPropertyStore *store)
 {
     HRESULT hr;
-    PROPVARIANT pv = { 0 };
-    char temp[40];
+    PROPVARIANT pv;
+    char temp[128];
+    temp[sizeof(temp)-1] = 0;
 
+    pv.vt = VT_EMPTY;
     hr = IPropertyStore_GetValue(store, &PKEY_AudioEndpoint_GUID, &pv);
     ok(hr == S_OK, "Failed with %08x\n", hr);
-    if (hr == S_OK)
+    ok(pv.vt == VT_LPWSTR, "Value should be %i, is %i\n", VT_LPWSTR, pv.vt);
+    if (hr == S_OK && pv.vt == VT_LPWSTR)
     {
         WideCharToMultiByte(CP_ACP, 0, pv.u.pwszVal, -1, temp, sizeof(temp)-1, NULL, NULL);
-        temp[sizeof(temp)-1] = 0;
         trace("guid: %s\n", temp);
         CoTaskMemFree(pv.u.pwszVal);
     }
+
+    pv.vt = VT_EMPTY;
+    hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_FriendlyName, &pv);
+    ok(hr == S_OK, "Failed with %08x\n", hr);
+    ok(pv.vt == VT_EMPTY, "Key should not be found\n");
+
+    pv.vt = VT_EMPTY;
+    hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_Enabled, &pv);
+    ok(pv.vt == VT_EMPTY, "Key should not be found\n");
+
+    pv.vt = VT_EMPTY;
+    hr = IPropertyStore_GetValue(store, (const PROPERTYKEY*)&DEVPKEY_DeviceInterface_ClassGuid, &pv);
+    ok(pv.vt == VT_EMPTY, "Key should not be found\n");
 }
 
 START_TEST(propstore)




More information about the wine-cvs mailing list