[SHELL32] ShellExecCmdLine: Use SearchPathW (#7166)

Based on @Doug-Lyons
shlexec-winR-fonts.patch.
#4932 (f691efe) introduced
some regression.
JIRA issue: CORE-19688
Call SearchPathW function before
PathFindOnPathExW call in
ShellExecCmdLine function.
This commit is contained in:
Katayama Hirofumi MZ
2024-07-23 15:08:16 +09:00
committed by GitHub
parent 6219a1abe5
commit b40046f426
+4 -3
View File
@@ -2714,9 +2714,10 @@ HRESULT WINAPI ShellExecCmdLine(
SetCurrentDirectoryW(pwszStartDir);
}
if (PathIsRelativeW(szFile) &&
GetFullPathNameW(szFile, _countof(szFile2), szFile2, NULL) &&
PathFileExistsW(szFile2))
if ((PathIsRelativeW(szFile) &&
GetFullPathNameW(szFile, _countof(szFile2), szFile2, NULL) &&
PathFileExistsW(szFile2)) ||
SearchPathW(NULL, szFile, NULL, _countof(szFile2), szFile2, NULL))
{
StringCchCopyW(szFile, _countof(szFile), szFile2);
}