https://git.reactos.org/?p=reactos.git;a=commitdiff;h=6265add14704b955b9ea325713ec6e6f6e0e7e10

commit 6265add14704b955b9ea325713ec6e6f6e0e7e10
Author:     Whindmar Saksit <whinds...@proton.me>
AuthorDate: Fri Jan 31 12:52:20 2025 +0100
Commit:     GitHub <nore...@github.com>
CommitDate: Fri Jan 31 12:52:20 2025 +0100

    [SHELL32] Don't close Run dialog on execution failure (#7686)
    
    CORE-19983
---
 dll/win32/shell32/dialogs/dialogs.cpp | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/dll/win32/shell32/dialogs/dialogs.cpp 
b/dll/win32/shell32/dialogs/dialogs.cpp
index a01a442a500..44f8935211a 100644
--- a/dll/win32/shell32/dialogs/dialogs.cpp
+++ b/dll/win32/shell32/dialogs/dialogs.cpp
@@ -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);

Reply via email to