[2/2] shell32: Be safe against removal of entries in SHChangeNotify

André Hentschel nerv at dawncrow.de
Mon Sep 19 13:52:23 CDT 2011


the "notified code" can call SHChangeNotifyDeregister which actually happens as of
http://bugs.winehq.org/show_bug.cgi?id=28392
---
 dlls/shell32/changenotify.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c
index 862016c..ddd6a10 100644
--- a/dlls/shell32/changenotify.c
+++ b/dlls/shell32/changenotify.c
@@ -254,7 +254,7 @@ static BOOL should_notify( LPCITEMIDLIST changed, LPCITEMIDLIST watched, BOOL su
 void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID dwItem2)
 {
     LPCITEMIDLIST Pidls[2];
-    LPNOTIFICATIONLIST ptr;
+    LPNOTIFICATIONLIST ptr, next;
     UINT typeFlag = uFlags & SHCNF_TYPE;
 
     Pidls[0] = NULL;
@@ -325,7 +325,7 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID
     EnterCriticalSection(&SHELL32_ChangenotifyCS);
 
     /* loop through the list */
-    LIST_FOR_EACH_ENTRY( ptr, &notifications, NOTIFICATIONLIST, entry )
+    LIST_FOR_EACH_ENTRY_SAFE( ptr, next, &notifications, NOTIFICATIONLIST, entry )
     {
         BOOL notify;
         DWORD i;
-- 

Best Regards, André Hentschel



More information about the wine-patches mailing list