https://bugs.winehq.org/show_bug.cgi?id=38399
--- Comment #3 from Bruno Jesus 00cpxxx@gmail.com --- Created attachment 51263 --> https://bugs.winehq.org/attachment.cgi?id=51263 patch
The attached patch solves the issue, but I'm looking for cheaper ways. The problem is that all descriptors are duplicated (dup call) for reasons I don't understand so when we call select with socket A we retrieve handle X from the server and do the poll, when we close the socket in a second thread it looks like its duplicated copies are still alive because if I try a getsockopt on the handle X from inside the select code it still works when I really expected it to give an error.
The patch ensures the socket really died asking for the server to fetch me its handle. If anyone understands why the server always duplicate the handle I would appreciate the explanation.
https://source.winehq.org/source/dlls/ntdll/server.c#0990