Behavior of SHChangeNotify

Jay Yang jkelleyy at gmail.com
Fri Jun 24 12:27:53 CDT 2011


To try to implement copy-paste for shell folders, I used SHFileOperation for the actual copy. SHFileOperation calls SHChangeNotify to notify listeners about changes to the file system. But I noticed that the shell view would not update correctly if it was at 'C:\' but it would if it was at '/home/user_name/.wine/drive_c/'. In the end I traced this to the fact that in the first case the shell view calls SHChangeNotifyRegister with a pidl of the form <Desktop|My Computer|C:> while SHFileOperation is using SHChangeNotify to send a notification to those listeners registered on pidls of the form <Desktop|/|home|user_name|.wine|drive_c>. This makes it such that the shell view doesn't always get the notifications it expects. I can think of a couple of ways to fix this.

1. Have SHChangeNotifyRegister normalize all file system pidls to ones rooted in the unixfs.
2. Have the shell view register on a unixfs pidl.

I would like to know if either of these is a good solution, or if there are better solutions. I can also write a quick test to demonstrate the problem if necessary.

--
Jay Yang



More information about the wine-devel mailing list