Thank you for checking it.
2014-02-24 23:39 GMT+08:00 Bruno Jesus 00cpxxx@gmail.com:
In my opinion the complex patch is better.
- if (hFind == INVALID_HANDLE_VALUE){
if (GetLastError() == ERROR_PATH_NOT_FOUND)
SetLastError(0x7c); /* DE_INVALIDFILES */
- return FALSE;
- }
- FindClose(hFind);
You are not following the {} styles in the surrounding code.
Sorry, it's my fault. I was confused by old code style. I've sent a new patch[1] to bugzilla[2], you may check that.
Why using a magic value (0x7c) if there is a define(DE_INVALIDFILES)?
This is related to legacy. MSDN said[3], "These are pre-Win32 error codes and are no longer supported or defined in any public header file." And DE_INVALIDFILES is not defined in wine's shell32 code. Maybe to define it is better than to use a magic number? I'm not sure.
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?
Thank you very much.
[1]: http://bugs.winehq.org/attachment.cgi?id=47626&action=diff [2]: http://bugs.winehq.org/show_bug.cgi?id=34324 [3]: http://msdn.microsoft.com/en-us/library/windows/desktop/bb762164%28v=vs.85%2...