Re: FltGetVolumeGuidName during InstanceSetup

Could someone please shed some some light on InstanceSetupCallback for me? I
have a minifilter based on minispy, running on XP, 2000, and 2003.
When I add a new volume (such as a USB stick), my instance set up is not
being called. It is only called when I manually attach (for example fltmc
attach ) to that volume.
Reading through the posts, answer by Dan below and the docs (Filter Driver
Development Guide: “
The InstanceSetupCallback() routine gets called for the following reasons:

· When a new volume is mounted.”)

my understanding is the InstanceSetup should be called automatically when I
add the USB stick. I tried changing the Registry setting (AttachWhenLoaded)
to 1.
The only other thing I can think of is that I may need to specify the
appropriate flag (“FLTFL_INSTANCE_SETUP_NEWLY_MOUNTED_VOLUME” ?) - it was my
understanding that the filter manager would set that flag and pass it in to
the Instance Setup. Is that assumption wrong?

Is there anything else I am missing why the InstanceSetup gets called during
attach but not during mount?

Thanks,

bjorn

> The documentation says it is safe to call this routine during the
InstanceSetupCallBack.

It is not safe. This was revealed at the last plugfest. You need to post
the query to a worker thread to the volume guid name without a deadlock.

It stinks, but that’s the way it is.

- Dan.

Resending this as I never saw it posted. Sorry if you see it twice.

bjorn

“bjorn haake” wrote in message news:…
> Could someone please shed some some light on InstanceSetupCallback for me?
> I have a minifilter based on minispy, running on XP, 2000, and 2003.
> When I add a new volume (such as a USB stick), my instance set up is not
> being called. It is only called when I manually attach (for example fltmc
> attach ) to that volume.
> Reading through the posts, answer by Dan below and the docs (Filter Driver
> Development Guide: “
> The InstanceSetupCallback() routine gets called for the following reasons:
> …
> · When a new volume is mounted.”)
>
> my understanding is the InstanceSetup should be called automatically when
> I add the USB stick. I tried changing the Registry setting
> (AttachWhenLoaded) to 1.
> The only other thing I can think of is that I may need to specify the
> appropriate flag (“FLTFL_INSTANCE_SETUP_NEWLY_MOUNTED_VOLUME” ?) - it was
> my understanding that the filter manager would set that flag and pass it
> in to the Instance Setup. Is that assumption wrong?
>
> Is there anything else I am missing why the InstanceSetup gets called
> during attach but not during mount?
>
> Thanks,
>
> bjorn
>
>
>
>
>> The documentation says it is safe to call this routine during the
> InstanceSetupCallBack.
>
> It is not safe. This was revealed at the last plugfest. You need to post
> the query to a worker thread to the volume guid name without a deadlock.
>
> It stinks, but that’s the way it is.
>
> - Dan.
>
>
>

Instance setup should be called automatically when it recognizes a new
volume in the system.

Can you confirm that the memory stick was properly formatted and had a
file system on it?

Is the issue that your InstanceSetup routine is never called or
sometimes called? I ask because the FAT file system has this
interesting feature that it remembers the previously mounted volume and
if media reappears for that volume before it tears down you will not see
a new mount, it will simply reattach to the existing volume.

What this means is you would see the InstanceSetup the first time you
plugged the memory stick in but if you unplug it and plug it back in
without making any changes to the media you probably will not see a new
mount request and thus no instance setup.

Neal Christiansen
Microsoft NTFS Development Lead
This posting is provided “AS IS” with no warranties, and confers no
Rights

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of bjorn haake
Sent: Wednesday, January 17, 2007 9:49 AM
To: Windows File Systems Devs Interest List
Subject: Re:[ntfsd] FltGetVolumeGuidName during InstanceSetup

Resending this as I never saw it posted. Sorry if you see it twice.

bjorn

“bjorn haake” wrote in message news:…
> Could someone please shed some some light on InstanceSetupCallback for
me?
> I have a minifilter based on minispy, running on XP, 2000, and 2003.
> When I add a new volume (such as a USB stick), my instance set up is
not
> being called. It is only called when I manually attach (for example
fltmc
> attach ) to that volume.
> Reading through the posts, answer by Dan below and the docs (Filter
Driver
> Development Guide: “
> The InstanceSetupCallback() routine gets called for the following
reasons:
> …
> * When a new volume is mounted.”)
>
> my understanding is the InstanceSetup should be called automatically
when
> I add the USB stick. I tried changing the Registry setting
> (AttachWhenLoaded) to 1.
> The only other thing I can think of is that I may need to specify the
> appropriate flag (“FLTFL_INSTANCE_SETUP_NEWLY_MOUNTED_VOLUME” ?) - it
was
> my understanding that the filter manager would set that flag and pass
it
> in to the Instance Setup. Is that assumption wrong?
>
> Is there anything else I am missing why the InstanceSetup gets called
> during attach but not during mount?
>
> Thanks,
>
> bjorn
>
>
>
>
>> The documentation says it is safe to call this routine during the
> InstanceSetupCallBack.
>
> It is not safe. This was revealed at the last plugfest. You need to
post
> the query to a worker thread to the volume guid name without a
deadlock.
>
> It stinks, but that’s the way it is.
>
> - Dan.
>
>
>


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

You are currently subscribed to ntfsd as: xxxxx@windows.microsoft.com
To unsubscribe send a blank email to xxxxx@lists.osr.com