Skip to content

Commit 70422cd

Browse files
committed
[SHELL32] Fix starting disk cleanup from drive properties
CORE-12314
1 parent 97e7efc commit 70422cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

dll/win32/shell32/dialogs/drvdefext.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -553,8 +553,13 @@ CDrvDefExt::GeneralPageProc(
553553
WCHAR wszCmd[MAX_PATH];
554554

555555
StringCbPrintfW(wszCmd, sizeof(wszCmd), wszBuf, pDrvDefExt->m_wszDrive[0]);
556+
WCHAR* wszArgs = PathGetArgsW(wszCmd);
557+
if (wszArgs && *wszArgs && wszArgs != wszCmd)
558+
wszArgs[-1] = UNICODE_NULL;
559+
else
560+
wszArgs = NULL;
556561

557-
if (ShellExecuteW(hwndDlg, NULL, wszCmd, NULL, NULL, SW_SHOW) <= (HINSTANCE)32)
562+
if (ShellExecuteW(hwndDlg, NULL, wszCmd, wszArgs, NULL, SW_SHOW) <= (HINSTANCE)32)
558563
ERR("Failed to create cleanup process %ls\n", wszCmd);
559564
}
560565
}

0 commit comments

Comments
 (0)