On Tue, Apr 24, 2012 at 11:08 AM, Alexandre Julliard julliard@winehq.org wrote:
"Erich E. Hoover" ehoover@mines.edu writes:
... This patch changes how the close socket operation works so that if an async operation is registered then closing the handle will be deferred until the async operation has completed.
I would find it very suprising if this were how it's supposed to work, particularly since multiple handles can of course be opened to the same socket. You'll need very convincing tests for this...
The issue is that the way the async callback works in ws2_32 it uses add_fd_completion() to create completions. Since that routine uses the socket handle, the specific handle used for the async operation needs to remain valid until after the async has completed. If that handle doesn't remain valid then the completion cannot be added. So, this code keeps that handle valid until the async is complete so that WS2_async_accept has a valid handle to work with.
Erich Hoover ehoover@mines.edu