mirror of
https://github.com/reactos/reactos.git
synced 2024-06-27 16:31:30 +00:00
[NTOSKRNL] When checking for byte offset alignment, tolerate some magic values
This commit is contained in:
parent
fd33402104
commit
1bd25c5c24
|
@ -3656,9 +3656,15 @@ NtWriteFile(IN HANDLE FileHandle,
|
|||
if ((DeviceObject->SectorSize != 0) &&
|
||||
(ByteOffset->QuadPart % DeviceObject->SectorSize != 0))
|
||||
{
|
||||
/* Release the file object and and fail */
|
||||
ObDereferenceObject(FileObject);
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
/* Only if that's not specific values for synchronous IO */
|
||||
if ((ByteOffset->QuadPart != FILE_WRITE_TO_END_OF_FILE) &&
|
||||
(ByteOffset->QuadPart != FILE_USE_FILE_POINTER_POSITION ||
|
||||
!BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO)))
|
||||
{
|
||||
/* Release the file object and and fail */
|
||||
ObDereferenceObject(FileObject);
|
||||
return STATUS_INVALID_PARAMETER;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue