Skip to content

Commit c25856d

Browse files
authored
[BROWSEUI] Fix CompareIDs lParam passed to inner folder (reactos#8161)
CORE-20250
1 parent 1378f6b commit c25856d

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

dll/win32/browseui/shellfind/CFindFolder.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -845,7 +845,7 @@ STDMETHODIMP CFindFolder::GetDetailsOf(PCUITEMID_CHILD pidl, UINT iColumn, SHELL
845845
if (iColumn == COL_RELEVANCE_INDEX)
846846
{
847847
// TODO: Fill once the relevance is calculated
848-
return SHSetStrRet(&pDetails->str, "");
848+
return SHSetStrRetEmpty(&pDetails->str);
849849
}
850850

851851
ATLASSERT(iColumn == COL_NAME_INDEX);
@@ -903,8 +903,7 @@ STDMETHODIMP CFindFolder::CompareIDs(LPARAM lParam, PCUIDLIST_RELATIVE pidl1, PC
903903
wColumn -= _countof(g_ColumnDefs) - 1;
904904
break;
905905
}
906-
// FIXME: DefView does not like the way we sort
907-
return m_pisfInner->CompareIDs(HIWORD(lParam) | wColumn, _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
906+
return m_pisfInner->CompareIDs(MAKELONG(wColumn, HIWORD(lParam)), _ILGetFSPidl(pidl1), _ILGetFSPidl(pidl2));
908907
}
909908

910909
STDMETHODIMP CFindFolder::CreateViewObject(HWND hwndOwner, REFIID riid, LPVOID *ppvOut)

dll/win32/browseui/shellfind/CSearchBar.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,8 @@ void CSearchBar::TrySetFocus(UINT Source)
885885
{
886886
BOOL IsOnButton = GetDlgItem(IDC_SEARCH_BUTTON) == hWndFocus;
887887
BOOL IsOnSelfPane = hWndFocus == m_hWnd;
888-
if (!hWndFocus || IsOnSelfPane || IsOnButton || !IsWindowChildOf(hWndFocus, m_hWnd))
889-
SendMessageW(WM_NEXTDLGCTL, (WPARAM)GetDlgItem(IDC_SEARCH_FILENAME), TRUE);
888+
BOOL IsInPaneChild = hWndFocus && IsWindowChildOf(hWndFocus, m_hWnd);
889+
if ((cItems == 0 && !IsInPaneChild) || IsOnSelfPane || IsOnButton)
890+
SendMessage(WM_NEXTDLGCTL, (WPARAM)GetDlgItem(IDC_SEARCH_FILENAME), TRUE);
890891
}
891892
}

dll/win32/shell32/CDefView.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1365,13 +1365,14 @@ int CDefView::LV_FindItemByPidl(PCUITEMID_CHILD pidl)
13651365
}
13661366
else
13671367
{
1368-
for (i = 0; i < cItems; i++)
1368+
#if DBG
1369+
for (i = 0; pidl && i < cItems; i++)
13691370
{
1370-
//FIXME: ILIsEqual needs absolute pidls!
13711371
currentpidl = _PidlByItem(i);
1372-
if (ILIsEqual(pidl, currentpidl))
1373-
return i;
1372+
if (currentpidl && currentpidl->mkid.cb == pidl->mkid.cb && !memcmp(currentpidl, pidl, pidl->mkid.cb))
1373+
DbgPrint("Matched item #%d, broken CompareIDs?\n", i);
13741374
}
1375+
#endif
13751376
break;
13761377
}
13771378
}

0 commit comments

Comments
 (0)