SHFileOperation - add ChangeNotify events

Rolf Kalbermatter rolf.kalbermatter at
Mon Mar 10 03:46:12 CST 2003

Vitaliy Margolen <wine-patch at> wrote:

>+ * Win32DeleteFile                         [SHELL32.164]
>+ *
>+ * Deletes a file. Also triggers a change notify if one exists.
>+ *
>+ * NOTES:
>+ *  Verified on Win98 / IE 5 (SHELL32 4.72, March 1999 build) to be ANSI.
>+ *  This is Unicode on NT/2000
>+ */
>+static BOOL Win32DeleteFileA(LPCSTR fName)
>+       LPITEMIDLIST    Pidls[1];
>+       DWORD           dummy;
>+       TRACE("%p(%s)\n", fName, fName);
>+        SHILCreateFromPathA(fName, &Pidls[0], &dummy);
>+       DeleteFileA(fName);
>+       SHChangeNotify(SHCNE_DELETE, SHCNF_IDLIST, Pidls[0], NULL);
>+        SHFree(Pidls[0]);
>+       return TRUE;

The addition of SHILCreateFromPathA/W to all of these functions is superfluous
since SHChangeNotify does this for you anyhow if you pass in a normal string
path. So your patch adds in this respect nothing besides of duplicating already
existing code.

Also please note that there is another patch to SHFileOperation from 2/20/2003
pending which reimplements this function from scratch up with a different
algorithme, which implements all of the operations and is quite thorougly
verified to behave in all major aspects exactly like the Windows 98/2000
version of this function, which one can't fully say of the current function
in Wine. It happens to use internally also additionally implemented functions
which also set the according SHChangeNorify in most places.

I believe there are some issues with this patch as it hasn't been applied yet
to Wine. One of them could be that it is considered to be to much changes at
once. Maybe somebody could comment on what might be the problem with that

Rolf Kalbermatter

More information about the wine-devel mailing list