From: Dmitry Chapyshev Date: Sat, 3 Sep 2016 19:10:09 +0000 (+0000) Subject: [NTOS:IO] X-Git-Tag: backups/sndblst@72664~108 X-Git-Url: https://git.reactos.org/?p=reactos.git;a=commitdiff_plain;h=f77ed4dcd61e6237ced06fcf1d964b38e59f6989 [NTOS:IO] - Add dismount checking (function should behave the same in the fastio and the slow case) - Fix comment svn path=/trunk/; revision=72552 --- diff --git a/reactos/ntoskrnl/io/iomgr/iofunc.c b/reactos/ntoskrnl/io/iomgr/iofunc.c index 07dc8ce4ef8..7fb698d30fb 100644 --- a/reactos/ntoskrnl/io/iomgr/iofunc.c +++ b/reactos/ntoskrnl/io/iomgr/iofunc.c @@ -348,7 +348,7 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle, DeviceObject = IoGetRelatedDeviceObject(FileObject); } - /* If that's FS I/O, try to do it with FastIO path */ + /* If this is a device I/O, try to do it with FastIO path */ if (IsDevIoCtl) { PFAST_IO_DISPATCH FastIoDispatch = DeviceObject->DriverObject->FastIoDispatch; @@ -614,6 +614,12 @@ IopDeviceFsIoControl(IN HANDLE DeviceHandle, /* Use deferred completion for FS I/O */ Irp->Flags |= (!IsDevIoCtl) ? IRP_DEFER_IO_COMPLETION : 0; + /* If we're to dismount a volume, increaase the dismount count */ + if (IoControlCode == FSCTL_DISMOUNT_VOLUME) + { + InterlockedExchangeAdd((PLONG)&SharedUserData->DismountCount, 1); + } + /* Perform the call */ return IopPerformSynchronousRequest(DeviceObject, Irp,