Re: newbie question: about IoRegisterFsRegistrationCh ange and sfilter

You misunderstand this API.

File systems (FAT, NTFS, CDFS, UDFS, MRXRDR, MRXDAV) register as file
systems by calling IoRegisterFileSystem.

File system filter drivers learn of these file systems by registering for
notification of these registration (IoRegisterFsRegistrationChange).

This is *not* the same as notification of mounting file system media - to
observe the arrival of new media (including removable devices such as a 1394
disk drive) you must filter one of the appropriate file systems (FAT, NTFS,
UDFS) and watch for the IRP_MJ_FILE_SYSTEM_CONTROL, IRP_MN_MOUNT_VOLUME.
When that is successful, you can attach to the newly created device.

Thus, you are confusing the two mechanisms.

Regards,

Tony

Tony Mason
Consulting Partner
OSR Open Systems Resources, Inc.
http://www.osr.com

-----Original Message-----
From: Yang [mailto:xxxxx@aredian.com.cn]
Sent: Saturday, August 02, 2003 12:33 AM
To: File Systems Developers
Subject: [ntfsd] Re: newbie question: about IoRegisterFsRegistrationChange
and sfilter

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.
> > > >
> >
> >
> >
> >
>
>
>
>


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