Fix two possible causes for range violations in the WinAPI handle map.
This commit is contained in:
parent
811ae63698
commit
242432c416
|
@ -170,8 +170,10 @@ final class WinAPIEventDriverCore : EventDriverCore {
|
|||
auto ret = () @trusted { return MsgWaitForMultipleObjectsEx(cast(DWORD)m_registeredEvents.length, m_registeredEvents.ptr,
|
||||
timeout_msecs, QS_ALLEVENTS, MWMO_ALERTABLE|MWMO_INPUTAVAILABLE); } ();
|
||||
|
||||
foreach (evt; m_ioEvents.consume)
|
||||
while (!m_ioEvents.empty) {
|
||||
auto evt = m_ioEvents.consumeOne();
|
||||
evt.process(evt.error, evt.bytesTransferred, evt.overlapped);
|
||||
}
|
||||
|
||||
if (ret == WAIT_IO_COMPLETION) got_event = true;
|
||||
else if (ret >= WAIT_OBJECT_0 && ret < WAIT_OBJECT_0 + m_registeredEvents.length) {
|
||||
|
|
|
@ -204,6 +204,7 @@ final class WinAPIEventDriverFiles : EventDriverFiles {
|
|||
{
|
||||
FileFD id = cast(FileFD)cast(size_t)overlapped.hEvent;
|
||||
auto handle = idToHandle(id);
|
||||
if (handle == INVALID_HANDLE_VALUE) return;
|
||||
static if (RO)
|
||||
auto slot = () @trusted { return &overlapped.driver.m_handles[handle].file.write; } ();
|
||||
else
|
||||
|
|
Loading…
Reference in a new issue