[PATCH 2/2] shell32: Make SHChangeNotify() dwItenN checks stricter
Signed-off-by: Serge Gautherie <winehq-git_serge_180711(a)gautherie.fr> --- dlls/shell32/changenotify.c | 39 ++++++++++++++++++++++++++++----------- 1 file changed, 28 insertions(+), 11 deletions(-) diff --git a/dlls/shell32/changenotify.c b/dlls/shell32/changenotify.c index 6c77a6c..6f2cf46 100644 --- a/dlls/shell32/changenotify.c +++ b/dlls/shell32/changenotify.c @@ -280,31 +280,47 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID if(uFlags & ~(SHCNF_TYPE|SHCNF_FLUSH)) FIXME("ignoring unsupported flags: %x\n", uFlags); + /* FIXME: Either set to NULL or return, not both */ if( ( wEventId & SHCNE_NOITEMEVENTS ) && ( dwItem1 || dwItem2 ) ) { - TRACE("dwItem1 and dwItem2 are not zero, but should be\n"); - dwItem1 = 0; - dwItem2 = 0; + WARN("dwItem1 and/or dwItem2 are not NULL, but should be\n"); + dwItem1 = NULL; + dwItem2 = NULL; return; } else if( ( wEventId & SHCNE_ONEITEMEVENTS ) && dwItem2 ) { - TRACE("dwItem2 is not zero, but should be\n"); - dwItem2 = 0; + WARN("dwItem2 is not NULL, but should be\n"); + dwItem2 = NULL; + return; + } + else if ((wEventId & SHCNE_SECONDITEMEVENTS) && dwItem1) + { + WARN("dwItem1 is not NULL, but should be\n"); + dwItem1 = NULL; + return; + } + else if (!dwItem1 || !dwItem2) + { + WARN("dwItem1 and/or dwItem2 are NULL, but should not be\n"); return; } - if( ( ( wEventId & SHCNE_NOITEMEVENTS ) && - ( wEventId & ~SHCNE_NOITEMEVENTS ) ) || - ( ( wEventId & SHCNE_ONEITEMEVENTS ) && - ( wEventId & ~SHCNE_ONEITEMEVENTS ) ) || - ( ( wEventId & SHCNE_TWOITEMEVENTS ) && - ( wEventId & ~SHCNE_TWOITEMEVENTS ) ) ) + if (((wEventId & SHCNE_NOITEMEVENTS ) && (wEventId & ~SHCNE_NOITEMEVENTS )) || + ((wEventId & SHCNE_ONEITEMEVENTS ) && (wEventId & ~SHCNE_ONEITEMEVENTS )) || + ((wEventId & SHCNE_SECONDITEMEVENTS) && (wEventId & ~SHCNE_SECONDITEMEVENTS)) || + ((wEventId & SHCNE_TWOITEMEVENTS ) && (wEventId & ~SHCNE_TWOITEMEVENTS ))) { WARN("mutually incompatible events listed\n"); return; } + if ((wEventId & SHCNE_SECONDITEMEVENTS)) + { + FIXME("SHChangeNotify with (wEventId & SHCNE_SECONDITEMEVENTS)\n"); + return; + } + /* convert paths in IDLists*/ switch (uFlags & SHCNF_TYPE) { @@ -351,6 +367,7 @@ void WINAPI SHChangeNotify(LONG wEventId, UINT uFlags, LPCVOID dwItem1, LPCVOID notify = TRUE; else if( wEventId & ( SHCNE_ONEITEMEVENTS | SHCNE_TWOITEMEVENTS ) ) notify = should_notify( Pidls[0], pidl, subtree ); + /* FIXME: Following if() is masked by previous one */ else if( wEventId & SHCNE_TWOITEMEVENTS ) notify = should_notify( Pidls[1], pidl, subtree ); } -- 2.10.0.windows.1
Hi, While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check? Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=65814 Your paranoid android. === debian10 (32 bit report) === shell32: shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called === debian10 (32 bit Chinese:China report) === shell32: shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called === debian10 (32 bit WoW report) === shell32: shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called === debian10 (64 bit WoW report) === shell32: shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: MKDIR: Expected wndproc to be called shlfolder.c:4935: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4946: Test failed: CREATE: Expected wndproc to be called shlfolder.c:4935: Test failed: RMDIR: Expected wndproc to be called shlfolder.c:4946: Test failed: RMDIR: Expected wndproc to be called
participants (2)
-
Marvin -
Serge Gautherie