Cannot Attach Filter to usbstor.sys?

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

  1. Unicoco

    Unicoco Guest

    Hi,

    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

    [Version]
    Signature="$WINDOWS NT$"
    Class=USB ClassGuid={36fc9e60-c465-11cf-8056-444553540000} Provider=%MSFT%
    DriverVer=11/15/2008,1.00.3740

    [DestinationDirs]
    DefaultDestDir = 12

    ;*****************************************
    ; Toaster Device Filter Install Section
    ;*****************************************

    [Manufacturer]
    %StdMfg%=Standard

    [Standard]
    ; 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




    ;=====================================================================
    [ToasterFilter.NT]
    ;=============== Get the standard stuff from Toaster.inf==============
    Include=usbstor.inf
    Needs=USBSTOR_BULK.NT
    CopyFiles=ToasterFilter.NT.Copy
    AddReg=ToasterFilter.NT.AddReg

    [ToasterFilter.NT.Copy]
    UsbFilter1.sys

    [ToasterFilter.NT.AddReg]
    ; Add registry entries here

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

    ;================ Add in the standard stuff provided by Toaster
    Include = usbstor.inf
    Needs = USBSTOR_BULK.N.HW

    [ToasterFilter.NT.HW.AddReg]
    HKR,,"UpperFilters",0x00010000,"UsbstorUpper"

    ;*****************************************
    ; Toaster Device Filter Service Section
    ;*****************************************

    [ToasterFilter.NT.Services]
    ;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 ====================
    Include=usbstor.inf
    Needs=USBSTOR_BULK.NT.Services

    [filter_Service_Inst]
    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
    ;*************************


    [SourceDisksNames]
    1 = %DiskId1%,,,""

    [SourceDisksFiles]
    UsbFilter1.sys = 1,,


    [Strings]
    SPSVCINST_ASSOCSERVICE= 0x00000002
    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
    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


     
    Eliyas Yakub [MSFT], Nov 15, 2008
    #2
    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.