Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Home NTFSD

Before Posting...

Please check out the Community Guidelines in the Announcements and Administration Category.

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


RE: Problem with calling FltGetVolumeFromName in InstanceSetup callback

OSR_Community_UserOSR_Community_User Member Posts: 110,217
Sorry for the slow reply (Vista is keeping us very busy):

There is a known deadlock issues with the MoungMgr that causes deadlocks
if you query for the DOS name or GUID name of a volume at instance setup
time. Filter manager has done several things to try and work around
this issue but it turned out that it is not a 100% solution. So at this
point it is not safe.

This is why the problem occurs:
- Instance setup is called on the first create IRP after a volume has
mounted
- Unfortunately the first create IRP is often generated by the mount mgr
which is holding a lock when it issues this create.
- If from instance setup you do something that calls back into the
mountmgr (like get the guid name or DOS name of a volume) you deadlock
on this lock
- Filter manager tries to detect this create from the mount mgr and not
call instance setup at this time. This works fairly well but there are
scenarios we can't detect.
- Thus you deadlock.

Now the good news. A QFE has been generated to address this issue on
Srv03. I do not have the KB number but as soon as I get it I will let
you know.

This issue has been fixed on Longhorn.

If this is affecting your product on XP I suggest you complain to your
Microsoft representative and see if you can get them to port the QFE to
XP as well.

To answer the original question, it sounds to me like you are trying to
open a storage stack device object. I believe it would deadlock for the
same reason because the open request will go through the mount manager.

Neal Christiansen
Microsoft File System Filter Group Lead
This posting is provided "AS IS" with no warranties, and confers no
Rights


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of kamii
Sent: Wednesday, February 08, 2006 9:27 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback


I found the message that it is not safe to call FltGetVolumeGuidName
routine
during the
InstanceSetupCallBack.

https://www.osronline.com/showThread.CFM?link=79416

Is it true?


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of kamii
Sent: Thursday, February 09, 2006 12:10 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback

Thank you for your advice.
But I found the case that the volume's GUID name was changed in some
rare
condition.
Thus I choose the form "\??\STORAGE#Volume#...".

Kamii

-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ken Cross
Sent: Wednesday, February 08, 2006 11:40 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback

Then do it the other way around: Get the volume name of the new
instance
using FltGetVolumeName (or FltGetVolumeGuidName) with the
FltObjects->Volume
passed to the routine and compare it to your saved name.

Ken


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of kamii
Sent: Wednesday, February 08, 2006 9:26 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback

I didin't mean the volume's GUID name "\??\Volume{GUID}".
But the same problem occurred when I chose the form "\??\Volume{GUID}".

I'm trying that..
(1) The persistent volume names are saved in registry and
(2) Minifilter read them in DriverEntry and
(3) In InstanceSetup callback if new volume's persistent name is same as
(1), I attach filter to them.

It works well in single volume drive,
but It doesn't work in multiple volumes drive.

FltGetVolumeFromName calling to the volume whoes instace have not been
set
up seems to cause system hung.

(When 1st volume's InstanceSetup, FltGetVolumeFromName call with the 2nd
volume's GUID name)

Regards
Kamii


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ken Cross
Sent: Wednesday, February 08, 2006 10:08 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback

I'm not familiar with a volume name in the form
"\??\STORAGE#Volume#...".
Do you mean the volume's GUID name "\??\Volume{GUID}" ?

Drivers typically use the volume's GUID name or the volume's
nonpersistent
device object name (for example, "\Device\HarddiskVolume1"). The FltMgr
routines primarily use nonpersistent device object names.

Ken


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of kamii
Sent: Wednesday, February 08, 2006 6:28 AM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback

I have another question.

Can I get the FltObjects->Volume's name in the form
"\??\STORAGE#Volume#..."
in InstanceSetup callback?

Regards,
Kamii.


-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of kamii
Sent: Wednesday, February 08, 2006 8:16 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback

I meant the system hung. (without failed status) The name was
"\??\STORAGE#Volume#..." form.

That volume's instance had not been setted up, but that volume was
connected.
My device has 2-volumes. Calling FltGetVolumeFromName to 2nd volume from
1st
volume's InstanceSetup callback cause system hung.
I'm expecting that FltGetVolumeFromName call will return with failed
status.

I'd like to decide whether to attach filter or not to attach filter in
InstanceSetup callback by the volume's name comparing.



-----Original Message-----
From: [email protected]
[mailto:[email protected]] On Behalf Of Ken Cross
Sent: Wednesday, February 08, 2006 7:50 PM
To: Windows File Systems Devs Interest List
Subject: RE: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup callback

What do you mean "was not returned"? The system hung? Crashed? Failed
status? What name was passed? Had the instance been set up for that
volume
yet?

Yes, you can call FltGetVolumeFromName in InstanceSetup. Of course, for
the
instance being set up, you can simply call FltGetVolumeName using the
FltObjects->Volume passed to the routine.

Ken


-----Original Message-----
From: [email protected]
[mailto:x[email protected]] On Behalf Of kamii
Sent: Tuesday, February 07, 2006 8:18 PM
To: Windows File Systems Devs Interest List
Subject: [ntfsd] Problem with calling FltGetVolumeFromName in
InstanceSetup
callback

Hi,

I found the case that calling FltGetVolumeFromName function from
InstanceSetup callback was not returned.

Is it possible to call FltGetVolumeFromName in InstanceSetup callback?

Regards,
Kamii






---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To
unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To
unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To
unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected] To unsubscribe
send a blank email to [email protected]



---
Questions? First check the IFS FAQ at
https://www.osronline.com/article.cfm?id=17

You are currently subscribed to ntfsd as: [email protected]
To unsubscribe send a blank email to [email protected]
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Writing WDF Drivers 12 September 2022 Live, Online
Internals & Software Drivers 23 October 2022 Live, Online
Kernel Debugging 14 November 2022 Live, Online
Developing Minifilters 5 December 2022 Live, Online