[*] NT File Stream: unlikely race condition
This commit is contained in:
parent
3df8621944
commit
78634d11db
@ -392,15 +392,15 @@ namespace Aurora::IO::FS
|
||||
|
||||
HANDLE WinFileStream::GetWin32Handle(bool bReadOnly)
|
||||
{
|
||||
if (this->pHandle_)
|
||||
if (auto pHandle = this->pHandle_)
|
||||
{
|
||||
if (bReadOnly)
|
||||
{
|
||||
return (HANDLE)this->pHandle_->GetOSReadHandleSafe().ValueOr((AuUInt)INVALID_HANDLE_VALUE);
|
||||
return (HANDLE)pHandle->GetOSReadHandleSafe().ValueOr((AuUInt)INVALID_HANDLE_VALUE);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (HANDLE)this->pHandle_->GetOSWriteHandleSafe().ValueOr(this->pHandle_->GetOSReadHandleSafe().ValueOr((AuUInt)INVALID_HANDLE_VALUE));
|
||||
return (HANDLE)pHandle->GetOSWriteHandleSafe().ValueOr(pHandle->GetOSReadHandleSafe().ValueOr((AuUInt)INVALID_HANDLE_VALUE));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user