[SHELL32] Don't close Run dialog on execution failure (#7686)

CORE-19983
This commit is contained in:
Whindmar Saksit 2025-01-31 12:52:20 +01:00 committed by GitHub
parent dddceeb10d
commit 6265add147
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -583,7 +583,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
INT ic;
WCHAR *psz, *pszExpanded, *parent = NULL;
DWORD cchExpand;
SHELLEXECUTEINFOW sei;
SHELLEXECUTEINFOW sei = { sizeof(sei) };
NMRUNFILEDLGW nmrfd;
ic = GetWindowTextLengthW(htxt);
@ -593,9 +593,6 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
return TRUE;
}
ZeroMemory(&sei, sizeof(sei));
sei.cbSize = sizeof(sei);
/*
* Allocate a new MRU entry, we need to add two characters
* for the terminating "\\1" part, then the NULL character.
@ -694,7 +691,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
EndDialog(hwnd, IDOK);
break;
}
else if (SUCCEEDED(ShellExecuteExW(&sei)))
else if (ShellExecuteExW(&sei))
{
/* Call GetWindowText again in case the contents of the edit box have changed. */
GetWindowTextW(htxt, psz, ic + 1);