[SHELL32] Correctly compare pidls for SHBrowseForFolder BFFM_SETEXPANDED (#7499)

_ILIsEqualSimple just does a memcmp and that does not work for all items.

Should improve shell change notifications (CORE-13950).
This commit is contained in:
Whindmar Saksit 2024-11-16 16:28:28 +01:00 committed by GitHub
parent 81860b482a
commit 6d109254ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 298 additions and 115 deletions

View file

@ -277,6 +277,18 @@ SHGetAttributes(_In_ IShellFolder *psf, _In_ LPCITEMIDLIST pidl, _In_ DWORD dwAt
return dwAttributes;
}
HRESULT SHELL_GetIDListTarget(_In_ LPCITEMIDLIST pidl, _Out_ PIDLIST_ABSOLUTE *ppidl)
{
IShellLink *pSL;
HRESULT hr = SHBindToObject(NULL, pidl, IID_PPV_ARG(IShellLink, &pSL));
if (SUCCEEDED(hr))
{
hr = pSL->GetIDList(ppidl); // Note: Returns S_FALSE if no target pidl
pSL->Release();
}
return hr;
}
HRESULT SHCoInitializeAnyApartment(VOID)
{
HRESULT hr = CoInitializeEx(NULL, COINIT_APARTMENTTHREADED | COINIT_DISABLE_OLE1DDE);