[SHELL32][STOBJECT] Enforce ShellExecuteW(..., file, parameters, ...)
authorSerge Gautherie <reactos-git_serge_171003@gautherie.fr>
Thu, 15 Aug 2019 20:21:21 +0000 (22:21 +0200)
committerMark Jansen <mark.jansen@reactos.org>
Mon, 19 Aug 2019 11:01:08 +0000 (13:01 +0200)
CORE-16299

dll/shellext/stobject/hotplug.cpp
dll/shellext/stobject/volume.cpp
dll/win32/shell32/folders/CDrivesFolder.cpp
dll/win32/shell32/folders/CRegFolder.cpp

index 03348f9..b2202c9 100644 (file)
@@ -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)
index 04723a7..4b63e05 100644 (file)
@@ -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()
index 15ccef2..17542ee 100644 (file)
@@ -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)
         {
index fc8eba2..3353981 100644 (file)
@@ -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]))
     {