newbie question: about IoRegisterFsRegistrationChange and sfilter

Dear all
I’ve read the sfilter sample in MS IFS kit and wrote my own file system
filter driver according to it. But I’ve got a problem on attaching to my
logical drivers.
I used the function IoRegisterFsRegistrationChange to register my driver
so it will be called whenever a new file systems is loaded. But seems it
doesn’t work for my win2000 machine. After I’ve loaded my driver into
memory, nothing happens. Then I restarted it, I got only a tip that a device
named “\Device\LanmanRedirector” had been hooked and IRPs sent to that
device began to redirect to my driver. None of my logical drivers(C: D: E:)
were hooked.

Could someone tell me what’s wrong with my driver?
If I want to hook all my logical drivers, what should I do? Check all
the 26 driver letters and attach to it if it’s available? Is there a ‘neat’
way to achive it?

thanks

Yang Liu

IoRegisterFsRegistrationChange informs you that a file system driver has
registed so you can filter mount requests and attach your driver when volume
is mounted. On Windows 2000 this function will notify your driver about file
systems that were registered after you have called this function. On XP and
later this function notifies filter about already registred file systems as
well.
If your driver is loaded at boot time on Windows 2000 it will get
notifications about all file systems.
There is no way to discover file systems that are already registed on
Windows 2000. You can attach your filter to file systems you know about -
FAT, NTFS and CDFS. You need to use IoGetDeviceObjectPointer specifing name
\Fat or \Ntfs to get device object you need to attach to.

Alexei.

“Yang” wrote in message news:xxxxx@ntfsd…
>
> Dear all
> I’ve read the sfilter sample in MS IFS kit and wrote my own file
system
> filter driver according to it. But I’ve got a problem on attaching to my
> logical drivers.
> I used the function IoRegisterFsRegistrationChange to register my
driver
> so it will be called whenever a new file systems is loaded. But seems it
> doesn’t work for my win2000 machine. After I’ve loaded my driver into
> memory, nothing happens. Then I restarted it, I got only a tip that a
device
> named “\Device\LanmanRedirector” had been hooked and IRPs sent to that
> device began to redirect to my driver. None of my logical drivers(C: D:
E:)
> were hooked.
>
> Could someone tell me what’s wrong with my driver?
> If I want to hook all my logical drivers, what should I do? Check all
> the 26 driver letters and attach to it if it’s available? Is there a
‘neat’
> way to achive it?
>
> thanks
>
> Yang Liu
>
>
>
>

Thanks Alexei,
I have got a new question:
Does the rule for IoRegisterFsRegistrationChange apply to the USB device?
I mean when I plug in or plug out an USB device(A removeable disk), will my
driver also get notified? I’ve tested this case in my machine, but also
failed to get the notification. Even it just appears in my computer as a
form of logical driver.

Regards
Yang Liu

“Alexei Jelvis” wrote in message news:xxxxx@ntfsd…
>
> IoRegisterFsRegistrationChange informs you that a file system driver has
> registed so you can filter mount requests and attach your driver when
volume
> is mounted. On Windows 2000 this function will notify your driver about
file
> systems that were registered after you have called this function. On XP
and
> later this function notifies filter about already registred file systems
as
> well.
> If your driver is loaded at boot time on Windows 2000 it will get
> notifications about all file systems.
> There is no way to discover file systems that are already registed on
> Windows 2000. You can attach your filter to file systems you know about -
> FAT, NTFS and CDFS. You need to use IoGetDeviceObjectPointer specifing
name
> \Fat or \Ntfs to get device object you need to attach to.
>
> Alexei.
>
> “Yang” wrote in message news:xxxxx@ntfsd…
> >
> > Dear all
> > I’ve read the sfilter sample in MS IFS kit and wrote my own file
> system
> > filter driver according to it. But I’ve got a problem on attaching to my
> > logical drivers.
> > I used the function IoRegisterFsRegistrationChange to register my
> driver
> > so it will be called whenever a new file systems is loaded. But seems it
> > doesn’t work for my win2000 machine. After I’ve loaded my driver into
> > memory, nothing happens. Then I restarted it, I got only a tip that a
> device
> > named “\Device\LanmanRedirector” had been hooked and IRPs sent to that
> > device began to redirect to my driver. None of my logical drivers(C: D:
> E:)
> > were hooked.
> >

IoRegisterFsRegistrationChange allows you to attach to file systems and
monitor requests to mount volume, it is not related to a particular
hardware.
What do you mean that your driver failed to get notification? Does it mean
that it got mount request but all file systems it attached to fail to
recognize volume or it doesn’t get called at all? Does USB device has a
valid file system?

Alexei.

“Yang” wrote in message news:xxxxx@ntfsd…
>
> Thanks Alexei,
> I have got a new question:
> Does the rule for IoRegisterFsRegistrationChange apply to the USB device?
> I mean when I plug in or plug out an USB device(A removeable disk), will
my
> driver also get notified? I’ve tested this case in my machine, but also
> failed to get the notification. Even it just appears in my computer as a
> form of logical driver.
>
> Regards
> Yang Liu
>
> “Alexei Jelvis” wrote in message
news:xxxxx@ntfsd…
> >
> > IoRegisterFsRegistrationChange informs you that a file system driver
has
> > registed so you can filter mount requests and attach your driver when
> volume
> > is mounted. On Windows 2000 this function will notify your driver about
> file
> > systems that were registered after you have called this function. On XP
> and
> > later this function notifies filter about already registred file systems
> as
> > well.
> > If your driver is loaded at boot time on Windows 2000 it will get
> > notifications about all file systems.
> > There is no way to discover file systems that are already registed on
> > Windows 2000. You can attach your filter to file systems you know
about -
> > FAT, NTFS and CDFS. You need to use IoGetDeviceObjectPointer specifing
> name
> > \Fat or \Ntfs to get device object you need to attach to.
> >
> > Alexei.
> >
> > “Yang” wrote in message news:xxxxx@ntfsd…
> > >
> > > Dear all
> > > I’ve read the sfilter sample in MS IFS kit and wrote my own file
> > system
> > > filter driver according to it. But I’ve got a problem on attaching to
my
> > > logical drivers.
> > > I used the function IoRegisterFsRegistrationChange to register my
> > driver
> > > so it will be called whenever a new file systems is loaded. But seems
it
> > > doesn’t work for my win2000 machine. After I’ve loaded my driver into
> > > memory, nothing happens. Then I restarted it, I got only a tip that a
> > device
> > > named “\Device\LanmanRedirector” had been hooked and IRPs sent to that
> > > device began to redirect to my driver. None of my logical drivers(C:
D:
> > E:)
> > > were hooked.
> > >
>
>
>
>

Thanks for the replay, Alexei.
I mean that the callback routine of my driver didn’t get called at all when
I plug in a removeable disk device. When I plugged in the device, my machine
added a logical disk named “F:”, does it mean that the IO manager had
mounted a volume on it? Then my callback routine should has been called at
that time? However, I’m not very sure.

“Alexei Jelvis” wrote in message news:xxxxx@ntfsd…
>
> IoRegisterFsRegistrationChange allows you to attach to file systems and
> monitor requests to mount volume, it is not related to a particular
> hardware.
> What do you mean that your driver failed to get notification? Does it mean
> that it got mount request but all file systems it attached to fail to
> recognize volume or it doesn’t get called at all? Does USB device has a
> valid file system?
>
> Alexei.
>
> “Yang” wrote in message news:xxxxx@ntfsd…
> >
> > Thanks Alexei,
> > I have got a new question:
> > Does the rule for IoRegisterFsRegistrationChange apply to the USB
device?
> > I mean when I plug in or plug out an USB device(A removeable disk), will
> my
> > driver also get notified? I’ve tested this case in my machine, but also
> > failed to get the notification. Even it just appears in my computer as a
> > form of logical driver.
> >
> > Regards
> > Yang Liu
> >
> > “Alexei Jelvis” wrote in message
> news:xxxxx@ntfsd…
> > >
> > > IoRegisterFsRegistrationChange informs you that a file system driver
> has
> > > registed so you can filter mount requests and attach your driver when
> > volume
> > > is mounted. On Windows 2000 this function will notify your driver
about
> > file
> > > systems that were registered after you have called this function. On
XP
> > and
> > > later this function notifies filter about already registred file
systems
> > as
> > > well.
> > > If your driver is loaded at boot time on Windows 2000 it will get
> > > notifications about all file systems.
> > > There is no way to discover file systems that are already registed on
> > > Windows 2000. You can attach your filter to file systems you know
> about -
> > > FAT, NTFS and CDFS. You need to use IoGetDeviceObjectPointer specifing
> > name
> > > \Fat or \Ntfs to get device object you need to attach to.
> > >
> > > Alexei.
> > >
> > > “Yang” wrote in message news:xxxxx@ntfsd…
> > > >
> > > > Dear all
> > > > I’ve read the sfilter sample in MS IFS kit and wrote my own file
> > > system
> > > > filter driver according to it. But I’ve got a problem on attaching
to
> my
> > > > logical drivers.
> > > > I used the function IoRegisterFsRegistrationChange to register
my
> > > driver
> > > > so it will be called whenever a new file systems is loaded. But
seems
> it
> > > > doesn’t work for my win2000 machine. After I’ve loaded my driver
into
> > > > memory, nothing happens. Then I restarted it, I got only a tip that
a
> > > device
> > > > named “\Device\LanmanRedirector” had been hooked and IRPs sent to
that
> > > > device began to redirect to my driver. None of my logical drivers(C:
> D:
> > > E:)
> > > > were hooked.
> > > >
> >
> >
> >
> >
>
>
>
>

> I mean that the callback routine of my driver didn’t get called at all when

I plug in a removeable disk device. When I plugged in the device, my machine

This is normal.

The callback is called on just after the FSD binary module load. The USB device
attach can trigger such an operation if, for instance, this USB disk is the
first FAT volume in the system. If it is not so, then USB device arrival will
not trigger
IoRegisterFsRegistrationChange callback.

Max

No. Filesystems are loaded and never unloaded.

Max

----- Original Message -----
From: “Yang”
Newsgroups: ntfsd
To: “File Systems Developers”
Sent: Saturday, August 02, 2003 6:57 AM
Subject: [ntfsd] Re: newbie question: about IoRegisterFsRegistrationChange and
sfilter

> Thanks Alexei,
> I have got a new question:
> Does the rule for IoRegisterFsRegistrationChange apply to the USB device?
> I mean when I plug in or plug out an USB device(A removeable disk), will my
> driver also get notified? I’ve tested this case in my machine, but also
> failed to get the notification. Even it just appears in my computer as a
> form of logical driver.
>
> Regards
> Yang Liu
>
> “Alexei Jelvis” wrote in message news:xxxxx@ntfsd…
> >
> > IoRegisterFsRegistrationChange informs you that a file system driver has
> > registed so you can filter mount requests and attach your driver when
> volume
> > is mounted. On Windows 2000 this function will notify your driver about
> file
> > systems that were registered after you have called this function. On XP
> and
> > later this function notifies filter about already registred file systems
> as
> > well.
> > If your driver is loaded at boot time on Windows 2000 it will get
> > notifications about all file systems.
> > There is no way to discover file systems that are already registed on
> > Windows 2000. You can attach your filter to file systems you know about -
> > FAT, NTFS and CDFS. You need to use IoGetDeviceObjectPointer specifing
> name
> > \Fat or \Ntfs to get device object you need to attach to.
> >
> > Alexei.
> >
> > “Yang” wrote in message news:xxxxx@ntfsd…
> > >
> > > Dear all
> > > I’ve read the sfilter sample in MS IFS kit and wrote my own file
> > system
> > > filter driver according to it. But I’ve got a problem on attaching to my
> > > logical drivers.
> > > I used the function IoRegisterFsRegistrationChange to register my
> > driver
> > > so it will be called whenever a new file systems is loaded. But seems it
> > > doesn’t work for my win2000 machine. After I’ve loaded my driver into
> > > memory, nothing happens. Then I restarted it, I got only a tip that a
> > device
> > > named “\Device\LanmanRedirector” had been hooked and IRPs sent to that
> > > device began to redirect to my driver. None of my logical drivers(C: D:
> > E:)
> > > were hooked.
> > >
>
>
>
> —
> You are currently subscribed to ntfsd as: xxxxx@storagecraft.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com