RE: Need help with usbstor.sys filter driver

Hello,
First, I thought of putting a check at the filter`s
AddDevice() routine. This check will “talk” with the
service. If the service will return OK, the filter
will return valid status, otherwise will return error
status. Will this make the device unusable?
Second,
what is this “disk” class driver? is it usbstor.sys?
how do I install such a filter driver?

Thank you,
Yigal

— Peter Wieland
wrote:

> I’m not sure how a service solves the problem of
> making the device visible in some sessions but not
> in others.
>
> on your second question: there is no “disk-on-key”
> device class, but there is a “disk” device class.
> That’s where you’d want to install your filter. You
> then need to determine whether the device is a USB
> disk or a fixed disk … you can use
> IOCTL_STORAGE_QUERY_PROPERTY to determine the bus
> type for a given disk device.
>
> I don’t beleive there’s a way to install your driver
> on a remote machine. SetupDI has some remote
> machine access, but i don’t believe that device
> installation is part of that. However i could be
> wrong - you should look at the SetupDi functions to
> find out for yourself.
>
> -p
>
>
>
> From: xxxxx@lists.osr.com on behalf of
> Yigal Maman
> Sent: Tue 3/28/2006 11:52 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Need help with usbstor.sys
> filter driver
>
>
>
> Thank you Peter for answering me.
> For the problem you mention I thought of making a
> user-mode service which will recieve messages from
> my
> driver (device insert\remove) and by the local
> policy
> will send messages back to the driver and tell him
> what to do.
> Do you think this approach will work?
>
> Also,
> I saw two examples in the ddk, but I still not quite
> sure how to make a filter driver for usb
> disk-on-keys,
> which will automaticly be loaded each time such a
> device is inserted. Does disk-on-key has a class
> guid?
> Maybe you can point me to the right direction.
>
> And last, (for now)
> is there a way to install a driver on a remote
> machine?
>
> Thanks any one for your help.
>
> Yigal
>
>
> — Peter Wieland
> wrote:
>
> > Look under src\storage\filters in the DDK to see
> one
> > way to install a
> > filter driver.
> >
> > You’ll have a bigger problem than how to load a
> > filter driver. Drivers
> > load in system context, not in the context of any
> > particular login
> > session. There isn’t a good way to determine the
> > “current user” and
> > with things like fast user switching the notion of
> > “current user” is
> > going away.
> >
> > This isn’t to say such a thing is unmanagable, but
> > you’ll need to think
> > more about how to handle multiple users logged on
> to
> > the system at the
> > same time, what happens when I switch users from
> > someone on the black
> > list to someone who isn’t (or vice versa).
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On
> Behalf
> > Of Yigal Maman
> > Sent: Sunday, March 26, 2006 10:15 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Need help with usbstor.sys filter
> > driver
> >
> > Hello,
> > Im a student and I thought of making a usb<br>&gt; &gt; disk-on-key manager as my<br>&gt; &gt; final graduate project.<br>&gt; &gt; The main concept is to "catch" the mass storage<br>&gt; &gt; devices inserted to the<br>&gt; &gt; machine and by comparing with "black list" of<br>&gt; &gt; usernames decide if to<br>&gt; &gt; enable the device or not.<br>&gt; &gt; I thought of making a filter driver to<br>&gt; "usbstor.sys"<br>&gt; &gt; as its the usb mass storage driver of Windows.<br>&gt; &gt;<br>&gt; &gt; I must say Im a newbie in this drivers world.
> > Its really not clear to me yet, how do I "tell"<br>&gt; &gt; Windows that my driver is a filter driver for<br>&gt; &gt; usbstor.sys?<br>&gt; &gt; My lucky guess is the INF file, but I cant
> realize
> > what the sections
> > and kays-values in such file should be, what is
> the
> > class name & guid
> > for mass storage devices and how I specify its a
> > filter driver.
> >
> > Also,
> > will it work if I simply implement my custom
> > AddDevice driver entry and
> > there check the users list?
> >
> > Please,
> > if anyone can answer my question(s) and help in
> any
> > way it would be
> > great… thanks
> >
> > Yigi
> >
> >
__________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > http://mail.yahoo.com http:</http:>
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of
> OSR
> > Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of
> OSR
> > Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
>
>
>
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com http:</http:>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR
> Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR
> Online at
http://www.osronline.com/page.cfm?name=ListServer


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

It will make it usable for everyone unless you somehow will start
failing i/o when the current user changes. Also, if the device is
plugged in during boot, it will be added far before your service is
running so it will always fail.

d

– I can spell, I just can’t type.

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of Yigal Maman
Sent: Thursday, August 24, 2006 2:56 AM
To: Windows System Software Devs Interest List
Subject: RE: [ntdev] Need help with usbstor.sys filter driver

Hello,
First, I thought of putting a check at the filter`s
AddDevice() routine. This check will “talk” with the service. If the
service will return OK, the filter will return valid status, otherwise
will return error status. Will this make the device unusable?
Second,
what is this “disk” class driver? is it usbstor.sys?
how do I install such a filter driver?

Thank you,
Yigal

— Peter Wieland
wrote:

> I’m not sure how a service solves the problem of making the device
> visible in some sessions but not in others.
>
> on your second question: there is no “disk-on-key”
> device class, but there is a “disk” device class.
> That’s where you’d want to install your filter. You then need to
> determine whether the device is a USB disk or a fixed disk … you can

> use IOCTL_STORAGE_QUERY_PROPERTY to determine the bus type for a given

> disk device.
>
> I don’t beleive there’s a way to install your driver on a remote
> machine. SetupDI has some remote machine access, but i don’t believe
> that device installation is part of that. However i could be wrong -
> you should look at the SetupDi functions to find out for yourself.
>
> -p
>
>
>
> From: xxxxx@lists.osr.com on behalf of Yigal Maman
> Sent: Tue 3/28/2006 11:52 PM
> To: Windows System Software Devs Interest List
> Subject: RE: [ntdev] Need help with usbstor.sys filter driver
>
>
>
> Thank you Peter for answering me.
> For the problem you mention I thought of making a user-mode service
> which will recieve messages from my driver (device insert\remove) and
> by the local policy will send messages back to the driver and tell him

> what to do.
> Do you think this approach will work?
>
> Also,
> I saw two examples in the ddk, but I still not quite sure how to make
> a filter driver for usb disk-on-keys, which will automaticly be loaded

> each time such a device is inserted. Does disk-on-key has a class
> guid?
> Maybe you can point me to the right direction.
>
> And last, (for now)
> is there a way to install a driver on a remote machine?
>
> Thanks any one for your help.
>
> Yigal
>
>
> — Peter Wieland
> wrote:
>
> > Look under src\storage\filters in the DDK to see
> one
> > way to install a
> > filter driver.
> >
> > You’ll have a bigger problem than how to load a filter driver.
> > Drivers load in system context, not in the context of any particular

> > login session. There isn’t a good way to determine the “current
> > user” and with things like fast user switching the notion of
> > “current user” is going away.
> >
> > This isn’t to say such a thing is unmanagable, but you’ll need to
> > think more about how to handle multiple users logged on
> to
> > the system at the
> > same time, what happens when I switch users from someone on the
> > black list to someone who isn’t (or vice versa).
> >
> > -p
> >
> > -----Original Message-----
> > From: xxxxx@lists.osr.com
> > [mailto:xxxxx@lists.osr.com] On
> Behalf
> > Of Yigal Maman
> > Sent: Sunday, March 26, 2006 10:15 AM
> > To: Windows System Software Devs Interest List
> > Subject: [ntdev] Need help with usbstor.sys filter driver
> >
> > Hello,
> > Im a student and I thought of making a usb disk-on-key manager as <br>&gt; &gt; my final graduate project.<br>&gt; &gt; The main concept is to "catch" the mass storage devices inserted to <br>&gt; &gt; the machine and by comparing with "black list" of usernames decide <br>&gt; &gt; if to enable the device or not.<br>&gt; &gt; I thought of making a filter driver to<br>&gt; "usbstor.sys"<br>&gt; &gt; as its the usb mass storage driver of Windows.<br>&gt; &gt;<br>&gt; &gt; I must say Im a newbie in this drivers world.
> > Its really not clear to me yet, how do I "tell"<br>&gt; &gt; Windows that my driver is a filter driver for usbstor.sys?<br>&gt; &gt; My lucky guess is the INF file, but I cant
> realize
> > what the sections
> > and kays-values in such file should be, what is
> the
> > class name & guid
> > for mass storage devices and how I specify its a filter driver.
> >
> > Also,
> > will it work if I simply implement my custom AddDevice driver entry
> > and there check the users list?
> >
> > Please,
> > if anyone can answer my question(s) and help in
> any
> > way it would be
> > great… thanks
> >
> > Yigi
> >
> >
__________________
> > Do You Yahoo!?
> > Tired of spam? Yahoo! Mail has the best spam protection around
> > http://mail.yahoo.com http:</http:>
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of
> OSR
> > Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
> >
> >
> > —
> > Questions? First check the Kernel Driver FAQ at
> > http://www.osronline.com/article.cfm?id=256
> >
> > To unsubscribe, visit the List Server section of
> OSR
> > Online at
> > http://www.osronline.com/page.cfm?name=ListServer
> >
>
>
>
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around
> http://mail.yahoo.com http:</http:>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR
> Online at
> http://www.osronline.com/page.cfm?name=ListServer
>
>
>
>
> —
> Questions? First check the Kernel Driver FAQ at
> http://www.osronline.com/article.cfm?id=256
>
> To unsubscribe, visit the List Server section of OSR
> Online at
http://www.osronline.com/page.cfm?name=ListServer


Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com


Questions? First check the Kernel Driver FAQ at
http://www.osronline.com/article.cfm?id=256

To unsubscribe, visit the List Server section of OSR Online at
http://www.osronline.com/page.cfm?name=ListServer