From 4367f4b2308d935daa76965c57d4da757403cc64 Mon Sep 17 00:00:00 2001 From: Nikolay Sivov Date: Sat, 9 May 2015 19:37:53 +0300 Subject: [PATCH] shell32: Silence IMarshal requests to IKnownFolder and IKnownFolderManager. --- dlls/shell32/shellpath.c | 12 ++++++++++++ dlls/shell32/tests/shellpath.c | 8 ++++++++ 2 files changed, 20 insertions(+) diff --git a/dlls/shell32/shellpath.c b/dlls/shell32/shellpath.c index 5753bb62a30..331db1ff92b 100644 --- a/dlls/shell32/shellpath.c +++ b/dlls/shell32/shellpath.c @@ -5024,11 +5024,17 @@ static HRESULT WINAPI knownfolder_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppv ); + *ppv = NULL; if ( IsEqualGUID( riid, &IID_IKnownFolder ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppv = iface; } + else if ( IsEqualGUID( riid, &IID_IMarshal ) ) + { + TRACE("IID_IMarshal returning NULL.\n"); + return E_NOINTERFACE; + } else { FIXME("interface %s not implemented\n", debugstr_guid(riid)); @@ -5416,11 +5422,17 @@ static HRESULT WINAPI foldermanager_QueryInterface( TRACE("%p %s %p\n", This, debugstr_guid( riid ), ppv ); + *ppv = NULL; if ( IsEqualGUID( riid, &IID_IKnownFolderManager ) || IsEqualGUID( riid, &IID_IUnknown ) ) { *ppv = iface; } + else if ( IsEqualGUID( riid, &IID_IMarshal ) ) + { + TRACE("IID_IMarshal returning NULL.\n"); + return E_NOINTERFACE; + } else { FIXME("interface %s not implemented\n", debugstr_guid(riid)); diff --git a/dlls/shell32/tests/shellpath.c b/dlls/shell32/tests/shellpath.c index c2ce19806ab..ec21ce7b3d5 100644 --- a/dlls/shell32/tests/shellpath.c +++ b/dlls/shell32/tests/shellpath.c @@ -2075,8 +2075,13 @@ static void test_knownFolders(void) win_skip("IKnownFolderManager unavailable\n"); else { + IUnknown *unk; + ok(hr == S_OK, "failed to create KnownFolderManager instance: 0x%08x\n", hr); + hr = IKnownFolderManager_QueryInterface(mgr, &IID_IMarshal, (void**)&unk); + ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + hr = IKnownFolderManager_FolderIdFromCsidl(mgr, CSIDL_WINDOWS, &folderId); ok(hr == S_OK, "failed to convert CSIDL to KNOWNFOLDERID: 0x%08x\n", hr); ok(IsEqualGUID(&folderId, &FOLDERID_Windows)==TRUE, "invalid KNOWNFOLDERID returned\n"); @@ -2089,6 +2094,9 @@ static void test_knownFolders(void) ok(hr == S_OK, "failed to get known folder: 0x%08x\n", hr); if(SUCCEEDED(hr)) { + hr = IKnownFolder_QueryInterface(folder, &IID_IMarshal, (void**)&unk); + ok(hr == E_NOINTERFACE, "got 0x%08x\n", hr); + hr = IKnownFolder_GetCategory(folder, &cat); ok(hr == S_OK, "failed to get folder category: 0x%08x\n", hr); ok(cat==KF_CATEGORY_FIXED, "invalid folder category: %d\n", cat);