Improve TAP_Win32 error logging

This commit is contained in:
zeroZshadow 2015-08-13 18:25:17 +02:00
parent 63480da4ee
commit 798365846d
1 changed files with 9 additions and 4 deletions

View File

@ -304,15 +304,17 @@ bool CEXIETHERNET::RecvStart()
DWORD res = ReadFile(mHAdapter, mRecvBuffer, BBA_RECV_SIZE, DWORD res = ReadFile(mHAdapter, mRecvBuffer, BBA_RECV_SIZE,
(LPDWORD)&mRecvBufferLength, &mReadOverlapped); (LPDWORD)&mRecvBufferLength, &mReadOverlapped);
if (!res && (GetLastError() != ERROR_IO_PENDING)) DWORD err = GetLastError();
if (!res && err != ERROR_IO_PENDING)
{ {
// error occurred // error occurred
ERROR_LOG(SP1, "Failed to recieve packet with error 0x%X", err);
return false; return false;
} }
if (res) if (res)
{ {
// Completed immediately // Synce the read is syncronouse here, complete immediately
RecvHandlePacket(); RecvHandlePacket();
} }
@ -326,6 +328,9 @@ void CEXIETHERNET::RecvStop()
UnregisterWaitEx(mHReadWait, INVALID_HANDLE_VALUE); UnregisterWaitEx(mHReadWait, INVALID_HANDLE_VALUE);
CloseHandle(mHRecvEvent); if (mHRecvEvent != INVALID_HANDLE_VALUE)
mHRecvEvent = INVALID_HANDLE_VALUE; {
CloseHandle(mHRecvEvent);
mHRecvEvent = INVALID_HANDLE_VALUE;
}
} }