AW: Attaching to FAT File System

Your driver should register itself with IoRegisterFsRegistrationChange.
As i recall, the tfilter sample in the IFS Kit do this.

regards,

michael

-----Urspr?ngliche Nachricht-----
Von: Ratmil Torres Vargas [mailto:xxxxx@ghost.matcom.uh.cu]
Gesendet am: Montag, 3. April 2000 21:22
An: File Systems Developers
Betreff: [ntfsd] Attaching to FAT File System

Hello, I am developing a File System Filter Driver, and I’m having
problems for checking accesses to the floppy drive. I know WNT loads the
FAT File System Driver when the first access to the floppy is made. And to
get control when this happens I attach to the FAT recognizer. But on
completion of what request to the recognizer do I have to attach (on
completion to MOUNT_VOLUME or LOAD_FILE_SYSTEM) and what device do I have
to attach (is it the device named “\FAT”)?
Thanx in advance.


You are currently subscribed to ntfsd as: xxxxx@glueckkanja.de
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Thank you very much but I guess that works only on W2K, are you sure it
works on WNT too?

On Tue, 4 Apr 2000, [iso-8859-1] I?aki Castillo wrote:

You need to register with IoRegisterFsRegistrationChange.
You will receive a call to this function when a new file system is mounted.

Inaki.

Yes, it works also in NT4.
It does not work under NT351.

Inaki.

-----Original Message-----
From: Ratmil Torres Vargas
Sent: martes 4 de abril de 2000 15:02
To: File Systems Developers
Subject: [ntfsd] RE: Attaching to FAT File System

Este mensaje utiliza un juego de caracteres no compatible con el servicio
de Internet. Para ver el contenido original del mensaje abra el mensaje
adjunto. Si el texto no se muestra de forma correcta, guarde en disco el
mensaje adjunto y, a continuaci?n, ?bralo utilizando un visor que pueda
mostrar el juego original de caracteres. << File: message.txt >>

On Tue, 4 Apr 2000, [iso-8859-1] I?aki Castillo wrote:

Yes, it works also in NT4.
It does not work under NT351.

What do I have to do for NT351

Hello I asked this question a few days ago:
Hello, I am developing a File System Filter Driver, and I’m having
problems for checking accesses to the floppy drive. I know WNT loads the
FAT File System Driver when the first access to the floppy is made. And to
get control when this happens I attach to the FAT recognizer. But on
completion of what request to the recognizer do I have to attach (on
completion to MOUNT_VOLUME or LOAD_FILE_SYSTEM) and what device do I have
to attach (is it the device named “\FAT”)?
Thanx in advance.
I was told to use the function “IoRegisterFsRegistrationChange” but it is
not documented neither in the NT DDK nor the W2K DDK, may be I’m missing
some .h. Any way this function is only supported in WNT 4 and superior.
Does anyone knows a solution for WNT < 4?

hi,
1.LOAD_FILE_SYSTEM is sent by IO manager when the the FSR has recognised the
the volume( in response to LOAD_VOLUME) and send the status as
STATUS_FS_DRIVER_REQUIRED. So, i think u should attach FS filter driver at
this moment.
2. IoRegisterFsRegistrationChange is documented in IFS kit. Go to
\src\filesys\inc\ntifs.h

thanx
pash

Hello I asked this question a few days ago:
Hello, I am developing a File System Filter Driver, and I’m having
problems for checking accesses to the floppy drive. I know WNT loads the
FAT File System Driver when the first access to the floppy is made. And to
get control when this happens I attach to the FAT recognizer. But on
completion of what request to the recognizer do I have to attach (on
completion to MOUNT_VOLUME or LOAD_FILE_SYSTEM) and what device do I have
to attach (is it the device named “\FAT”)?
Thanx in advance.
I was told to use the function “IoRegisterFsRegistrationChange” but it is
not documented neither in the NT DDK nor the W2K DDK, may be I’m missing
some .h. Any way this function is only supported in WNT 4 and superior.
Does anyone knows a solution for WNT < 4?


You are currently subscribed to ntfsd as: xxxxx@Legato.COM
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

Thank you. I found IoRegisterFsRegistrationChange prototype and I get
called when the “FastFat” driver is loaded but now I don’t know what
device do I have to attach to then . FastFat has one device named “Fat”
and one unnamed device per every drive letter that uses Fat File System.
Attaching to “Fat” I get IRPs but can’t get filename, I guess I have
to attach to these unnamed devices, but they are unnamed how do I make it?

On Thu, 13 Apr 2000, Pashupati Kumar wrote:

hi,
1.LOAD_FILE_SYSTEM is sent by IO manager when the the FSR has recognised the
the volume( in response to LOAD_VOLUME) and send the status as
STATUS_FS_DRIVER_REQUIRED. So, i think u should attach FS filter driver at
this moment.
2. IoRegisterFsRegistrationChange is documented in IFS kit. Go to
\src\filesys\inc\ntifs.h

thanx
pash

> Hello I asked this question a few days ago:
> Hello, I am developing a File System Filter Driver, and I’m having
> problems for checking accesses to the floppy drive. I know WNT loads the
> FAT File System Driver when the first access to the floppy is made. And to
> get control when this happens I attach to the FAT recognizer. But on
> completion of what request to the recognizer do I have to attach (on
> completion to MOUNT_VOLUME or LOAD_FILE_SYSTEM) and what device do I have
> to attach (is it the device named “\FAT”)?
> Thanx in advance.
> I was told to use the function “IoRegisterFsRegistrationChange” but it is
> not documented neither in the NT DDK nor the W2K DDK, may be I’m missing
> some .h. Any way this function is only supported in WNT 4 and superior.
> Does anyone knows a solution for WNT < 4?
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@Legato.COM
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)


You are currently subscribed to ntfsd as: xxxxx@ghost.matcom.uh.cu
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

this way…

loopDeviceObject = fatDriverObject->DeviceObject;
while (loopDeviceObject) {

// create a new device similar characteristics of
loopdeviceobject
… // basic code to prepare
for attach.

IoAttachDeviceByPointer( your_newly_created_device,
loopdeviceobject );

// walk through the FAT driver created device objects linked list
loopDeviceObject = loopDeviceObject->NextDevice;

}

---- alexander suresh

----- Original Message -----
From: Ratmil Torres Vargas
To: File Systems Developers
Sent: Thursday, April 13, 2000 9:09 AM
Subject: [ntfsd] Re: Attaching to Fat File System

> Thank you. I found IoRegisterFsRegistrationChange prototype and I get
File System.
> Attaching to “Fat” I get IRPs but can’t get filename, I guess I have
> to attach to these unnamed devices, but they are unnamed how do I make it?
>

Yes, I used to this but it is not the legal way it can be dangerous,
anyway I found out how to do it but I don’t have much time now. Tell me
if you want to know how I did it.

On Thu, 13 Apr 2000, Alexander Suresh wrote:

this way…

loopDeviceObject = fatDriverObject->DeviceObject;
while (loopDeviceObject) {

// create a new device similar characteristics of
loopdeviceobject
… // basic code to prepare
for attach.

IoAttachDeviceByPointer( your_newly_created_device,
loopdeviceobject );

// walk through the FAT driver created device objects linked list
loopDeviceObject = loopDeviceObject->NextDevice;

}

---- alexander suresh

----- Original Message -----
From: Ratmil Torres Vargas
> To: File Systems Developers
> Sent: Thursday, April 13, 2000 9:09 AM
> Subject: [ntfsd] Re: Attaching to Fat File System
>
>
> > Thank you. I found IoRegisterFsRegistrationChange prototype and I get
> File System.
> > Attaching to “Fat” I get IRPs but can’t get filename, I guess I have
> > to attach to these unnamed devices, but they are unnamed how do I make it?
> >
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@ghost.matcom.uh.cu
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>

Look at the SFILTER example in the IFS Kit, it shows exactly how to do this.
If you don’t have the IFSKit I recommend you get it. You can go to
http://www.microsoft.com/hwdev/ntifskit/ for information on ordering it.

Following is a brief overview of how this works:

  • Call IoRegisterFsRegistrationChange during your DriverEntry routine.

  • When your registered FsNotification routine is called it is because a new
    file system has been loaded. You can call ObQueryNameString on the given
    device object and compare it to what file system you are interested in (like
    \FastFat). If it is the desired file system then attach to it.

  • You will now see all mount requests for this file system. When you see a
    mount request, attach to the given device object. Note that these are the
    unnamed device objects you were referring to. Now that you are attached you
    will see all of the IRP and FastIO calls for the given volume.

The DeviceTree utility at WWW.OSR.COM is good for viewing the different file
systems (including filte system filters), their associated device objects,
and how they are attached. You will want the 1.x version of this utility
because for some reason they removed the display of file system information
from the 2.x versions of the utility.

Neal Christiansen

-----Original Message-----
From: Ratmil Torres Vargas [mailto:xxxxx@ghost.matcom.uh.cu]
Sent: Wednesday, April 12, 2000 7:12 AM
To: File Systems Developers
Subject: [ntfsd] Attaching to Fat File System

Hello I asked this question a few days ago:
Hello, I am developing a File System Filter Driver, and I’m having
problems for checking accesses to the floppy drive. I know WNT loads the
FAT File System Driver when the first access to the floppy is made. And to
get control when this happens I attach to the FAT recognizer. But on
completion of what request to the recognizer do I have to attach (on
completion to MOUNT_VOLUME or LOAD_FILE_SYSTEM) and what device do I have
to attach (is it the device named “\FAT”)?
Thanx in advance.
I was told to use the function “IoRegisterFsRegistrationChange” but it is
not documented neither in the NT DDK nor the W2K DDK, may be I’m missing
some .h. Any way this function is only supported in WNT 4 and superior.
Does anyone knows a solution for WNT < 4?


You are currently subscribed to ntfsd as: xxxxx@Exchange.Microsoft.com
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

isn’t what alexander wrote the normal way?

Ho Mun Chuen
@@ “Not everything that counts can be counted;
<” )~ and not everything that can be counted counts"
//\ … Albert Einstein
----- Original Message -----
From: Ratmil Torres Vargas
To: File Systems Developers
Sent: Saturday, April 15, 2000 4:53 AM
Subject: [ntfsd] Re: Attaching to Fat File System

Yes, I used to this but it is not the legal way it can be dangerous,
anyway I found out how to do it but I don’t have much time now. Tell me
if you want to know how I did it.

On Thu, 13 Apr 2000, Alexander Suresh wrote:

> this way…
>
> loopDeviceObject = fatDriverObject->DeviceObject;
> while (loopDeviceObject) {
>
> // create a new device similar characteristics of
> loopdeviceobject
> … // basic code to prepare
> for attach.
> …
> IoAttachDeviceByPointer( your_newly_created_device,
> loopdeviceobject );
>
> // walk through the FAT driver created device objects linked
list
> loopDeviceObject = loopDeviceObject->NextDevice;
>
> }
>
>
> ---- alexander suresh
>
> ----- Original Message -----
> From: Ratmil Torres Vargas
> To: File Systems Developers
> Sent: Thursday, April 13, 2000 9:09 AM
> Subject: [ntfsd] Re: Attaching to Fat File System
>
>
> > Thank you. I found IoRegisterFsRegistrationChange prototype and I get
> File System.
> > Attaching to “Fat” I get IRPs but can’t get filename, I guess I have
> > to attach to these unnamed devices, but they are unnamed how do I make
it?
> >
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@ghost.matcom.uh.cu
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>


You are currently subscribed to ntfsd as: xxxxx@pmail.ntu.edu.sg
To unsubscribe send a blank email to $subst(‘Email.Unsub’)

On Wed, 3 May 2000, Ho Mun Chuen wrote:

isn’t what alexander wrote the normal way?

Who is Alexander?
Anyway. First you call IoRegisterFsRegistrationChange with a pointer to
your function. By that way you can attach to the “Fat” device. This device
will receive IRPs with major function IRP_MJ_MOUNT_VOLUME, on completion
of this request you can attach to the mounted volume. I dont have the code
here because I have the mail in one place and work in another. So I don’t
remember some details. So wait a while and I will send it to you.

Ho Mun Chuen
@@ “Not everything that counts can be counted;
<” )~ and not everything that can be counted counts"
//\ … Albert Einstein

hello ratmil,
The method i have suggested is for layering over ALREADY mounted
voulumes by a FSD which had already registered iteself before you do
IoRegisterFsRegistrationChange(…). whereas, the method you are using will
work ONLY for FSD which register and mount volumes later after you have
issued IoRegisterFsRegistrationChange(…).

Will you be kind enough to explain in detail why my suggested code is
ILLEGAL and DANGEROUS and if you have any LEGAL and SAFE method for layering
over already mounted volumes.

please note that my sample code fragment was for demonstration purpose only
whereas my REAL code in my filter driver takes care of other issues like
what if some other filter driver has already attached to FSD volume devices
etc., if that is what you have in mind about DANGEROUS code

thanks & regds
alexander suresh

----- Original Message -----
From: Ho Mun Chuen
To: File Systems Developers
Sent: Wednesday, May 03, 2000 2:15 AM
Subject: [ntfsd] Re: Attaching to Fat File System

> isn’t what alexander wrote the normal way?
>
> Ho Mun Chuen
> @@ “Not everything that counts can be counted;
> <” )~ and not everything that can be counted counts"
> //\ … Albert Einstein
> ----- Original Message -----
> From: Ratmil Torres Vargas
> To: File Systems Developers
> Sent: Saturday, April 15, 2000 4:53 AM
> Subject: [ntfsd] Re: Attaching to Fat File System
>
>
> Yes, I used to this but it is not the legal way it can be dangerous,
> anyway I found out how to do it but I don’t have much time now. Tell me
> if you want to know how I did it.
>
> On Thu, 13 Apr 2000, Alexander Suresh wrote:
>
> > this way…
> >
> > loopDeviceObject = fatDriverObject->DeviceObject;
> > while (loopDeviceObject) {
> >
> > // create a new device similar characteristics of
> > loopdeviceobject
> > … // basic code to
prepare
> > for attach.
> > …
> > IoAttachDeviceByPointer( your_newly_created_device,
> > loopdeviceobject );
> >
> > // walk through the FAT driver created device objects linked
> list
> > loopDeviceObject = loopDeviceObject->NextDevice;
> >
> > }
> >
> >
> > ---- alexander suresh
> >
> > ----- Original Message -----
> > From: Ratmil Torres Vargas
> > To: File Systems Developers
> > Sent: Thursday, April 13, 2000 9:09 AM
> > Subject: [ntfsd] Re: Attaching to Fat File System
> >
> >
> > > Thank you. I found IoRegisterFsRegistrationChange prototype and I
get
> > File System.
> > > Attaching to “Fat” I get IRPs but can’t get filename, I guess I have
> > > to attach to these unnamed devices, but they are unnamed how do I make
> it?
> > >
> >
> >
> >
> > —
> > You are currently subscribed to ntfsd as: xxxxx@ghost.matcom.uh.cu
> > To unsubscribe send a blank email to $subst(‘Email.Unsub’)
> >
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@pmail.ntu.edu.sg
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@mobiliti.com
> To unsubscribe send a blank email to $subst(‘Email.Unsub’)
>
>

Hello, Alexander.
Sorry for taking too long to answer.
May be I have been misunderstood. But what you mean is that you walk
through the devices list this way :
device = driver->DeviceObject;
while(device){
device = device->NextDevice;
}
I thought of this solution too but I got some blue screens. I wrote to
this list asking for help and I got answered (don’t remember by who) and I
was told it was dangarous because de device list could change while I was
walking through it.
Yes, I know my method doesn’t work if I load my driver too late but the idea
is to load it as soon as posible.
So tell me your opinion. I’m new to this driver thing.
Thank you.

On Wed, 3 May 2000, Alexander Suresh wrote:

hello ratmil,
The method i have suggested is for layering over ALREADY mounted
voulumes by a FSD which had already registered iteself before you do
IoRegisterFsRegistrationChange(…). whereas, the method you are using will
work ONLY for FSD which register and mount volumes later after you have
issued IoRegisterFsRegistrationChange(…).