[PATCH 2/6] shell32: System shellfolders don't support GetDefaultSearchGUID() in recent versions.

Nikolay Sivov nsivov at codeweavers.com
Wed Sep 27 03:13:43 CDT 2017


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---
 dlls/shell32/cpanelfolder.c     |  5 +++--
 dlls/shell32/recyclebin.c       |  5 +++--
 dlls/shell32/shfldr_desktop.c   |  5 ++---
 dlls/shell32/shfldr_fs.c        |  6 ++---
 dlls/shell32/shfldr_mycomp.c    |  5 ++---
 dlls/shell32/shfldr_netplaces.c |  6 ++---
 dlls/shell32/shfldr_printers.c  |  5 ++---
 dlls/shell32/shfldr_unixfs.c    |  5 ++---
 dlls/shell32/tests/shlfolder.c  | 49 +++++++++++++++++++++++++++++++++++++++++
 9 files changed, 68 insertions(+), 23 deletions(-)

diff --git a/dlls/shell32/cpanelfolder.c b/dlls/shell32/cpanelfolder.c
index f12faf7e87..ea5e9e2c3b 100644
--- a/dlls/shell32/cpanelfolder.c
+++ b/dlls/shell32/cpanelfolder.c
@@ -711,12 +711,13 @@ static HRESULT WINAPI ISF_ControlPanel_fnSetNameOf(IShellFolder2 *iface, HWND hw
     return E_FAIL;
 }
 
-static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID *pguid)
+static HRESULT WINAPI ISF_ControlPanel_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID *guid)
 {
     ICPanelImpl *This = impl_from_IShellFolder2(iface);
-    FIXME("(%p)\n", This);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
+
 static HRESULT WINAPI ISF_ControlPanel_fnEnumSearches(IShellFolder2 *iface,
         IEnumExtraSearch **ppenum)
 {
diff --git a/dlls/shell32/recyclebin.c b/dlls/shell32/recyclebin.c
index 7d34af243b..5d4725e425 100644
--- a/dlls/shell32/recyclebin.c
+++ b/dlls/shell32/recyclebin.c
@@ -567,9 +567,10 @@ static HRESULT WINAPI RecycleBin_GetCurFolder(IPersistFolder2 *iface, LPITEMIDLI
     return S_OK;
 }
 
-static HRESULT WINAPI RecycleBin_GetDefaultSearchGUID(IShellFolder2 *iface, GUID *pguid)
+static HRESULT WINAPI RecycleBin_GetDefaultSearchGUID(IShellFolder2 *iface, GUID *guid)
 {
-    FIXME("stub\n");
+    RecycleBin *This = impl_from_IShellFolder2(iface);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
 
diff --git a/dlls/shell32/shfldr_desktop.c b/dlls/shell32/shfldr_desktop.c
index bc5935ff65..880291c8ef 100644
--- a/dlls/shell32/shfldr_desktop.c
+++ b/dlls/shell32/shfldr_desktop.c
@@ -753,11 +753,10 @@ static HRESULT WINAPI ISF_Desktop_fnSetNameOf (IShellFolder2 * iface,
     return E_FAIL;
 }
 
-static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID(IShellFolder2 *iface,
-                GUID * pguid)
+static HRESULT WINAPI ISF_Desktop_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID *guid)
 {
     IDesktopFolderImpl *This = impl_from_IShellFolder2(iface);
-    FIXME ("(%p)->(%p) stub\n", This, pguid);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
 
diff --git a/dlls/shell32/shfldr_fs.c b/dlls/shell32/shfldr_fs.c
index 0c1d95e158..1fb4f1b2f6 100644
--- a/dlls/shell32/shfldr_fs.c
+++ b/dlls/shell32/shfldr_fs.c
@@ -910,13 +910,13 @@ static HRESULT WINAPI IShellFolder_fnSetNameOf (IShellFolder2 * iface,
     return E_FAIL;
 }
 
-static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID (IShellFolder2 *iface,
-                                                           GUID * pguid)
+static HRESULT WINAPI IShellFolder_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID *guid)
 {
     IGenericSFImpl *This = impl_from_IShellFolder2(iface);
-    FIXME ("(%p)\n", This);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
+
 static HRESULT WINAPI IShellFolder_fnEnumSearches (IShellFolder2 * iface,
                                                    IEnumExtraSearch ** ppenum)
 {
diff --git a/dlls/shell32/shfldr_mycomp.c b/dlls/shell32/shfldr_mycomp.c
index c514cd827a..3ed887c9cf 100644
--- a/dlls/shell32/shfldr_mycomp.c
+++ b/dlls/shell32/shfldr_mycomp.c
@@ -768,11 +768,10 @@ static HRESULT WINAPI ISF_MyComputer_fnSetNameOf (
     return E_FAIL;
 }
 
-static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID (
-               IShellFolder2 * iface, GUID * pguid)
+static HRESULT WINAPI ISF_MyComputer_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID *guid)
 {
     IMyComputerFolderImpl *This = impl_from_IShellFolder2(iface);
-    FIXME ("(%p)\n", This);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
 static HRESULT WINAPI ISF_MyComputer_fnEnumSearches (
diff --git a/dlls/shell32/shfldr_netplaces.c b/dlls/shell32/shfldr_netplaces.c
index e41359b322..d973e409fd 100644
--- a/dlls/shell32/shfldr_netplaces.c
+++ b/dlls/shell32/shfldr_netplaces.c
@@ -501,12 +501,10 @@ static HRESULT WINAPI ISF_NetworkPlaces_fnSetNameOf (IShellFolder2 * iface,
     return E_FAIL;
 }
 
-static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultSearchGUID (
-               IShellFolder2 * iface, GUID * pguid)
+static HRESULT WINAPI ISF_NetworkPlaces_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID *guid)
 {
     IGenericSFImpl *This = impl_from_IShellFolder2(iface);
-
-    FIXME ("(%p)\n", This);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
 
diff --git a/dlls/shell32/shfldr_printers.c b/dlls/shell32/shfldr_printers.c
index 08841fb838..66260ac816 100644
--- a/dlls/shell32/shfldr_printers.c
+++ b/dlls/shell32/shfldr_printers.c
@@ -251,11 +251,10 @@ static HRESULT WINAPI IShellFolder_Printers_fnSetNameOf (
     return E_FAIL;
 }
 
-static HRESULT WINAPI IShellFolder_Printers_fnGetDefaultSearchGUID (
-               IShellFolder2 * iface, GUID * pguid)
+static HRESULT WINAPI IShellFolder_Printers_fnGetDefaultSearchGUID(IShellFolder2 *iface, GUID *guid)
 {
     IPrintersFolderImpl *This = impl_from_IShellFolder2(iface);
-    FIXME ("(%p) stub\n", This);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
 
diff --git a/dlls/shell32/shfldr_unixfs.c b/dlls/shell32/shfldr_unixfs.c
index d9ac506473..345e965feb 100644
--- a/dlls/shell32/shfldr_unixfs.c
+++ b/dlls/shell32/shfldr_unixfs.c
@@ -1454,11 +1454,10 @@ static HRESULT WINAPI ShellFolder2_GetDefaultColumnState(IShellFolder2* iface,
     return E_NOTIMPL;
 }
 
-static HRESULT WINAPI ShellFolder2_GetDefaultSearchGUID(IShellFolder2* iface,
-    GUID *guid)
+static HRESULT WINAPI ShellFolder2_GetDefaultSearchGUID(IShellFolder2* iface, GUID *guid)
 {
     UnixFolder *This = impl_from_IShellFolder2(iface);
-    FIXME("(%p)->(%p): stub\n", This, guid);
+    TRACE("(%p)->(%p)\n", This, guid);
     return E_NOTIMPL;
 }
 
diff --git a/dlls/shell32/tests/shlfolder.c b/dlls/shell32/tests/shlfolder.c
index 8ce7d7424b..1ee02743f5 100644
--- a/dlls/shell32/tests/shlfolder.c
+++ b/dlls/shell32/tests/shlfolder.c
@@ -5446,6 +5446,54 @@ static void test_GetDefaultColumn(void)
     CoUninitialize();
 }
 
+static void test_GetDefaultSearchGUID(void)
+{
+    static const CLSID *folders[] =
+    {
+        &CLSID_MyComputer,
+        &CLSID_MyDocuments,
+        &CLSID_ControlPanel,
+        &CLSID_NetworkPlaces,
+        &CLSID_Printers,
+        &CLSID_RecycleBin,
+        &CLSID_ShellDesktop,
+    };
+    HRESULT hr;
+    int i;
+
+    CoInitialize(NULL);
+
+    for (i = 0; i < sizeof(folders)/sizeof(folders[0]); i++)
+    {
+        IShellFolder2 *folder;
+        GUID guid;
+
+        hr = CoCreateInstance(folders[i], NULL, CLSCTX_INPROC_SERVER, &IID_IShellFolder2, (void **)&folder);
+        if (hr != S_OK)
+        {
+            win_skip("Failed to create folder %s, hr %#x.\n", wine_dbgstr_guid(folders[i]), hr);
+            continue;
+        }
+
+        if (0)
+        {
+            /* crashes on XP */
+            hr = IShellFolder2_GetDefaultSearchGUID(folder, NULL);
+            ok(hr == E_NOTIMPL, "Unexpected hr %#x.\n", hr);
+        }
+
+        memcpy(&guid, &CLSID_MyComputer, sizeof(guid));
+        hr = IShellFolder2_GetDefaultSearchGUID(folder, &guid);
+        ok(hr == E_NOTIMPL || broken(hr == S_OK) /* Method was last supported on XP */, "Unexpected hr %#x.\n", hr);
+        if (hr == E_NOTIMPL)
+            ok(IsEqualGUID(&guid, &CLSID_MyComputer), "Unexpected guid %s.\n", wine_dbgstr_guid(&guid));
+
+        IShellFolder2_Release(folder);
+    }
+
+    CoUninitialize();
+}
+
 START_TEST(shlfolder)
 {
     init_function_pointers();
@@ -5486,6 +5534,7 @@ START_TEST(shlfolder)
     test_SHCreateDefaultContextMenu();
     test_DataObject();
     test_GetDefaultColumn();
+    test_GetDefaultSearchGUID();
 
     OleUninitialize();
 }
-- 
2.14.1




More information about the wine-patches mailing list