https://bugs.winehq.org/show_bug.cgi?id=51529
--- Comment #2 from Sergey Bychkow sergey.bychkow@gmail.com --- (In reply to Nikolay Sivov from comment #1)
According to patches I just sent [1], [2], this behavior is only observed on Windows 10. Did you get different results?
[1] https://www.winehq.org/pipermail/wine-devel/2021-August/192343.html [2] https://www.winehq.org/pipermail/wine-devel/2021-August/192344.html
I used to test it with Windows 10, because it's main Windows for users now. And with Wine/CrossOver, of cause.
Now I tried it with WinXP in VirtualBox, and, you are right, it returns ERROR_INVALID_HANDLE for CloseHandle(INVALID_HANDLE_VALUE), not zero (SUCCESS).
Unfortunately I have no access to all collection of Windows OSes now. But, if behaviour is so different, may be it isn't worth to change anything in Wine. There are more valuable problems to fix.