https://git.reactos.org/?p=reactos.git;a=commitdiff;h=1d1dba51db2208e300570…
commit 1d1dba51db2208e300570c58ffe2272e0c34a1a8
Author: Jérôme Gardou <jerome.gardou(a)reactos.org>
AuthorDate: Mon Dec 14 15:51:15 2020 +0100
Commit: Jérôme Gardou <jerome.gardou(a)reactos.org>
CommitDate: Tue Dec 22 11:05:00 2020 +0100
[NTOS:IO] Do not set Shared property of the file if we are failing in
IoCheckShareAccess
---
ntoskrnl/io/iomgr/file.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/ntoskrnl/io/iomgr/file.c b/ntoskrnl/io/iomgr/file.c
index 5004938c099..548c7f28db7 100644
--- a/ntoskrnl/io/iomgr/file.c
+++ b/ntoskrnl/io/iomgr/file.c
@@ -3429,11 +3429,6 @@ IoCheckShareAccess(IN ACCESS_MASK DesiredAccess,
SharedWrite = (DesiredShareAccess & FILE_SHARE_WRITE) != 0;
SharedDelete = (DesiredShareAccess & FILE_SHARE_DELETE) != 0;
- /* Set them */
- FileObject->SharedRead = SharedRead;
- FileObject->SharedWrite = SharedWrite;
- FileObject->SharedDelete = SharedDelete;
-
/* Check if the shared access is violated */
if ((ReadAccess &&
(ShareAccess->SharedRead < ShareAccess->OpenCount)) ||
@@ -3449,6 +3444,11 @@ IoCheckShareAccess(IN ACCESS_MASK DesiredAccess,
return STATUS_SHARING_VIOLATION;
}
+ /* Set them */
+ FileObject->SharedRead = SharedRead;
+ FileObject->SharedWrite = SharedWrite;
+ FileObject->SharedDelete = SharedDelete;
+
/* It's not, check if caller wants us to update it */
if (Update)
{