From ba1e474a98f22937ee95da502748eae0897ac614 Mon Sep 17 00:00:00 2001 From: Katayama Hirofumi MZ Date: Sat, 17 Jan 2026 23:21:19 +0900 Subject: [PATCH] [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. --- dll/win32/shell32/changenotify.cpp | 4 ++-- dll/win32/shell32/utils.cpp | 6 ++---- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/dll/win32/shell32/changenotify.cpp b/dll/win32/shell32/changenotify.cpp index e54c93a5fc2..19bef814fed 100644 --- a/dll/win32/shell32/changenotify.cpp +++ b/dll/win32/shell32/changenotify.cpp @@ -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); diff --git a/dll/win32/shell32/utils.cpp b/dll/win32/shell32/utils.cpp index 81986499f02..de7c84184e9 100644 --- a/dll/win32/shell32/utils.cpp +++ b/dll/win32/shell32/utils.cpp @@ -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);