Signed-off-by: Serge Gautherie winehq-git_serge_180711@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 ); }