2014-02-25 20:33 GMT+08:00 Bruno Jesus 00cpxxx@gmail.com:
BTW, in irc channel, Stefand suggested me to avoid SetLastError(). If I have to do that, could I change SHELL_DeleteDirectoryW() from BOOL to DWORD?
If BOOL is no longer enough and the function is internal I see no problem in changing it, but there are other calls to this function so you would have to review and update then accordingly. And yes, avoiding the SetLastError is better as Windows may not set it too and the application may not be expecting that.
Thank you for your suggest. I checked wine's code again. As SHELL_DeleteDirectoryW() is a recursive function, using DWORD instead of BOOL would cause a big change.
So I modified the end of delete_files().
if (!bPathExists) - return ERROR_PATH_NOT_FOUND; + return GetLastError() == ERROR_PATH_NOT_FOUND? + 0x7c: /* DE_INVALIDFILES , which is a legacy in Windows*/ + GetLastError();
In this new patch[1], it would fix *all* todo marks about return value in test_delete(), too.
I appreciate your feedbacks. (Thank you very much, Bruno Jesus)
[1]: http://bugs.winehq.org/attachment.cgi?id=47644&action=diff