mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
Rewrite RecvStart error checking as suggested by shuffle2
This commit is contained in:
parent
8925b828aa
commit
84764db3b2
@ -304,21 +304,25 @@ 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);
|
||||||
|
|
||||||
DWORD err = GetLastError();
|
|
||||||
if (!res && err != ERROR_IO_PENDING)
|
|
||||||
{
|
|
||||||
// error occurred
|
|
||||||
ERROR_LOG(SP1, "Failed to recieve packet with error 0x%X", err);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (res)
|
if (res)
|
||||||
{
|
{
|
||||||
// Since the read is synchronous here, complete immediately
|
// Since the read is synchronous here, complete immediately
|
||||||
RecvHandlePacket();
|
RecvHandlePacket();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
DWORD err = GetLastError();
|
||||||
|
if (err == ERROR_IO_PENDING)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Unexpected error
|
||||||
|
ERROR_LOG(SP1, "Failed to recieve packet with error 0x%X", err);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CEXIETHERNET::RecvStop()
|
void CEXIETHERNET::RecvStop()
|
||||||
|
Loading…
Reference in New Issue
Block a user