Improve TAP_Win32 error logging
This commit is contained in:
parent
63480da4ee
commit
798365846d
|
@ -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);
|
||||||
|
|
||||||
|
if (mHRecvEvent != INVALID_HANDLE_VALUE)
|
||||||
|
{
|
||||||
CloseHandle(mHRecvEvent);
|
CloseHandle(mHRecvEvent);
|
||||||
mHRecvEvent = INVALID_HANDLE_VALUE;
|
mHRecvEvent = INVALID_HANDLE_VALUE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue