https://git.reactos.org/?p=reactos.git;a=commitdiff;h=44155053cdade19887932…
commit 44155053cdade19887932598ce6048a74f0ca71f
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Thu Oct 4 10:27:35 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Thu Oct 4 10:45:10 2018 +0200
[NTOSKRNL] Use captured variable to check parameters in NtRead/WriteFile
---
ntoskrnl/io/iomgr/iofunc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ntoskrnl/io/iomgr/iofunc.c b/ntoskrnl/io/iomgr/iofunc.c
index b90e73f5dc..01a956505f 100644
--- a/ntoskrnl/io/iomgr/iofunc.c
+++ b/ntoskrnl/io/iomgr/iofunc.c
@@ -2633,7 +2633,7 @@ NtReadFile(IN HANDLE FileHandle,
{
/* Fail if ByteOffset is not sector size aligned */
if ((DeviceObject->SectorSize != 0) &&
- (ByteOffset->QuadPart % DeviceObject->SectorSize != 0))
+ (CapturedByteOffset.QuadPart % DeviceObject->SectorSize !=
0))
{
/* Release the file object and and fail */
ObDereferenceObject(FileObject);
@@ -3670,11 +3670,11 @@ NtWriteFile(IN HANDLE FileHandle,
{
/* Fail if ByteOffset is not sector size aligned */
if ((DeviceObject->SectorSize != 0) &&
- (ByteOffset->QuadPart % DeviceObject->SectorSize != 0))
+ (CapturedByteOffset.QuadPart % DeviceObject->SectorSize !=
0))
{
/* 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
||
+ if ((CapturedByteOffset.QuadPart != FILE_WRITE_TO_END_OF_FILE)
&&
+ (CapturedByteOffset.QuadPart !=
FILE_USE_FILE_POINTER_POSITION ||
!BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO)))
{
/* Release the file object and and fail */