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)