Tulip issue 196: ProactorIocp._register() now registers the overlapped in the _cache dictionary, even if we already got the result. We need to keep a reference to the overlapped object, otherwise the memory may be reused and GetQueuedCompletionStatus() may use random bytes and behaves badly.
Tulip issue 196: ProactorIocp._register() now registers the overlapped in the
_cache dictionary, even if we already got the result. We need to keep a
reference to the overlapped object, otherwise the memory may be reused and
GetQueuedCompletionStatus() may use random bytes and behaves badly.

There is still a hack for ConnectNamedPipe(): the overlapped object is not
register into _cache if the overlapped object completed directly.

Log also an error in debug mode in ProactorIocp._loop() if we get an unexpected
event.

Add a protection in ProactorIocp.close() to avoid blocking, even if it should
not happen. I still don't understand exactly why some the completion of some
overlapped objects are not notified.

vxgmichel/asyncio,Martiusweb/asyncio,1st1/asyncio,jashandeep-sohi/asyncio,fallen/asyncio,fallen/asyncio,manipopopo/asyncio,haypo/trollius,1st1/asyncio,ajdavis/asyncio,vxgmichel/asyncio,vxgmichel/asyncio,gsb-eng/asyncio,jashandeep-sohi/asyncio,ajdavis/asyncio,manipopopo/asyncio,manipopopo/asyncio,jashandeep-sohi/asyncio,fallen/asyncio,Martiusweb/asyncio,Martiusweb/asyncio,gsb-eng/asyncio,gvanrossum/asyncio,gsb-eng/asyncio,haypo/trollius,1st1/asyncio,ajdavis/asyncio,gvanrossum/asyncio,gvanrossum/asyncio,haypo/trollius