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

commit ad5df2d1996b619d5bbef69d8d58985694f16a1a
Author:     Katayama Hirofumi MZ <katayama.hirofumi...@gmail.com>
AuthorDate: Sat Oct 28 14:56:27 2023 +0900
Commit:     GitHub <nore...@github.com>
CommitDate: Sat Oct 28 14:56:27 2023 +0900

    [SHELL32][SDK] Implement Activate_RunDLL (#5840)
    
    - Add Activate_RunDLL function implementation.
    - Add Activate_RunDLL prototype to <undocshell.h>.
---
 dll/win32/shell32/stubs.cpp      | 11 -----------
 dll/win32/shell32/utils.cpp      | 27 +++++++++++++++++++++++++++
 sdk/include/reactos/undocshell.h |  7 +++++++
 3 files changed, 34 insertions(+), 11 deletions(-)

diff --git a/dll/win32/shell32/stubs.cpp b/dll/win32/shell32/stubs.cpp
index ee4452a9277..bae11321006 100644
--- a/dll/win32/shell32/stubs.cpp
+++ b/dll/win32/shell32/stubs.cpp
@@ -801,17 +801,6 @@ SHIsBadInterfacePtr(LPVOID pv, UINT ucb)
     return FALSE;
 }
 
-/*
- * Unimplemented
- */
-EXTERN_C BOOL
-WINAPI
-Activate_RunDLL(DWORD dwProcessId, LPVOID lpUnused1, LPVOID lpUnused2, LPVOID 
lpUnused3)
-{
-    FIXME("Activate_RunDLL() stub\n");
-    return FALSE;
-}
-
 /*
  * Unimplemented
  */
diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp
index 215be665a6c..7007ee78ca2 100644
--- a/dll/win32/shell32/utils.cpp
+++ b/dll/win32/shell32/utils.cpp
@@ -577,3 +577,30 @@ SHOpenPropSheetA(
     return SHOpenPropSheetW(pszCaptionW, ahKeys, cKeys, pclsidDefault,
                             pDataObject, pShellBrowser, pszStartPageW);
 }
+
+/*************************************************************************
+ *  Activate_RunDLL [SHELL32.105]
+ *
+ * Unlocks the foreground window and allows the shell window to become the
+ * foreground window. Every parameter is unused.
+ */
+EXTERN_C
+BOOL WINAPI
+Activate_RunDLL(
+    _In_ DWORD dwUnused1,
+    _In_ LPVOID lpUnused2,
+    _In_ LPVOID lpUnused3,
+    _In_ LPVOID lpUnused4)
+{
+    DWORD dwPID;
+
+    UNREFERENCED_PARAMETER(dwUnused1);
+    UNREFERENCED_PARAMETER(lpUnused2);
+    UNREFERENCED_PARAMETER(lpUnused3);
+    UNREFERENCED_PARAMETER(lpUnused4);
+
+    TRACE("(%lu, %p, %p, %p)\n", dwUnused1, lpUnused2, lpUnused3, lpUnused4);
+
+    GetWindowThreadProcessId(GetShellWindow(), &dwPID);
+    return AllowSetForegroundWindow(dwPID);
+}
diff --git a/sdk/include/reactos/undocshell.h b/sdk/include/reactos/undocshell.h
index a8dc8c2c145..b0391380d80 100644
--- a/sdk/include/reactos/undocshell.h
+++ b/sdk/include/reactos/undocshell.h
@@ -720,6 +720,13 @@ BOOL WINAPI
 SHTestTokenPrivilegeW(_In_opt_ HANDLE hToken, _In_z_ LPCWSTR lpName);
 BOOL WINAPI IsSuspendAllowed(VOID);
 
+BOOL WINAPI
+Activate_RunDLL(
+    _In_ DWORD dwUnused1,
+    _In_ LPVOID lpUnused2,
+    _In_ LPVOID lpUnused3,
+    _In_ LPVOID lpUnused4);
+
 /*****************************************************************************
  * Shell32 resources
  */

Reply via email to