fixing ReadDirectoryChangesW()

Michael Pujos pujos.michael at laposte.net
Fri Sep 11 14:24:32 CDT 2009


A few months ago I wrote a patch that addressed the following issues 
with  ReadDirectoryChangesW():

"1. move and rename of files and directories in a monitored directory are 
not notified
2. the current implementation allow to only get one change 
(FILE_NOTIFY_INFORMATION structure) at a time.
No change is actually lost but the calling application using 
ReadDirectoryChangesW() expect to retrieve all changes since the last call.
With the current implementation it would only get the first and would 
have to call ReadDirectoryChangesW() again to get the other. With this 
patch ,
it gets all notification (as many consecutive FILE_NOTIFY_INFORMATION 
structs) since the last call to ReadDirectoryChangesW().

These move operations are implemented by this patch and conform to what 
win32 does:

- Moving a directory or    a file inside the  monitored directory. A 
FILE_NOTIFY_INFORMATION structure with action FILE_ACTION_ADDED
is returned
- Moving a directory or    a file out of the  monitored directory. A 
FILE_NOTIFY_INFORMATION structure with action FILE_ACTION_REMOVED
is returned
- Renaming a directory or a file in the monitored directory. Two 
consecutive FILE_NOTIFY_INFORMATION structures with actions
FILE_ACTION_RENAMED_OLD_NAME and FILE_ACTION_RENAMED_NEW_NAME are 
returned within the same reply. This can actually be done because issue 2
above is corrected."


This old patch can be found here: 
http://bubbleguuum.free.fr/0001-server-implement-move-rename-change-notifications-and-support-for-multiple-change-notification-in-one-reply.txt

This patch modify the server protocol in server_protocol.h from


struct read_change_reply
 {
     struct reply_header __header;
     int          action;
     /* VARARG(name,string); */
 };

to:

struct read_change_reply
 {
     struct reply_header __header;
    int          action_count;
     /* VARARG(name,string); */
 };



I'm willing to resubmit this patch with updated tests against current Wine, but before I procceed
I need to be sure it won't be rejected simply because it changes the protocol.








More information about the wine-devel mailing list