mirror of
https://github.com/reactos/reactos.git
synced 2024-12-27 09:34:43 +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");
|
DPRINT("HotkeyThread start\n");
|
||||||
|
|
||||||
hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
|
hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
|
||||||
|
|
||||||
if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
|
if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
|
||||||
DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
|
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)
|
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) };
|
STARTUPINFOW si = { sizeof(si) };
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
|
|
||||||
if (CreateProcessW(L"cmd.exe",
|
if (CreateProcessW(NULL,
|
||||||
NULL,
|
CmdLine,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
|
|
@ -1049,19 +1049,19 @@ HotkeyThread(LPVOID Parameter)
|
||||||
DPRINT("HotkeyThread start\n");
|
DPRINT("HotkeyThread start\n");
|
||||||
|
|
||||||
hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
|
hotkey = GlobalAddAtomW(L"Setup Shift+F10 Hotkey");
|
||||||
|
|
||||||
if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
|
if (!RegisterHotKey(NULL, hotkey, MOD_SHIFT, VK_F10))
|
||||||
DPRINT1("RegisterHotKey failed with %lu\n", GetLastError());
|
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)
|
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) };
|
STARTUPINFOW si = { sizeof(si) };
|
||||||
PROCESS_INFORMATION pi;
|
PROCESS_INFORMATION pi;
|
||||||
|
|
||||||
if (CreateProcessW(L"cmd.exe",
|
if (CreateProcessW(NULL,
|
||||||
NULL,
|
CmdLine,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
NULL,
|
||||||
FALSE,
|
FALSE,
|
||||||
|
|
Loading…
Reference in a new issue