[SHELL32] Translating PIDLs: Check NULL and fix PIDL flags update (#8603)

#8569 introduced an exception bug.
JIRA issue: CORE-20441
- In CreateNotificationParamAndSend
  function, check NULL for PIDLs.
- In SHELL32_ReparentAsAliasPidl
  function, fix updating PIDL flags.
This commit is contained in:
Katayama Hirofumi MZ
2026-01-17 23:21:19 +09:00
committed by GitHub
parent eafe25143b
commit ba1e474a98
2 changed files with 4 additions and 6 deletions

View File

@@ -342,8 +342,8 @@ CreateNotificationParamAndSend(LONG wEventId, UINT uFlags, LPCITEMIDLIST pidl1,
SHELL32_AliasTranslatePidl(pidl2, &pidl2Alias, ALIAS_ANY);
HANDLE hTicket2 = NULL;
if ((pidl1Alias || pidl2Alias) &&
(!ILIsEqual(pidl1, pidl1Alias) || !ILIsEqual(pidl2, pidl2Alias)))
if (((pidl1 && pidl1Alias && !ILIsEqual(pidl1, pidl1Alias)) ||
(pidl2 && pidl2Alias && !ILIsEqual(pidl2, pidl2Alias))))
{
hTicket2 = CreateNotificationParam(wEventId, uFlags, pidl1Alias, pidl2Alias,
pid, dwTick);

View File

@@ -2165,11 +2165,9 @@ SHELL32_ReparentAsAliasPidl(
if (*ppidlNew)
{
// Manipulate specific flags in the PIDL if necessary
if (pEntry->bCommonDesktop && (*ppidlNew)->mkid.cb)
if (pEntry->bCommonDesktop && (*ppidlNew)->mkid.cb >= 3)
{
UINT cbRoot = ILGetSize(pidlDestRoot);
PBYTE pAttr = (PBYTE)(*ppidlNew) + cbRoot - sizeof(USHORT);
*pAttr |= (PT_FS | PT_FS_COMMON_FLAG);
(*ppidlNew)->mkid.abID[0] |= (PT_FS | PT_FS_COMMON_FLAG);
}
}
ILFree(pidlDestRoot);