Jactry Zeng : devenum: Implement IMoniker::GetClassID().

Alexandre Julliard julliard at winehq.org
Thu Mar 16 17:25:15 CDT 2017


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

Author: Jactry Zeng <jzeng at codeweavers.com>
Date:   Fri Mar 10 18:26:53 2017 +0800

devenum: Implement IMoniker::GetClassID().

Signed-off-by: Jactry Zeng <jzeng at codeweavers.com>
Signed-off-by: Huw Davies <huw at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/devenum/mediacatenum.c  | 8 +++++---
 dlls/devenum/tests/devenum.c | 9 +++++++++
 2 files changed, 14 insertions(+), 3 deletions(-)

diff --git a/dlls/devenum/mediacatenum.c b/dlls/devenum/mediacatenum.c
index 21c9db3..6634334 100644
--- a/dlls/devenum/mediacatenum.c
+++ b/dlls/devenum/mediacatenum.c
@@ -355,12 +355,14 @@ static HRESULT WINAPI DEVENUM_IMediaCatMoniker_GetClassID(IMoniker *iface, CLSID
 {
     MediaCatMoniker *This = impl_from_IMoniker(iface);
 
-    FIXME("(%p)->(%p): stub\n", This, pClassID);
+    TRACE("(%p)->(%p)\n", This, pClassID);
 
     if (pClassID == NULL)
-        return E_POINTER;
+        return E_INVALIDARG;
 
-    return E_NOTIMPL;
+    *pClassID = CLSID_CDeviceMoniker;
+
+    return S_OK;
 }
 
 static HRESULT WINAPI DEVENUM_IMediaCatMoniker_IsDirty(IMoniker *iface)
diff --git a/dlls/devenum/tests/devenum.c b/dlls/devenum/tests/devenum.c
index 8cc4dfd..e3c0f47 100644
--- a/dlls/devenum/tests/devenum.c
+++ b/dlls/devenum/tests/devenum.c
@@ -79,6 +79,15 @@ static void test_devenum(IBindCtx *bind_ctx)
                 IPropertyBag* prop_bag = NULL;
                 VARIANT var;
                 HRESULT hr;
+                CLSID clsid = {0};
+
+                hr = IMoniker_GetClassID(moniker, NULL);
+                ok(hr == E_INVALIDARG, "IMoniker_GetClassID should failed %x\n", hr);
+
+                hr = IMoniker_GetClassID(moniker, &clsid);
+                ok(hr == S_OK, "IMoniker_GetClassID failed with error %x\n", hr);
+                ok(IsEqualGUID(&clsid, &CLSID_CDeviceMoniker),
+                   "Expected CLSID_CDeviceMoniker got %s\n", wine_dbgstr_guid(&clsid));
 
                 VariantInit(&var);
                 hr = IMoniker_BindToStorage(moniker, bind_ctx, NULL, &IID_IPropertyBag, (LPVOID*)&prop_bag);




More information about the wine-cvs mailing list