https://git.reactos.org/?p=reactos.git;a=commitdiff;h=0b713d4fa0781ecce0367…
commit 0b713d4fa0781ecce03673ce9b3eb64d7a683382
Author: Pierre Schweitzer <pierre(a)reactos.org>
AuthorDate: Fri Oct 5 10:49:11 2018 +0200
Commit: Pierre Schweitzer <pierre(a)reactos.org>
CommitDate: Fri Oct 5 10:49:59 2018 +0200
[NTOSKRNL] On open, verify and validate the hint device object if any
---
ntoskrnl/io/iomgr/file.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/ntoskrnl/io/iomgr/file.c b/ntoskrnl/io/iomgr/file.c
index c14e61806b..d8bb852606 100644
--- a/ntoskrnl/io/iomgr/file.c
+++ b/ntoskrnl/io/iomgr/file.c
@@ -673,10 +673,16 @@ IopParseDevice(IN PVOID ParseObject,
}
}
+ /* If we have a top level device hint, verify it */
if (OpenPacket->InternalFlags & IOP_USE_TOP_LEVEL_DEVICE_HINT)
{
- // FIXME: Verify our device object is good to use
- ASSERT(DirectOpen == FALSE);
+ Status = IopCheckTopDeviceHint(&DeviceObject, OpenPacket, DirectOpen);
+ if (!NT_SUCCESS(Status))
+ {
+ IopDereferenceDeviceObject(OriginalDeviceObject, FALSE);
+ if (Vpb) IopDereferenceVpbAndFree(Vpb);
+ return Status;
+ }
}
/* If we traversed a mount point, reset the information */