[SHELL32][STOBJECT] Enforce ShellExecuteW(..., file, parameters, ...)

CORE-16299
This commit is contained in:
Serge Gautherie 2019-08-15 22:21:21 +02:00 committed by Mark Jansen
parent 343442cc3f
commit cb77f1701f
4 changed files with 42 additions and 8 deletions

View 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)

View 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()

View 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)
{

View 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]))
{