Re: How to fail Volume Unmount?

Thanks for your time…Let me precise on what i am talking about. I have
registered a callback using DDK call IoRegisterPlugPlayNotification() in
which EventCategory* is* EventCategoryTargetDeviceChange to get
notification, when a volume Mount/Unmount/Unmount Fail. I am handling these
following events in my callback routine.

// Volume dismount event. This event is signalled when an attempt is made
to
// dismount a volume.

DEFINE_GUID( GUID_IO_VOLUME_DISMOUNT, 0xd16a55e8L, 0x1059, 0x11d2, 0x8f,
0xfd, 0x00, 0xa0, 0xc9, 0xa0, 0x6d, 0x32 );

// Volume dismount failed event. This event is signalled when a volume
dismount fails.

DEFINE_GUID( GUID_IO_VOLUME_DISMOUNT_FAILED, 0xe3c5b178L, 0x105d, 0x11d2,
0x8f, 0xfd, 0x00, 0xa0, 0xc9, 0xa0, 0x6d, 0x32 );

// Volume mount event. This event is signalled when a volume mount occurs.

DEFINE_GUID( GUID_IO_VOLUME_MOUNT, 0xb5804878L, 0x1a96, 0x11d2, 0x8f, 0xfd,
0x00, 0xa0, 0xc9, 0xa0, 0x6d, 0x32 );

I see dismount notification when volume goes offline/delete volume, which
forces Unmount operation and volume itself gone. I could not find a way
where i can just Unmount the Volume? and fail the Unmount somehow on the
same volume, so that my driver get the Dismout Fail notification?
I am talking based on the below content from MSDN :

(GUID_IO_VOLUME_DISMOUNT_FAILED : An attempt to dismount a volume failed.
This often happens because another process failed to respond to a
GUID_IO_VOLUME_DISMOUNT notice by closing its outstanding handles.)

Any ideas? please suggest?

Thanks,
Suresh

On Wed, Oct 22, 2008 at 1:27 PM, wrote:

> Your question seems ambiguous. Are you interested in getting Mount Failed
> notification Or failing mount operation itself.
> If we talk about notification, I think we will not get notifications on any
> operation failure (here-Mount) .
>
>
> —
> NTFSD is sponsored by OSR
>
> For our schedule debugging and file system seminars
> (including our new fs mini-filter seminar) visit:
> http://www.osr.com/seminars
>
> You are currently subscribed to ntfsd as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

>I see dismount notification when volume goes offline/delete volume, which forces Unmount >operation and volume itself gone. I could not find a way where i can just Unmount the Volume? >and fail the Unmount somehow on the same volume, so that my driver get the Dismout Fail >notification?

I think, u have to test/reproduce the dismount getting failed. I think for this you can fire FSCTL_DISMOUNT_VOLUME before doing this hold a reference of the FS stack for the volume you want to dismount.