[PATCH 5/5] shell32/shellview: Respond to special interface id CDefView

Nikolay Sivov nsivov at codeweavers.com
Sun Apr 30 14:01:57 CDT 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/shell32/shlview.c       |  3 ++-
 dlls/shell32/tests/shlview.c | 20 ++++++++++++++++++++
 include/shlguid.h            |  1 +
 3 files changed, 23 insertions(+), 1 deletion(-)

diff --git a/dlls/shell32/shlview.c b/dlls/shell32/shlview.c
index f815011a96..e0dbc3ba9b 100644
--- a/dlls/shell32/shlview.c
+++ b/dlls/shell32/shlview.c
@@ -1713,7 +1713,8 @@ static HRESULT WINAPI IShellView_fnQueryInterface(IShellView3 *iface, REFIID rii
 	if(IsEqualIID(riid, &IID_IUnknown) ||
 	   IsEqualIID(riid, &IID_IShellView) ||
 	   IsEqualIID(riid, &IID_IShellView2) ||
-	   IsEqualIID(riid, &IID_IShellView3))
+	   IsEqualIID(riid, &IID_IShellView3) ||
+	   IsEqualIID(riid, &IID_CDefView))
 	{
 	  *ppvObj = &This->IShellView3_iface;
 	}
diff --git a/dlls/shell32/tests/shlview.c b/dlls/shell32/tests/shlview.c
index 8603ddbfc4..fa6dab4236 100644
--- a/dlls/shell32/tests/shlview.c
+++ b/dlls/shell32/tests/shlview.c
@@ -633,6 +633,7 @@ static void test_CreateViewWindow(void)
     HRESULT hr;
     RECT r = {0};
     ULONG ref1, ref2;
+    IUnknown *unk;
 
     hr = SHGetDesktopFolder(&desktop);
     ok(hr == S_OK, "got (0x%08x)\n", hr);
@@ -640,6 +641,11 @@ static void test_CreateViewWindow(void)
     hr = IShellFolder_CreateViewObject(desktop, NULL, &IID_IShellView, (void**)&view);
     ok(hr == S_OK, "got (0x%08x)\n", hr);
 
+    hr = IShellView_QueryInterface(view, &IID_CDefView, (void **)&unk);
+    ok(hr == S_OK, "got (0x%08x)\n", hr);
+    ok(unk == (IUnknown *)view, "got %p\n", unk);
+    IUnknown_Release(unk);
+
 if (0)
 {
     /* crashes on native */
@@ -1335,6 +1341,7 @@ static void test_SHCreateShellFolderView(void)
     IShellView *psv;
     SFV_CREATE sfvc;
     ULONG refCount;
+    IUnknown *unk;
     HRESULT hr;
 
     hr = SHGetDesktopFolder(&desktop);
@@ -1396,6 +1403,12 @@ if (0)
     hr = SHCreateShellFolderView(&sfvc, &psv);
     ok(hr == S_OK, "Got 0x%08x\n", hr);
     ok(psv != NULL, "psv = %p\n", psv);
+
+    hr = IShellView_QueryInterface(psv, &IID_CDefView, (void **)&unk);
+    ok(hr == S_OK, "got (0x%08x)\n", hr);
+    ok(unk == (IUnknown *)psv, "got %p\n", unk);
+    IUnknown_Release(unk);
+
     refCount = IShellView_Release(psv);
     ok(refCount == 0, "refCount = %u\n", refCount);
 
@@ -1407,6 +1420,7 @@ static void test_SHCreateShellFolderViewEx(void)
     IShellFolder *desktop;
     IShellView *psv;
     ULONG refCount;
+    IUnknown *unk;
     HRESULT hr;
     CSFV csfv;
 
@@ -1427,6 +1441,12 @@ static void test_SHCreateShellFolderViewEx(void)
     hr = SHCreateShellFolderViewEx(&csfv, &psv);
     ok(hr == S_OK, "Got 0x%08x\n", hr);
     ok(psv != NULL, "psv = %p\n", psv);
+
+    hr = IShellView_QueryInterface(psv, &IID_CDefView, (void **)&unk);
+    ok(hr == S_OK, "got (0x%08x)\n", hr);
+    ok(unk == (IUnknown *)psv, "got %p\n", unk);
+    IUnknown_Release(unk);
+
     if (psv)
     {
         refCount = IShellView_Release(psv);
diff --git a/include/shlguid.h b/include/shlguid.h
index 2279defb1d..028cb61f28 100644
--- a/include/shlguid.h
+++ b/include/shlguid.h
@@ -82,6 +82,7 @@ DEFINE_OLEGUID(IID_IQueryInfo,          0x00021500, 0, 0);
 DEFINE_GUID(IID_IACList,   0x77A130B0,0x94FD,0x11D0,0xA5,0x44,0x00,0xC0,0x4F,0xD7,0xD0,0x62);
 DEFINE_GUID(IID_IACList2,  0x470141A0,0x5186,0x11D2,0xBB,0xB6,0x00,0x60,0x97,0x7B,0x46,0x4C);
 DEFINE_GUID(IID_IObjMgr,   0x00BB2761,0x6A77,0x11D0,0xA5,0x35,0x00,0xC0,0x4F,0xD7,0xD0,0x62);
+DEFINE_GUID(IID_CDefView,  0x4434ff80,0xef4c,0x11ce,0xae,0x65,0x08,0x00,0x2b,0x2e,0x12,0x62);
 
 DEFINE_GUID(IID_IProgressDialog, 0xEBBC7C04,0x315E,0x11D2,0xB6,0x2F,0x00,0x60,0x97,0xDF,0x5B,0xD4);
 #define SID_SProgressUI CLSID_ProgressDialog
-- 
2.11.0




More information about the wine-patches mailing list