https://git.reactos.org/?p=reactos.git;a=commitdiff;h=ca087b6a189f9c665e31f…
commit ca087b6a189f9c665e31fa29130e84e21035a536
Author: Mark Jansen <mark.jansen(a)reactos.org>
AuthorDate: Sun Sep 13 14:30:04 2020 +0200
Commit: Mark Jansen <mark.jansen(a)reactos.org>
CommitDate: Sun Oct 4 19:34:20 2020 +0200
[BROWSEUI] Update the current directory before creating a view
This way, when the view asks for a directory _during creation_ it
does not get either an old, or an invalid directory
CORE-17270
---
dll/win32/browseui/shellbrowser.cpp | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dll/win32/browseui/shellbrowser.cpp b/dll/win32/browseui/shellbrowser.cpp
index 8ef99aae6f0..c559c2ed5fb 100644
--- a/dll/win32/browseui/shellbrowser.cpp
+++ b/dll/win32/browseui/shellbrowser.cpp
@@ -974,6 +974,10 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
ZeroMemory(&shellViewWindowBounds, sizeof(shellViewWindowBounds));
::MapWindowPoints(0, m_hWnd, reinterpret_cast<POINT
*>(&shellViewWindowBounds), 2);
+ // update current pidl
+ ILFree(fCurrentDirectoryPIDL);
+ fCurrentDirectoryPIDL = ILClone(absolutePIDL);
+
// create view window
hResult = newShellView->CreateViewWindow(saveCurrentShellView, folderSettings,
this, &shellViewWindowBounds, &newShellViewWindow);
@@ -988,10 +992,6 @@ HRESULT CShellBrowser::BrowseToPath(IShellFolder *newShellFolder,
return hResult;
}
- // update current pidl
- ILFree(fCurrentDirectoryPIDL);
- fCurrentDirectoryPIDL = ILClone(absolutePIDL);
-
// update view window
if (saveCurrentShellView != NULL)
saveCurrentShellView->DestroyViewWindow();