From 53edadb8c0ce1ced5faedcd5080b1a65d3f85212 Mon Sep 17 00:00:00 2001 From: Stanislav Motylkov Date: Sat, 2 Dec 2017 23:54:35 +0300 Subject: [PATCH] [BROWSEUI] SHExplorerParseCmdLine: Improve relative path handling CORE-12882, CORE-13847 --- dll/win32/browseui/parsecmdline.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/dll/win32/browseui/parsecmdline.cpp b/dll/win32/browseui/parsecmdline.cpp index d2a0d2f9b3b..acf617607fe 100644 --- a/dll/win32/browseui/parsecmdline.cpp +++ b/dll/win32/browseui/parsecmdline.cpp @@ -382,6 +382,12 @@ SHExplorerParseCmdLine(ExplorerCommandLineParseResults * pInfo) { // Or just a plain old string. + WCHAR szPath[MAX_PATH]; + DWORD result = GetFullPathNameW(strField, _countof(szPath), szPath, NULL); + + if (result != 0 && result <= _countof(szPath) && PathFileExistsW(szPath)) + StringCchCopyW(strField, _countof(strField), szPath); + LPITEMIDLIST pidlPath = ILCreateFromPathW(strField); pInfo->pidlPath = pidlPath;