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

commit cb77f1701fea36e872a0be3a3a89b324cce4748c
Author:     Serge Gautherie <[email protected]>
AuthorDate: Thu Aug 15 22:21:21 2019 +0200
Commit:     Mark Jansen <[email protected]>
CommitDate: Mon Aug 19 13:01:08 2019 +0200

    [SHELL32][STOBJECT] Enforce ShellExecuteW(..., file, parameters, ...)
    
    CORE-16299
---
 dll/shellext/stobject/hotplug.cpp           |  7 ++++++-
 dll/shellext/stobject/volume.cpp            |  7 ++++++-
 dll/win32/shell32/folders/CDrivesFolder.cpp |  7 ++++++-
 dll/win32/shell32/folders/CRegFolder.cpp    | 29 ++++++++++++++++++++++++-----
 4 files changed, 42 insertions(+), 8 deletions(-)

diff --git a/dll/shellext/stobject/hotplug.cpp 
b/dll/shellext/stobject/hotplug.cpp
index 03348f92d2f..b2202c99d44 100644
--- a/dll/shellext/stobject/hotplug.cpp
+++ b/dll/shellext/stobject/hotplug.cpp
@@ -155,7 +155,12 @@ HRESULT STDMETHODCALLTYPE Hotplug_Shutdown(_In_ CSysTray * 
pSysTray)
 
 static void _RunHotplug(CSysTray * pSysTray)
 {
-    ShellExecuteW(pSysTray->GetHWnd(), L"open", L"rundll32.exe 
shell32.dll,Control_RunDLL hotplug.dll", NULL, NULL, SW_SHOWNORMAL);
+    ShellExecuteW(pSysTray->GetHWnd(),
+                  L"open",
+                  L"rundll32.exe",
+                  L"shell32.dll,Control_RunDLL hotplug.dll",
+                  NULL,
+                  SW_SHOWNORMAL);
 }
 
 static void _ShowContextMenu(CSysTray * pSysTray)
diff --git a/dll/shellext/stobject/volume.cpp b/dll/shellext/stobject/volume.cpp
index 04723a7be26..4b63e05a6b1 100644
--- a/dll/shellext/stobject/volume.cpp
+++ b/dll/shellext/stobject/volume.cpp
@@ -211,7 +211,12 @@ HRESULT Volume_OnDeviceChange(_In_ CSysTray * pSysTray, 
WPARAM wParam, LPARAM lP
 
 static void _RunVolume(BOOL bTray)
 {
-    ShellExecuteW(NULL, NULL, bTray ? L"sndvol32.exe /t" : L"sndvol32.exe", 
NULL, NULL, SW_SHOWNORMAL);
+    ShellExecuteW(NULL,
+                  NULL,
+                  L"sndvol32.exe",
+                  bTray ? L"/t" : NULL,
+                  NULL,
+                  SW_SHOWNORMAL);
 }
 
 static void _RunMMCpl()
diff --git a/dll/win32/shell32/folders/CDrivesFolder.cpp 
b/dll/win32/shell32/folders/CDrivesFolder.cpp
index 15ccef2da80..17542eeea41 100644
--- a/dll/win32/shell32/folders/CDrivesFolder.cpp
+++ b/dll/win32/shell32/folders/CDrivesFolder.cpp
@@ -1087,7 +1087,12 @@ HRESULT WINAPI CDrivesFolder::CallBack(IShellFolder 
*psf, HWND hwndOwner, IDataO
         if (uMsg == DFM_INVOKECOMMAND && wParam == 1)   // #1
         {
             // "System" properties
-            ShellExecuteW(hwndOwner, NULL, L"rundll32.exe 
shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL);
+            ShellExecuteW(hwndOwner,
+                          NULL,
+                          L"rundll32.exe",
+                          L"shell32.dll,Control_RunDLL sysdm.cpl",
+                          NULL,
+                          SW_SHOWNORMAL);
         }
         else if (uMsg == DFM_MERGECONTEXTMENU)
         {
diff --git a/dll/win32/shell32/folders/CRegFolder.cpp 
b/dll/win32/shell32/folders/CRegFolder.cpp
index fc8eba29fe7..33539816b11 100644
--- a/dll/win32/shell32/folders/CRegFolder.cpp
+++ b/dll/win32/shell32/folders/CRegFolder.cpp
@@ -41,21 +41,40 @@ HRESULT CALLBACK RegFolderContextMenuCallback(IShellFolder 
*psf,
 
     if (_ILIsMyComputer(apidl[0]))
     {
-        if (32 >= (UINT_PTR)ShellExecuteW(hwnd, L"open", L"rundll32.exe 
shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL))
+        if (32 >= (UINT_PTR)ShellExecuteW(hwnd,
+                                          L"open",
+                                          L"rundll32.exe",
+                                          L"shell32.dll,Control_RunDLL 
sysdm.cpl",
+                                          NULL,
+                                          SW_SHOWNORMAL))
+        {
             hr = E_FAIL;
+        }
     }
     else if (_ILIsDesktop(apidl[0]))
     {
-        if (32 >= (UINT_PTR)ShellExecuteW(hwnd, L"open", L"rundll32.exe 
shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL))
+        if (32 >= (UINT_PTR)ShellExecuteW(hwnd,
+                                          L"open",
+                                          L"rundll32.exe",
+                                          L"shell32.dll,Control_RunDLL 
desk.cpl",
+                                          NULL,
+                                          SW_SHOWNORMAL))
+        {
             hr = E_FAIL;
+        }
     }
     else if (_ILIsNetHood(apidl[0]))
     {
         // FIXME path!
-        if (32 >= (UINT_PTR)ShellExecuteW(NULL, L"open", L"explorer.exe",
-                                      
L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}",
-                                      NULL, SW_SHOWDEFAULT))
+        if (32 >= (UINT_PTR)ShellExecuteW(NULL,
+                                          L"open",
+                                          L"explorer.exe",
+                                          
L"::{7007ACC7-3202-11D1-AAD2-00805FC1270E}",
+                                          NULL,
+                                          SW_SHOWDEFAULT))
+        {
             hr = E_FAIL;
+        }
     }
     else if (_ILIsBitBucket(apidl[0]))
     {

Reply via email to