mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:45:39 +00:00
[SHELL32] Fix 'Run' dialog crash (#1117)
Running "%SYSTEMROOT%" sometimes crashed. This will fix it. CORE-15431
This commit is contained in:
parent
25578b7d12
commit
472787ffea
1 changed files with 4 additions and 4 deletions
|
@ -578,7 +578,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
|
|
||||||
if (wcschr(psz, L'%') != NULL)
|
if (wcschr(psz, L'%') != NULL)
|
||||||
{
|
{
|
||||||
cchExpand = ExpandEnvironmentStringsW(psz, NULL, 0);
|
cchExpand = ExpandEnvironmentStringsW(psz, NULL, 0) + 1;
|
||||||
pszExpanded = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, cchExpand * sizeof(WCHAR));
|
pszExpanded = (WCHAR*)HeapAlloc(GetProcessHeap(), 0, cchExpand * sizeof(WCHAR));
|
||||||
if (!pszExpanded)
|
if (!pszExpanded)
|
||||||
{
|
{
|
||||||
|
@ -604,7 +604,7 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
if (prfdp->lpstrDirectory)
|
if (prfdp->lpstrDirectory)
|
||||||
pszStartDir = prfdp->lpstrDirectory;
|
pszStartDir = prfdp->lpstrDirectory;
|
||||||
else if (prfdp->uFlags & RFF_CALCDIRECTORY)
|
else if (prfdp->uFlags & RFF_CALCDIRECTORY)
|
||||||
pszStartDir = parent = RunDlg_GetParentDir(psz);
|
pszStartDir = parent = RunDlg_GetParentDir(pszExpanded);
|
||||||
else
|
else
|
||||||
pszStartDir = NULL;
|
pszStartDir = NULL;
|
||||||
|
|
||||||
|
@ -640,8 +640,8 @@ static INT_PTR CALLBACK RunDlgProc(HWND hwnd, UINT message, WPARAM wParam, LPARA
|
||||||
SECL_ALLOW_NONEXE)))
|
SECL_ALLOW_NONEXE)))
|
||||||
{
|
{
|
||||||
/* Call again GetWindowText in case the contents of the edit box has changed? */
|
/* Call again GetWindowText in case the contents of the edit box has changed? */
|
||||||
GetWindowTextW(htxt, pszExpanded, ic + 1);
|
GetWindowTextW(htxt, psz, ic + 1);
|
||||||
FillList(htxt, pszExpanded, ic + 2 + 1, FALSE);
|
FillList(htxt, psz, ic + 2 + 1, FALSE);
|
||||||
EndDialog(hwnd, IDOK);
|
EndDialog(hwnd, IDOK);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue