+
+ if (TypeOfOpen == UserVolumeOpen) {
+
+ //
+ // For a force dismount, physically disconnect this Vcb from the device so
+ // a new mount can occur. Vcb deletion cannot happen at this time since
+ // there is a reference on it associated with this very request, but we'll
+ // call check for dismount again later after we process this close.
+ //
+
+ if (FlagOn( Ccb->Flags, CCB_FLAG_DISMOUNT_ON_CLOSE )) {
+
+ CdAcquireCdData( IrpContext );
+
+ CdCheckForDismount( IrpContext, Vcb, TRUE );
+
+ CdReleaseCdData( IrpContext );
+
+ //
+ // If this handle actually wrote something, flush the device buffers,
+ // and then set the verify bit now just to be safe (in case there is no
+ // dismount).
+ //
+
+ } else if (FlagOn( FileObject->Flags, FO_FILE_MODIFIED )) {
+
+ CdHijackIrpAndFlushDevice( IrpContext, Irp, Vcb->TargetDeviceObject );
+
+ CdMarkDevForVerifyIfVcbMounted( Vcb );
+ }
+ }
+