diff --git a/Source/IO/FS/FileStream.NT.cpp b/Source/IO/FS/FileStream.NT.cpp index ce9f904d..4440775a 100644 --- a/Source/IO/FS/FileStream.NT.cpp +++ b/Source/IO/FS/FileStream.NT.cpp @@ -236,7 +236,14 @@ namespace Aurora::IO::FS bool WinFileStream::Write(const Memory::MemoryViewStreamRead ¶meters) { - auto hHandle = this->GetWin32Handle(); + auto optHandle = this->GetHandle()->GetOSWriteHandleSafe(); + if (!optHandle) + { + SysPushErrorIOResourceRejected(); + return false; + } + + auto hHandle = (HANDLE)optHandle.value(); HANDLE hEventHandle { INVALID_HANDLE_VALUE }; if (hHandle == INVALID_HANDLE_VALUE)