From 35dbdaaa0ee79f4fb064bc10446b75961369168e Mon Sep 17 00:00:00 2001 From: Joachim Henze Date: Fri, 11 Sep 2020 02:24:42 +0200 Subject: [PATCH] [SHELL32] Fix regression CORE-12364 The sorting in explorer broke by SVN r73128 == git 24fcf531e78423b314a2d6a4ac750df69e478e3a Thanks to Doug Lyons for providing this patch. I do intend to port it back into 0.4.14RC. --- dll/win32/shell32/folders/CRegFolder.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dll/win32/shell32/folders/CRegFolder.cpp b/dll/win32/shell32/folders/CRegFolder.cpp index 6398109247d..6dc12770212 100644 --- a/dll/win32/shell32/folders/CRegFolder.cpp +++ b/dll/win32/shell32/folders/CRegFolder.cpp @@ -474,7 +474,15 @@ HRESULT WINAPI CRegFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, P } /* Guid folders come first compared to everything else */ - return MAKE_COMPARE_HRESULT(clsid1 ? -1 : 1); + /* And Drives come before folders in My Computer */ + if (_ILIsMyComputer(m_pidlRoot)) + { + return MAKE_COMPARE_HRESULT(clsid1 ? 1 : -1); + } + else + { + return MAKE_COMPARE_HRESULT(clsid1 ? -1 : 1); + } } HRESULT WINAPI CRegFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)