Hi all,
I have a driver which creates a disk device object on which the filesystem
will be mounted.
For now, this device has no relation to PnP and is just a standalone DO
which supports all disk IOCTLs.
I need a way of destroying this device object in a way safe with respect to
the FS mounted on it.
Looks like PnP REMOVE is a good way of doing this - it will go to the FSD
first, forcing it to execute the abrupt dismount.
What design changes will I need to implement PnP REMOVE on this disk device
object?
regards,
Max
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
Under NT4.0 I created a disk device. To get rid of it, I send
FSCTL_LOCK_VOLUME and then FSCTL_DISMOUNT_VOLUME to the device (both is
processed by the file system driver). And if both are successful, I call my
private IOCTL to remove the disk device. (Don’t know anything about PnP or
special Win2k requirements.)
regards,
Michael
(In Reply To:)
I have a driver which creates a disk device object on which the filesystem
will be mounted.
For now, this device has no relation to PnP and is just a standalone DO
which supports all disk IOCTLs.
I need a way of destroying this device object in a way safe with respect to
the FS mounted on it.
Looks like PnP REMOVE is a good way of doing this - it will go to the FSD
first, forcing it to execute the abrupt dismount.
What design changes will I need to implement PnP REMOVE on this disk device
object?
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
I also do the same, but this lead to intermittend
DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if NTFS was mounted there.
It occur sometimes - maybe 1 time of 10.
The reason is that due to some strange stuff NTFS continues to hold the
device object references created by system files like $BitMap up to this
time, even after LOCK/DISMOUNT/UNLOCK.
Wow! Maybe I will postpone IoDeleteDevice till the last CLOSE call to this
device? Seems to be a good idea.
Max
----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Friday, September 07, 2001 4:00 PM
Subject: [ntdev] Re: Removing a disk device object
>
>
> Under NT4.0 I created a disk device. To get rid of it, I send
> FSCTL_LOCK_VOLUME and then FSCTL_DISMOUNT_VOLUME to the device (both is
> processed by the file system driver). And if both are successful, I call
my
> private IOCTL to remove the disk device. (Don’t know anything about PnP
or
> special Win2k requirements.)
>
> regards,
> Michael
>
>
> (In Reply To:)
> I have a driver which creates a disk device object on which the filesystem
> will be mounted.
> For now, this device has no relation to PnP and is just a standalone DO
> which supports all disk IOCTLs.
> I need a way of destroying this device object in a way safe with respect
to
> the FS mounted on it.
> Looks like PnP REMOVE is a good way of doing this - it will go to the FSD
> first, forcing it to execute the abrupt dismount.
> What design changes will I need to implement PnP REMOVE on this disk
device
> object?
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>I will postpone IoDeleteDevice
I don’t think you need it. Your device object exists even if you called
IoDeleteDevice.
Just return STATUS_NO_SUCH_DEVICE if you get IRPs for the deleted device
object.
Regards,
Max
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Saturday, September 08, 2001 5:52 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Removing a disk device object
I also do the same, but this lead to intermittend
DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if NTFS was mounted there.
It occur sometimes - maybe 1 time of 10.
The reason is that due to some strange stuff NTFS continues to hold the
device object references created by system files like $BitMap up to this
time, even after LOCK/DISMOUNT/UNLOCK.
Wow! Maybe I will postpone IoDeleteDevice till the last CLOSE call to this
device? Seems to be a good idea.
Max
----- Original Message -----
From:
To: “NT Developers Interest List”
Sent: Friday, September 07, 2001 4:00 PM
Subject: [ntdev] Re: Removing a disk device object
>
>
> Under NT4.0 I created a disk device. To get rid of it, I send
> FSCTL_LOCK_VOLUME and then FSCTL_DISMOUNT_VOLUME to the device (both is
> processed by the file system driver). And if both are successful, I call
my
> private IOCTL to remove the disk device. (Don’t know anything about PnP
or
> special Win2k requirements.)
>
> regards,
> Michael
>
>
> (In Reply To:)
> I have a driver which creates a disk device object on which the filesystem
> will be mounted.
> For now, this device has no relation to PnP and is just a standalone DO
> which supports all disk IOCTLs.
> I need a way of destroying this device object in a way safe with respect
to
> the FS mounted on it.
> Looks like PnP REMOVE is a good way of doing this - it will go to the FSD
> first, forcing it to execute the abrupt dismount.
> What design changes will I need to implement PnP REMOVE on this disk
device
> object?
>
>
>
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@acronis.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
In NT4, IoDeleteDevice causes DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if
DeviceObject->ReferenceCount is nonzero.
So, I must NOT call IoDeleteDevice till all references will begone (all
files will be closed).
Max
----- Original Message -----
From: “Max Lyadvinsky”
To: “NT Developers Interest List”
Sent: Saturday, September 08, 2001 9:02 PM
Subject: [ntdev] Re: Removing a disk device object
> >I will postpone IoDeleteDevice
> I don’t think you need it. Your device object exists even if you called
> IoDeleteDevice.
> Just return STATUS_NO_SUCH_DEVICE if you get IRPs for the deleted device
> object.
>
> Regards,
> Max
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
> Sent: Saturday, September 08, 2001 5:52 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Removing a disk device object
>
>
> I also do the same, but this lead to intermittend
> DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if NTFS was mounted there.
> It occur sometimes - maybe 1 time of 10.
> The reason is that due to some strange stuff NTFS continues to hold the
> device object references created by system files like $BitMap up to this
> time, even after LOCK/DISMOUNT/UNLOCK.
>
> Wow! Maybe I will postpone IoDeleteDevice till the last CLOSE call to this
> device? Seems to be a good idea.
>
> Max
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Friday, September 07, 2001 4:00 PM
> Subject: [ntdev] Re: Removing a disk device object
>
>
> >
> >
> > Under NT4.0 I created a disk device. To get rid of it, I send
> > FSCTL_LOCK_VOLUME and then FSCTL_DISMOUNT_VOLUME to the device (both is
> > processed by the file system driver). And if both are successful, I call
> my
> > private IOCTL to remove the disk device. (Don’t know anything about PnP
> or
> > special Win2k requirements.)
> >
> > regards,
> > Michael
> >
> >
> > (In Reply To:)
> > I have a driver which creates a disk device object on which the
filesystem
> > will be mounted.
> > For now, this device has no relation to PnP and is just a standalone DO
> > which supports all disk IOCTLs.
> > I need a way of destroying this device object in a way safe with respect
> to
> > the FS mounted on it.
> > Looks like PnP REMOVE is a good way of doing this - it will go to the
FSD
> > first, forcing it to execute the abrupt dismount.
> > What design changes will I need to implement PnP REMOVE on this disk
> device
> > object?
> >
> >
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@acronis.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
it seems a driver design error, 'cause I’ve tested several products built on
virtual drives technology and this worked ok.
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Sunday, September 09, 2001 3:28 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Removing a disk device object
In NT4, IoDeleteDevice causes DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if
DeviceObject->ReferenceCount is nonzero.
So, I must NOT call IoDeleteDevice till all references will begone (all
files will be closed).
Max
----- Original Message -----
From: “Max Lyadvinsky”
To: “NT Developers Interest List”
Sent: Saturday, September 08, 2001 9:02 PM
Subject: [ntdev] Re: Removing a disk device object
> >I will postpone IoDeleteDevice
> I don’t think you need it. Your device object exists even if you called
> IoDeleteDevice.
> Just return STATUS_NO_SUCH_DEVICE if you get IRPs for the deleted device
> object.
>
> Regards,
> Max
>
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
> Sent: Saturday, September 08, 2001 5:52 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Removing a disk device object
>
>
> I also do the same, but this lead to intermittend
> DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if NTFS was mounted there.
> It occur sometimes - maybe 1 time of 10.
> The reason is that due to some strange stuff NTFS continues to hold the
> device object references created by system files like $BitMap up to this
> time, even after LOCK/DISMOUNT/UNLOCK.
>
> Wow! Maybe I will postpone IoDeleteDevice till the last CLOSE call to this
> device? Seems to be a good idea.
>
> Max
>
> ----- Original Message -----
> From:
> To: “NT Developers Interest List”
> Sent: Friday, September 07, 2001 4:00 PM
> Subject: [ntdev] Re: Removing a disk device object
>
>
> >
> >
> > Under NT4.0 I created a disk device. To get rid of it, I send
> > FSCTL_LOCK_VOLUME and then FSCTL_DISMOUNT_VOLUME to the device (both is
> > processed by the file system driver). And if both are successful, I call
> my
> > private IOCTL to remove the disk device. (Don’t know anything about PnP
> or
> > special Win2k requirements.)
> >
> > regards,
> > Michael
> >
> >
> > (In Reply To:)
> > I have a driver which creates a disk device object on which the
filesystem
> > will be mounted.
> > For now, this device has no relation to PnP and is just a standalone DO
> > which supports all disk IOCTLs.
> > I need a way of destroying this device object in a way safe with respect
> to
> > the FS mounted on it.
> > Looks like PnP REMOVE is a good way of doing this - it will go to the
FSD
> > first, forcing it to execute the abrupt dismount.
> > What design changes will I need to implement PnP REMOVE on this disk
> device
> > object?
> >
> >
> >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@acronis.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@acronis.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
What OS?
----- Original Message -----
From: “Max Lyadvinsky”
To: “NT Developers Interest List”
Sent: Sunday, September 09, 2001 5:08 PM
Subject: [ntdev] Re: Removing a disk device object
> it seems a driver design error, 'cause I’ve tested several products built
on
> virtual drives technology and this worked ok.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
> Sent: Sunday, September 09, 2001 3:28 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Removing a disk device object
>
>
> In NT4, IoDeleteDevice causes DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if
> DeviceObject->ReferenceCount is nonzero.
>
> So, I must NOT call IoDeleteDevice till all references will begone (all
> files will be closed).
>
> Max
>
> ----- Original Message -----
> From: “Max Lyadvinsky”
> To: “NT Developers Interest List”
> Sent: Saturday, September 08, 2001 9:02 PM
> Subject: [ntdev] Re: Removing a disk device object
>
>
> > >I will postpone IoDeleteDevice
> > I don’t think you need it. Your device object exists even if you called
> > IoDeleteDevice.
> > Just return STATUS_NO_SUCH_DEVICE if you get IRPs for the deleted device
> > object.
> >
> > Regards,
> > Max
> >
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
> > Sent: Saturday, September 08, 2001 5:52 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Removing a disk device object
> >
> >
> > I also do the same, but this lead to intermittend
> > DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if NTFS was mounted there.
> > It occur sometimes - maybe 1 time of 10.
> > The reason is that due to some strange stuff NTFS continues to hold the
> > device object references created by system files like $BitMap up to this
> > time, even after LOCK/DISMOUNT/UNLOCK.
> >
> > Wow! Maybe I will postpone IoDeleteDevice till the last CLOSE call to
this
> > device? Seems to be a good idea.
> >
> > Max
> >
> > ----- Original Message -----
> > From:
> > To: “NT Developers Interest List”
> > Sent: Friday, September 07, 2001 4:00 PM
> > Subject: [ntdev] Re: Removing a disk device object
> >
> >
> > >
> > >
> > > Under NT4.0 I created a disk device. To get rid of it, I send
> > > FSCTL_LOCK_VOLUME and then FSCTL_DISMOUNT_VOLUME to the device (both
is
> > > processed by the file system driver). And if both are successful, I
call
> > my
> > > private IOCTL to remove the disk device. (Don’t know anything about
PnP
> > or
> > > special Win2k requirements.)
> > >
> > > regards,
> > > Michael
> > >
> > >
> > > (In Reply To:)
> > > I have a driver which creates a disk device object on which the
> filesystem
> > > will be mounted.
> > > For now, this device has no relation to PnP and is just a standalone
DO
> > > which supports all disk IOCTLs.
> > > I need a way of destroying this device object in a way safe with
respect
> > to
> > > the FS mounted on it.
> > > Looks like PnP REMOVE is a good way of doing this - it will go to the
> FSD
> > > first, forcing it to execute the abrupt dismount.
> > > What design changes will I need to implement PnP REMOVE on this disk
> > device
> > > object?
> > >
> > >
> > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@acronis.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@acronis.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
both NT4 and 2K. I just get some IRPs after dismounting and deleting the
device object. Then return NO_SUCH_DEVICE and this works fine. And the
device object is not deleted only if I force dismounting (there are open
handles left). If I can lock a virtual drive, then dismount it, the device
object is deleted normally and I don’t get IRPs for it any more.
Regards,
Max
-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
Sent: Sunday, September 09, 2001 5:37 PM
To: NT Developers Interest List
Subject: [ntdev] Re: Removing a disk device object
What OS?
----- Original Message -----
From: “Max Lyadvinsky”
To: “NT Developers Interest List”
Sent: Sunday, September 09, 2001 5:08 PM
Subject: [ntdev] Re: Removing a disk device object
> it seems a driver design error, 'cause I’ve tested several products built
on
> virtual drives technology and this worked ok.
>
> -----Original Message-----
> From: xxxxx@lists.osr.com
> [mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
> Sent: Sunday, September 09, 2001 3:28 PM
> To: NT Developers Interest List
> Subject: [ntdev] Re: Removing a disk device object
>
>
> In NT4, IoDeleteDevice causes DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if
> DeviceObject->ReferenceCount is nonzero.
>
> So, I must NOT call IoDeleteDevice till all references will begone (all
> files will be closed).
>
> Max
>
> ----- Original Message -----
> From: “Max Lyadvinsky”
> To: “NT Developers Interest List”
> Sent: Saturday, September 08, 2001 9:02 PM
> Subject: [ntdev] Re: Removing a disk device object
>
>
> > >I will postpone IoDeleteDevice
> > I don’t think you need it. Your device object exists even if you called
> > IoDeleteDevice.
> > Just return STATUS_NO_SUCH_DEVICE if you get IRPs for the deleted device
> > object.
> >
> > Regards,
> > Max
> >
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com]On Behalf Of Maxim S. Shatskih
> > Sent: Saturday, September 08, 2001 5:52 PM
> > To: NT Developers Interest List
> > Subject: [ntdev] Re: Removing a disk device object
> >
> >
> > I also do the same, but this lead to intermittend
> > DEVICE_REFERENCE_COUNT_NOT_ZERO BSOD if NTFS was mounted there.
> > It occur sometimes - maybe 1 time of 10.
> > The reason is that due to some strange stuff NTFS continues to hold the
> > device object references created by system files like $BitMap up to this
> > time, even after LOCK/DISMOUNT/UNLOCK.
> >
> > Wow! Maybe I will postpone IoDeleteDevice till the last CLOSE call to
this
> > device? Seems to be a good idea.
> >
> > Max
> >
> > ----- Original Message -----
> > From:
> > To: “NT Developers Interest List”
> > Sent: Friday, September 07, 2001 4:00 PM
> > Subject: [ntdev] Re: Removing a disk device object
> >
> >
> > >
> > >
> > > Under NT4.0 I created a disk device. To get rid of it, I send
> > > FSCTL_LOCK_VOLUME and then FSCTL_DISMOUNT_VOLUME to the device (both
is
> > > processed by the file system driver). And if both are successful, I
call
> > my
> > > private IOCTL to remove the disk device. (Don’t know anything about
PnP
> > or
> > > special Win2k requirements.)
> > >
> > > regards,
> > > Michael
> > >
> > >
> > > (In Reply To:)
> > > I have a driver which creates a disk device object on which the
> filesystem
> > > will be mounted.
> > > For now, this device has no relation to PnP and is just a standalone
DO
> > > which supports all disk IOCTLs.
> > > I need a way of destroying this device object in a way safe with
respect
> > to
> > > the FS mounted on it.
> > > Looks like PnP REMOVE is a good way of doing this - it will go to the
> FSD
> > > first, forcing it to execute the abrupt dismount.
> > > What design changes will I need to implement PnP REMOVE on this disk
> > device
> > > object?
> > >
> > >
> > >
> > >
> > >
> > > —
> > > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> > >
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@acronis.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
> >
> > —
> > You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> > To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
> >
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@acronis.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
>
> —
> You are currently subscribed to ntdev as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
>
—
You are currently subscribed to ntdev as: xxxxx@acronis.com
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com
—
You are currently subscribed to ntdev as: $subst(‘Recip.EmailAddr’)
To unsubscribe send a blank email to leave-ntdev-$subst(‘Recip.MemberIDChar’)@lists.osr.com