Problem of addfilter

Hi All,

I am new to this mailing list and driver development.

I wrote a filter driver for WinXP PRO SP2.
This driver does no job it only passes IRPs to the lower driver.

But I cannot add it to the proper place using an addfilter(DDK).
The addfilter showed some object names, but Floppy0 did not appear
in the list.

Also I tried another program(Article ID: 259695 in MS support site)
with argument SPDRP_PHYSICAL_DEVICE_OBJECT_NAME
for the function of SetupDiGetDeviceRegistryProperty.

Same result. Floppy0 did not appear but \000000xx and other many names.

Why Floppy0 cannot get with both program ?
I cannot test my filter driver.

Please give me some advice.

Image of Device Tree V2.6 by OSR(Thank you for fine tool)

DRV \Driver\Sfloppy
|
±-DEV \Device\Floppy0
|
±-ATT Attached:(I want to attache my filter driver here.)


DRV \Driver\USBSTOR
|
±-DEV \Device\000000xx
|
±-ATT \Device\Floppy0
|
±-ATT Attached:(I want to attache my filter driver here.)

Thank you for all.

Hiro with ED Soft Corp.
http://www.edsoftz.com/ (sorry only Japanese)

It seems to me you are looking for the wrong name. SetupDi* routines
work with informations that are placed in the registry, while Floppy0
is the name of the floppy device object and it’s in the object
namespace.

To add your filter to a floppy device stack, try the following:

  1. Create a service for your driver (by using SCManager routines).
  2. Use SetupDiGetClassDevs with class guid
    {4D36E980-E325-11CE-BFC1-080} (floppy drives). It will return HDEVINFO
    handle to the set of devices belonging to that class.
  3. Use HDEVINFO handle with SetupDiEnumDeviceInfo to have
    SP_DEVINFO_DATA filled for the first/next found device.
  4. Use HDEVINFO handle and SP_DEVINFO_DATA with
    SetupDiGetDeviceRegistryProperty to see if it is the device you want
    (eg. by checking HardwareID). If it isn’t, back to 3.
  5. Use SetupDiGetDeviceRegistryProperty to obtain UpperFilters (or
    LowerFilters) vaules. Add your service name to this value and write
    this value back, using SetupDiSetDeviceRegistryProperty.
  6. Restart windows. If everything is OK, your filter driver should be
    loaded automatically.

Best regards
Piotr Szulc

On Sat, 22 Jan 2005 03:52:12 +0900, Hiroshi Aihara wrote:
>
> Hi All,
>
> I am new to this mailing list and driver development.
>
> I wrote a filter driver for WinXP PRO SP2.
> This driver does no job it only passes IRPs to the lower driver.
>
> But I cannot add it to the proper place using an addfilter(DDK).
> The addfilter showed some object names, but Floppy0 did not appear
> in the list.
>
> Also I tried another program(Article ID: 259695 in MS support site)
> with argument SPDRP_PHYSICAL_DEVICE_OBJECT_NAME
> for the function of SetupDiGetDeviceRegistryProperty.
>
> Same result. Floppy0 did not appear but \000000xx and other many names.
>
> Why Floppy0 cannot get with both program ?
> I cannot test my filter driver.
>
> Please give me some advice.
>
> Image of Device Tree V2.6 by OSR(Thank you for fine tool)
>
> DRV \Driver\Sfloppy
> |
> ±-DEV \Device\Floppy0
> |
> ±-ATT Attached:(I want to attache my filter driver here.)
>
> ---------------------------------------
>
> DRV \Driver\USBSTOR
> |
> ±-DEV \Device\000000xx
> |
> ±-ATT \Device\Floppy0
> |
> ±-ATT Attached:(I want to attache my filter driver here.)
>
> Thank you for all.
>
> Hiro with ED Soft Corp.
> http://www.edsoftz.com/ (sorry only Japanese)
>
> —
> Questions? First check the Kernel Driver FAQ at http://www.osronline.com/article.cfm?id=256
>
> You are currently subscribed to ntdev as: xxxxx@gmail.com
> To unsubscribe send a blank email to xxxxx@lists.osr.com
>

Good morning Szulc, Now 11:30JST in the morning.

Thank you for your kindly advice.

I tried the way you wrote in previous mail.

But addfilter showed \00000056 for device name with argument only
/listdevices.

SetupDiGetClassDevs was given DIGCF_ALLCLASSED for the Flags
and SPDRP_PHYSICAL_DEVICE_OJBECT_NAME was given to
SetupDiGetDeviceRegistryProperty.

The SPDRP_HARDWAREID did not be accepted by this funtion because
hardware ID is REG_MULTI_SZ.

Anyway this \00000056 is a device showed bellow.

DRV \Driver\USBSTOR
|
±-DEV \Device\00000056

It seems to me you are looking for the wrong name. SetupDi* routines
work with informations that are placed in the registry, while Floppy0
is the name of the floppy device object and it’s in the object
namespace.

Yes, yes.
If I can get Floppy0 for the device name, I can add my filter
driver upper to Floppy0, I guess…

I wonder why the DeviceTree can show Floppy0 for the device name ?
I think I have to try other method or function to get Floppy0.

Thanks again.
Hiroshi

On Tue, 25 Jan 2005 14:32:09 +0100
Piotr Szulc wrote:

> It seems to me you are looking for the wrong name. SetupDi* routines
> work with informations that are placed in the registry, while Floppy0
> is the name of the floppy device object and it’s in the object
> namespace.
>
> To add your filter to a floppy device stack, try the following:
> 1. Create a service for your driver (by using SCManager routines).
> 2. Use SetupDiGetClassDevs with class guid
> {4D36E980-E325-11CE-BFC1-080} (floppy drives). It will return HDEVINFO
> handle to the set of devices belonging to that class.
> 3. Use HDEVINFO handle with SetupDiEnumDeviceInfo to have
> SP_DEVINFO_DATA filled for the first/next found device.
> 4. Use HDEVINFO handle and SP_DEVINFO_DATA with
> SetupDiGetDeviceRegistryProperty to see if it is the device you want
> (eg. by checking HardwareID). If it isn’t, back to 3.
> 5. Use SetupDiGetDeviceRegistryProperty to obtain UpperFilters (or
> LowerFilters) vaules. Add your service name to this value and write
> this value back, using SetupDiSetDeviceRegistryProperty.
> 6. Restart windows. If everything is OK, your filter driver should be
> loaded automatically.
>
> Best regards
> Piotr Szulc
>