Le jeudi 21 avril 2016 à 03:28 +0300, Nikolay Sivov a écrit :
On 21.04.2016 3:12, Olivier F. R. Dierick wrote:
See bug 36838 for comments and discussion.
Supersedes patch submission 121402.
Better version of the patch. Call IsWow64Process() only once on dll initialization and setup a global variable.
Like I said in bug comment, doing this is depending on a side effect. SHFileOperation() could do anything internally, if you want to have consistent ERROR_SUCCESS last error (even though it's kind of wrong to check it, since it returns error code already), why not force it in SHFileOperation() directly? Changing internal path is wrong in my opinion.
I don't know if resetting last error in SHFileOperation() is conformant. That's why I took the route to fix one error at a time until there were none left. More errors may be introduced later, but for now this patch is the last one needed to fix bug 36838.
I find forcing ERROR_SUCCESS in SHFileOperation() a brute and lazy way to fix things. It may hide other errors. Fixing the internal code itself may avoid bugs in other functions and is the way to go in my opinion.