(second try) server: implement move/rename change notifications and support for multiple change notification in one reply

Michael Pujos pujos.michael at laposte.net
Tue Dec 16 19:27:29 CST 2008

[File not correclyt attached in previous post]

This patch is an enhancement of the ReadDirectoryChangesW() API. This 
API monitor directory changes.

It addresses the following issues:

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 
is returned
- Moving a directory or    a file out of the  monitored directory. A 
is returned
- Renaming a directory or a file in the monitored directory. Two 
consecutive FILE_NOTIFY_INFORMATION structures with actions
returned within the same reply. This can actually be done because issue 2
above is corrected.

All the tests in kernel32/change.c passes in wine as well as compiled 
under MSVC. I've also added the test cases for the move operation above.

My real world test case was to fix foobar2000 monitoring changes to 
music folders (moving files).
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-server-implement-move-rename-change-notifications-and-support-for-multiple-change-notification-in-one-reply.txt
Url: http://www.winehq.org/pipermail/wine-patches/attachments/20081217/06c72652/attachment.txt 

More information about the wine-patches mailing list