https://git.reactos.org/?p=reactos.git;a=commitdiff;h=59c48a5d33ef99fb9afb93...
commit 59c48a5d33ef99fb9afb93c3cd8e288ec1c558f9 Author: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com AuthorDate: Fri Apr 10 21:51:22 2020 +0900 Commit: Katayama Hirofumi MZ katayama.hirofumi.mz@gmail.com CommitDate: Fri Apr 10 21:51:22 2020 +0900
[SHELL32] Improve CChangeNotify::ShouldNotify
Shell change notification was not sent to My Documents. CORE-13950 --- dll/win32/shell32/shelldesktop/CChangeNotify.cpp | 34 +++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/dll/win32/shell32/shelldesktop/CChangeNotify.cpp b/dll/win32/shell32/shelldesktop/CChangeNotify.cpp index 32d00cb1e6f..f885dab7305 100644 --- a/dll/win32/shell32/shelldesktop/CChangeNotify.cpp +++ b/dll/win32/shell32/shelldesktop/CChangeNotify.cpp @@ -537,7 +537,9 @@ BOOL CChangeNotify::DoDelivery(HANDLE hTicket, DWORD dwOwnerPID) BOOL CChangeNotify::ShouldNotify(LPDELITICKET pTicket, LPNOTIFSHARE pShared) { BOOL ret; - LPITEMIDLIST pidl, pidl1, pidl2; + LPITEMIDLIST pidl, pidl1 = NULL, pidl2 = NULL; + WCHAR szPath[MAX_PATH], szPath1[MAX_PATH], szPath2[MAX_PATH]; + INT cch, cch1, cch2;
if (!pShared->ibPidl) return TRUE; @@ -559,5 +561,35 @@ BOOL CChangeNotify::ShouldNotify(LPDELITICKET pTicket, LPNOTIFSHARE pShared) ret = TRUE; }
+ if (!ret && SHGetPathFromIDListW(pidl, szPath)) + { + PathAddBackslashW(szPath); + cch = lstrlenW(szPath); + + if (pidl1 && SHGetPathFromIDListW(pidl1, szPath1)) + { + PathAddBackslashW(szPath1); + cch1 = lstrlenW(szPath1); + if (cch < cch1) + { + szPath1[cch] = 0; + if (lstrcmpiW(szPath, szPath1) == 0) + ret = TRUE; + } + } + + if (!ret && pidl2 && SHGetPathFromIDListW(pidl2, szPath2)) + { + PathAddBackslashW(szPath2); + cch2 = lstrlenW(szPath2); + if (cch < cch2) + { + szPath2[cch] = 0; + if (lstrcmpiW(szPath, szPath2) == 0) + ret = TRUE; + } + } + } + return ret; }