https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2c9c634a8e4910b7303937dac2f281bf2cb0b0f3

commit 2c9c634a8e4910b7303937dac2f281bf2cb0b0f3
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Sat Aug 12 18:17:13 2023 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Sat Aug 12 18:17:13 2023 +0900

    [SHELL32] Implement SHFindComputer (#5524)
    
    CORE-9277
---
 dll/win32/shell32/stubs.cpp | 11 -----------
 dll/win32/shell32/utils.cpp | 33 +++++++++++++++++++++++++++++++++
 2 files changed, 33 insertions(+), 11 deletions(-)

diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp
index c25d4cb1fc1..4c019e9b031 100644
--- a/dll/win32/shell32/stubs.cpp
+++ b/dll/win32/shell32/stubs.cpp
@@ -25,17 +25,6 @@ ShortSizeFormatW(LONGLONG llNumber)
     return NULL;
 }
 
-/*
- * Unimplemented
- */
-EXTERN_C BOOL
-WINAPI
-SHFindComputer(LPCITEMIDLIST pidl1, LPCITEMIDLIST pidl2)
-{
-    FIXME("SHFindComputer() stub\n");
-    return FALSE;
-}
-
 /*
  * Unimplemented
  */
diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp
index e59af7f7350..c21e679a07b 100644
--- a/dll/win32/shell32/utils.cpp
+++ b/dll/win32/shell32/utils.cpp
@@ -66,3 +66,36 @@ SheRemoveQuotesW(LPWSTR psz)
 
     return psz;
 }
+
+/*************************************************************************
+ *  SHFindComputer [SHELL32.91]
+ *
+ * Invokes the shell search in My Computer. Used in SHFindFiles.
+ * Two parameters are ignored.
+ */
+EXTERN_C BOOL
+WINAPI
+SHFindComputer(LPCITEMIDLIST pidlRoot, LPCITEMIDLIST pidlSavedSearch)
+{
+    UNREFERENCED_PARAMETER(pidlRoot);
+    UNREFERENCED_PARAMETER(pidlSavedSearch);
+
+    TRACE("%p %p\n", pidlRoot, pidlSavedSearch);
+
+    IContextMenu *pCM;
+    HRESULT hr = CoCreateInstance(CLSID_ShellSearchExt, NULL, 
CLSCTX_INPROC_SERVER,
+                                  IID_IContextMenu, (void **)&pCM);
+    if (FAILED(hr))
+    {
+        ERR("0x%08X\n", hr);
+        return hr;
+    }
+
+    CMINVOKECOMMANDINFO InvokeInfo = { sizeof(InvokeInfo) };
+    InvokeInfo.lpParameters = "{996E1EB1-B524-11D1-9120-00A0C98BA67D}";
+    InvokeInfo.nShow = SW_SHOWNORMAL;
+    hr = pCM->InvokeCommand(&InvokeInfo);
+    pCM->Release();
+
+    return SUCCEEDED(hr);
+}

Reply via email to