From 05ed8318943fe0465ad6e46ea89bfdfead19c04e Mon Sep 17 00:00:00 2001 From: Jactry Zeng Date: Fri, 10 Mar 2017 18:26:53 +0800 Subject: [PATCH] devenum: Implement IMoniker::GetClassID(). Signed-off-by: Jactry Zeng Signed-off-by: Huw Davies Signed-off-by: Alexandre Julliard --- 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 21c9db3d1f0..66343342c9e 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 8cc4dfd2750..e3c0f472562 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);