[SHELL32] SEE_MASK_IDLIST should not assume the PIDL is always a FS path (#7693)

CORE-16898 CORE-14177
This commit is contained in:
Whindmar Saksit 2025-01-31 21:15:13 +01:00 committed by GitHub
parent 6265add147
commit f335322ace
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -2076,10 +2076,10 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc)
if (sei_tmp.fMask & SEE_MASK_IDLIST &&
(sei_tmp.fMask & SEE_MASK_INVOKEIDLIST) != SEE_MASK_INVOKEIDLIST)
{
LPCITEMIDLIST pidl = (LPCITEMIDLIST)sei_tmp.lpIDList;
CComPtr<IShellExecuteHookW> pSEH;
HRESULT hr = SHBindToParent((LPCITEMIDLIST)sei_tmp.lpIDList, IID_PPV_ARG(IShellExecuteHookW, &pSEH), NULL);
HRESULT hr = SHBindToParent(pidl, IID_PPV_ARG(IShellExecuteHookW, &pSEH), NULL);
if (SUCCEEDED(hr))
{
hr = pSEH->Execute(&sei_tmp);
@ -2087,7 +2087,14 @@ static BOOL SHELL_execute(LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc)
return TRUE;
}
SHGetPathFromIDListW((LPCITEMIDLIST)sei_tmp.lpIDList, wszApplicationName);
hr = SHGetNameAndFlagsW(pidl, SHGDN_FORPARSING, wszApplicationName, dwApplicationNameLen, NULL);
if (FAILED(hr))
{
if (dwApplicationNameLen)
*wszApplicationName = UNICODE_NULL;
if (!_ILIsDesktop(pidl))
TRACE("Unable to get PIDL parsing path\n");
}
appKnownSingular = TRUE;
TRACE("-- idlist=%p (%s)\n", sei_tmp.lpIDList, debugstr_w(wszApplicationName));
}