From 3c58a339dce009266640dead97075e4ff4894f40 Mon Sep 17 00:00:00 2001 From: Giannis Adamopoulos Date: Sun, 6 Nov 2016 20:13:17 +0000 Subject: [PATCH] [SHELL32] - CDesktopBrowser: The flags that SHOpenNewFrame takes are the same that SHExplorerParseCmdLine returns, not the SBSP_ ones. [BROWSEUI] - Move the hack to fill the parsed pidl if none was found to SHCreateFromDesktop. - Convert the SH_EXPLORER_CMDLINE_FLAG_E flag to a SBSP_EXPLOREMODE and pass it to the CShellBrowser. svn path=/trunk/; revision=73157 --- reactos/dll/win32/browseui/desktopipc.cpp | 16 ++++++++++------ .../shell32/shelldesktop/CDesktopBrowser.cpp | 3 ++- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/reactos/dll/win32/browseui/desktopipc.cpp b/reactos/dll/win32/browseui/desktopipc.cpp index 23ef724fd50..fbe7eb2314e 100644 --- a/reactos/dll/win32/browseui/desktopipc.cpp +++ b/reactos/dll/win32/browseui/desktopipc.cpp @@ -357,13 +357,11 @@ static HRESULT ExplorerMessageLoop(IEThreadParamBlock * parameters) if (parameters && parameters->offsetF8) parameters->offsetF8->AddRef(); - // HACK! This shouldn't happen! SHExplorerParseCmdLine needs fixing. - if (!parameters->directoryPIDL) - { - SHGetFolderLocation(NULL, CSIDL_PERSONAL, NULL, NULL, ¶meters->directoryPIDL); - } + UINT wFlags = 0; + if ((parameters->dwFlags & SH_EXPLORER_CMDLINE_FLAG_E)) + wFlags |= SBSP_EXPLOREMODE; - hResult = CShellBrowser_CreateInstance(parameters->directoryPIDL, parameters->dwFlags, IID_PPV_ARG(IBrowserService2, &browser)); + hResult = CShellBrowser_CreateInstance(parameters->directoryPIDL, wFlags, IID_PPV_ARG(IBrowserService2, &browser)); if (FAILED_UNEXPECTEDLY(hResult)) return hResult; @@ -609,6 +607,12 @@ BOOL WINAPI SHCreateFromDesktop(ExplorerCommandLineParseResults * parseResults) } } + // HACK! This shouldn't happen! SHExplorerParseCmdLine needs fixing. + if (!pidl) + { + SHGetFolderLocation(NULL, CSIDL_PERSONAL, NULL, NULL, &pidl); + } + parameters->directoryPIDL = pidl; // Try to find the owner of the idlist, if we aren't running /SEPARATE diff --git a/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp b/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp index fe64747c6c2..8079d2263f8 100644 --- a/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp +++ b/reactos/dll/win32/shell32/shelldesktop/CDesktopBrowser.cpp @@ -284,7 +284,8 @@ HRESULT STDMETHODCALLTYPE CDesktopBrowser::BrowseObject(LPCITEMIDLIST pidl, UINT * find an open shell window that shows the requested pidl and activate it */ - return SHOpenNewFrame((LPITEMIDLIST)pidl, NULL, 0, wFlags); + DWORD dwFlags = ((wFlags & SBSP_EXPLOREMODE) != 0) ? SH_EXPLORER_CMDLINE_FLAG_E : 0; + return SHOpenNewFrame((LPITEMIDLIST)pidl, NULL, 0, dwFlags); } HRESULT STDMETHODCALLTYPE CDesktopBrowser::GetViewStateStream(DWORD grfMode, IStream **ppStrm) -- 2.17.1