mirror of
https://github.com/reactos/reactos.git
synced 2024-12-26 00:54:40 +00:00
[SETUP:REACTOS][SYSSETUP] Fix Shift-F10 cmd.exe invocation.
Pressing Shift-F10 to open cmd.exe when the setup program runs from a different current directory than System32, now works correctly. Use the 2nd CreateProcessW() `lpCommandLine` parameter, instead of the 1st parameter `lpApplicationName`, so as to use default path search. The command-line buffer given to the 2nd-parameter can be temporarily modified by CreateProcessW(), thus use an on-stack buffer. https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-createprocessw#parameters
This commit is contained in:
parent
d7f1a784a8
commit
3b800165b0
2 changed files with 7 additions and 7 deletions
|
@ -2762,7 +2762,6 @@ HotkeyThread(LPVOID Parameter)
|
|||
DPRINT("HotkeyThread start\n");
|
||||
|
||||
hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
|
||||
|
||||
if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
|
||||
DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
|
||||
|
||||
|
@ -2770,11 +2769,12 @@ HotkeyThread(LPVOID Parameter)
|
|||
{
|
||||
if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
|
||||
{
|
||||
WCHAR CmdLine[] = L"cmd.exe"; // CreateProcess can modify this buffer.
|
||||
STARTUPINFOW si = { sizeof(si) };
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
if (CreateProcessW(L"cmd.exe",
|
||||
NULL,
|
||||
if (CreateProcessW(NULL,
|
||||
CmdLine,
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
|
|
|
@ -1049,19 +1049,19 @@ HotkeyThread(LPVOID Parameter)
|
|||
DPRINT("HotkeyThread start\n");
|
||||
|
||||
hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
|
||||
|
||||
if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
|
||||
DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
|
||||
|
||||
while (GetMessage(&msg, NULL, 0, 0))
|
||||
while (GetMessageW(&msg, NULL, 0, 0))
|
||||
{
|
||||
if (msg.hwnd == NULL && msg.message == WM_HOTKEY && msg.wParam == hotkey)
|
||||
{
|
||||
WCHAR CmdLine[] = L"cmd.exe"; // CreateProcess can modify this buffer.
|
||||
STARTUPINFOW si = { sizeof(si) };
|
||||
PROCESS_INFORMATION pi;
|
||||
|
||||
if (CreateProcessW(L"cmd.exe",
|
||||
NULL,
|
||||
if (CreateProcessW(NULL,
|
||||
CmdLine,
|
||||
NULL,
|
||||
NULL,
|
||||
FALSE,
|
||||
|
|
Loading…
Reference in a new issue