From fc4054d9e94b76b33bf134cbae85d08e3094edc4 Mon Sep 17 00:00:00 2001 From: Johannes Anderwald Date: Mon, 17 Oct 2011 13:22:20 +0000 Subject: [PATCH] - Fix launching of properties dialog in the detail view - Based on Edijus patch (terminedijsatyahoodotcom) See issue #6571 for more details. svn path=/trunk/; revision=54176 --- reactos/dll/win32/shell32/fprop.cpp | 13 +++++++++++++ reactos/dll/win32/shell32/shv_def_cmenu.cpp | 2 +- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/reactos/dll/win32/shell32/fprop.cpp b/reactos/dll/win32/shell32/fprop.cpp index 7eee167172a..26b2871c93c 100644 --- a/reactos/dll/win32/shell32/fprop.cpp +++ b/reactos/dll/win32/shell32/fprop.cpp @@ -846,6 +846,7 @@ SH_ShowPropertiesDialog(WCHAR *lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *api INT_PTR res; CComPtr pDataObj; HRESULT hResult; + DWORD wLength; TRACE("SH_ShowPropertiesDialog entered filename %s\n", debugstr_w(lpf)); @@ -873,6 +874,18 @@ SH_ShowPropertiesDialog(WCHAR *lpf, LPCITEMIDLIST pidlFolder, LPCITEMIDLIST *api wcscpy(wFileName, lpf); } + // + // get length + // + wLength = wcslen(wFileName); + if (wFileName[wLength-1] == L'\\' && wLength > 3) + { + // + // remove trailing \\ at the end of path + // + wFileName[wLength-1] = L'\0'; + } + if (PathIsDirectoryW(wFileName)) { return SH_ShowFolderProperties(wFileName, pidlFolder, apidl); diff --git a/reactos/dll/win32/shell32/shv_def_cmenu.cpp b/reactos/dll/win32/shell32/shv_def_cmenu.cpp index b50c1c1cb2f..61fcc495fd7 100644 --- a/reactos/dll/win32/shell32/shv_def_cmenu.cpp +++ b/reactos/dll/win32/shell32/shv_def_cmenu.cpp @@ -1435,7 +1435,7 @@ IDefaultContextMenuImpl::DoProperties( ShellExecuteW(lpcmi->hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL sysdm.cpl", NULL, NULL, SW_SHOWNORMAL); return S_OK; } - else if (dcm.cidl == 0 && _ILIsDesktop(dcm.pidlFolder)) + else if (dcm.cidl == 0 && dcm.pidlFolder != NULL && _ILIsDesktop(dcm.pidlFolder)) { ShellExecuteW(lpcmi->hwnd, L"open", L"rundll32.exe shell32.dll,Control_RunDLL desk.cpl", NULL, NULL, SW_SHOWNORMAL); return S_OK;