Cannot Attach Filter to usbstor.sys?

Discussion in 'Windows Vista Drivers' started by Unicoco, Nov 15, 2008.

  1. Unicoco

    Unicoco Guest


    I write a filter which monitor write/read of usb disk by checking
    IRP_MJ_SCSI to usbstor.sys .
    It's a filter just above the pdo of storage device created by usbstor.sys .
    I write a .inf to install the driver ,but it dosen't work correctly. Here is
    the .inf

    Signature="$WINDOWS NT$"
    Class=USB ClassGuid={36fc9e60-c465-11cf-8056-444553540000} Provider=%MSFT%

    DefaultDestDir = 12

    ; Toaster Device Filter Install Section


    ; DisplayName Section DeviceId
    ; ----------- ------- --------
    %ToasterFilter.DeviceDesc%=ToasterFilter, USB\Class_08&SubClass_06&Prot_50
    %ToasterFilter.DeviceDesc%=ToasterFilter, USB\USB\Class_08&SubClass_06
    %ToasterFilter.DeviceDesc%=ToasterFilter, USB\Class_08

    ;=============== Get the standard stuff from Toaster.inf==============


    ; Add registry entries here

    ;================ Add our own stuff
    AddReg = ToasterFilter.NT.HW.AddReg

    ;================ Add in the standard stuff provided by Toaster
    Include = usbstor.inf


    ; Toaster Device Filter Service Section

    ;Do not specify SPSVCINST_ASSOCSERVICE on filter drivers.
    AddService = UsbFilter1,, filter_Service_Inst
    ;=========== This will add toaster as the service and make sure =====
    ;=========== that toaster.sys has been installed ====================

    DisplayName = %filter.SvcDesc%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 3 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\UsbFilter1.sys

    ; Source file information

    1 = %DiskId1%,,,""

    UsbFilter1.sys = 1,,

    MSFT = "Unicoco"
    StdMfg = "Unicoco"
    ClassName = "Toaster"

    DiskId1 = "Usbstor Filter Installation Disk #1"
    ToasterFilter.DeviceDesc = "Unicoco usbstor With Upper Device Filter"
    filter.SvcDesc = "Unicoco usbstor upper filter"

    Your input will be greatly appreciated!

    Thank you.
    Sorry for my english.
    Unicoco, Nov 15, 2008
    1. Advertisements

  2. You are installing an upper filter for usbstor FDO. This filter isn't going
    to see I/Os going to the PDO enumerated by the usbstor. For that you either
    need to write a bus filter or write a device lower filter driver for the PDO
    stack. Find out which driver is being loaded for the child PDO and fix your
    INF file to match that.


    Eliyas Yakub [MSFT], Nov 15, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.