[NETSHELL][SHELL32] Make NetShell PIDL format more Windows compatible (#7183)

- The PIDL format needs to be Windows compatible so that wlanwiz can get the connection GUID.
- SHELL32::ILIsEqual cannot deem PIDL formats it does not understand as invalid.
- DefView must ask the folder when comparing PIDLs.
This commit is contained in:
Whindmar Saksit
2024-08-08 22:00:03 +02:00
committed by GitHub
parent 5d96ba9217
commit ea60890961
7 changed files with 144 additions and 26 deletions

View File

@@ -1290,15 +1290,29 @@ PCUITEMID_CHILD CDefView::_PidlByItem(LVITEM& lvItem)
int CDefView::LV_FindItemByPidl(PCUITEMID_CHILD pidl)
{
ASSERT(m_ListView);
ASSERT(m_ListView && m_pSFParent);
int cItems = m_ListView.GetItemCount();
for (int i = 0; i<cItems; i++)
LPARAM lParam = m_pSF2Parent ? SHCIDS_CANONICALONLY : 0;
for (int i = 0; i < cItems; i++)
{
PCUITEMID_CHILD currentpidl = _PidlByItem(i);
if (ILIsEqual(pidl, currentpidl))
return i;
HRESULT hr = m_pSFParent->CompareIDs(lParam, pidl, currentpidl);
if (SUCCEEDED(hr))
{
if (hr == S_EQUAL)
return i;
}
else
{
for (i = 0; i < cItems; i++)
{
currentpidl = _PidlByItem(i);
if (ILIsEqual(pidl, currentpidl))
return i;
}
break;
}
}
return -1;
}