mirror of
https://github.com/reactos/reactos.git
synced 2025-06-01 07:28:19 +00:00
[NTOSKRNL] Don't lock file object on close if we're not called by Ob
IopCloseFile can be called by IopDeleteFile. In that situation, it doesn't set any process as first parameter. Furthermore, we are in a situation where it's not required to lock the file object (see the assert before the call).
This commit is contained in:
parent
6f138e2811
commit
cf25432eed
1 changed files with 10 additions and 2 deletions
|
@ -2033,7 +2033,11 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL,
|
|||
FileObject->Flags |= FO_HANDLE_CREATED;
|
||||
|
||||
/* Check if this is a sync FO and lock it */
|
||||
if (FileObject->Flags & FO_SYNCHRONOUS_IO) IopLockFileObject(FileObject);
|
||||
if (Process != NULL &&
|
||||
BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO))
|
||||
{
|
||||
IopLockFileObject(FileObject);
|
||||
}
|
||||
|
||||
/* Clear and set up Events */
|
||||
KeClearEvent(&FileObject->Event);
|
||||
|
@ -2078,7 +2082,11 @@ IopCloseFile(IN PEPROCESS Process OPTIONAL,
|
|||
IoFreeIrp(Irp);
|
||||
|
||||
/* Release the lock if we were holding it */
|
||||
if (FileObject->Flags & FO_SYNCHRONOUS_IO) IopUnlockFileObject(FileObject);
|
||||
if (Process != NULL &&
|
||||
BooleanFlagOn(FileObject->Flags, FO_SYNCHRONOUS_IO))
|
||||
{
|
||||
IopUnlockFileObject(FileObject);
|
||||
}
|
||||
}
|
||||
|
||||
NTSTATUS
|
||||
|
|
Loading…
Reference in a new issue