[*] nt: fix new blocking over async paths (eos handling)

This commit is contained in:
Reece Wilson 2023-07-29 10:06:43 +01:00
parent a79caa707f
commit c05a859638

View File

@ -120,7 +120,7 @@ namespace Aurora::IO::FS
AuUInt64 uOffset {};
while (uLength)
{
DWORD read;
DWORD read {};
auto blockSize = AuMin(AuUInt(kFileCopyBlock), uLength);
@ -145,13 +145,14 @@ namespace Aurora::IO::FS
::WaitForSingleObject(hEventHandle, 0);
if (!::GetOverlappedResult(hHandle, &overlapped, &read, true))
{
if (::GetLastError() != ERROR_HANDLE_EOF)
{
AuWin32CloseHandle(hEventHandle);
parameters.outVariable = uOffset;
return false;
}
::CloseHandle(hEventHandle);
}
}
else
{
@ -205,7 +206,7 @@ namespace Aurora::IO::FS
AuUInt64 uOffset {};
while (uLength)
{
DWORD written;
DWORD written {};
auto uBlockSize = AuMin(AuUInt(kFileCopyBlock), uLength);
@ -235,8 +236,6 @@ namespace Aurora::IO::FS
parameters.outVariable = uOffset;
return false;
}
::CloseHandle(hEventHandle);
}
else
{