Author Topic: WinUsb as a filter Driver  (Read 17794 times)

AlexCS

  • Member
  • ***
  • Posts: 2
WinUsb as a filter Driver
« on: January 06, 2011, 02:49:54 pm »
Hello,

I'm trying to communicate with a mass storage device via wiunsb. I have succeeded this by installing winusb as a function driver, but I want to know if there is a way to install winusb as a filter driver and preserve my device's features as a mass storage device (preserve USBSTOR.sys).

Is this possible? If so, could anyone help me to install winusb as a filter driver.

Thanks in advanced.
Alexis Cortes.


Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: WinUsb as a filter Driver
« Reply #1 on: January 06, 2011, 03:19:06 pm »
This is about libusb but the last couple of messages might be useful.

http://libusb.6.n5.nabble.com/To-understand-the-behavior-of-WinUSB-backend-td510213.html

Jan

AlexCS

  • Member
  • ***
  • Posts: 2
Re: WinUsb as a filter Driver
« Reply #2 on: January 06, 2011, 03:56:51 pm »
Hi Jan,

Thank you for your answer. Unfortunately I have tried that, I even used an inf to try to install winusb as a filter driver, but I have to say I'm pretty much a begginner with inf's. The driver finishes to install properly, and If I check the 'driver details' on my device's properties on device manager I can see that winusb is installed, however my device gets yellowed banged, and  I'm getting the error that my divice could not start (error code 10)

This is the inf I'm using.

[Version]
Signature = "$Windows NT$"
Class = USB
ClassGuid={36FC9E60-C465-11CF-8056-444553540000}
Provider = %ProviderName%
CatalogFile=MyCatFile.cat

; ================== Class section ==================

; ========== Manufacturer/Models sections ===========

[Manufacturer]
%ProviderName% = MyDevice_WinUSB,NTx86,NTamd64,NTia64

[MyDevice_WinUSB.NTx86]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0457&PID_0151

[MyDevice_WinUSB.NTamd64]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0457&PID_0151

[MyDevice_WinUSB.NTia64]
%USB\MyDevice.DeviceDesc% =USB_Install, USB\VID_0457&PID_0151
; =================== Installation ===================

;[1]
[USB_Install]
Include=winusb.inf
Needs=WINUSB.NT

[USB_Install.HW]
Include=winusb.inf
Needs=WINUSB.NT
AddReg = USB_Install.HW.AddReg

[USB_Install.HW.AddReg] 
HKR,,"LowerFilters",0x00010000,"winusb"

;[2]
[USB_Install.Services]
Include=winusb.inf
AddService=WinUSB,,WinUSB_ServiceInstall

;[3]
[WinUSB_ServiceInstall]
DisplayName     = %WinUSB_SvcDesc%
ServiceType     = 1
StartType       = 3
ErrorControl    = 1
ServiceBinary   = %12%\winusb.sys

;[4]
[USB_Install.Wdf]
KmdfService=WINUSB, WinUsb_Install

[WinUSB_Install]
KmdfLibraryVersion=1.9

;[5]
[USB_Install.HW]
AddReg=Dev_AddReg

[Dev_AddReg]
HKR,,DeviceInterfaceGUIDs,0x10000,"{55555555-4444-3333-2222-111111111111}"

;[6]
[USB_Install.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010000,"WdfCoInstaller01009.dll,WdfCoInstaller","WinUSBCoInstaller2.dll"

[CoInstallers_CopyFiles]
WinUSBCoInstaller2.dll
WdfCoInstaller01009.dll

[DestinationDirs]
CoInstallers_CopyFiles=11

; ================= Source Media Section =====================
;[7]

[SourceDisksNames]
1 = %DISK_NAME%,,,\i386
2 = %DISK_NAME%,,,\amd64
3 = %DISK_NAME%,,,\ia64

[SourceDisksFiles.x86]
WinUSBCoInstaller2.dll=1
WdfCoInstaller01009.dll=1

[SourceDisksFiles.amd64]
WinUSBCoInstaller2.dll=2
WdfCoInstaller01009.dll=2

[SourceDisksFiles.ia64]
WinUSBCoInstaller2.dll=3
WdfCoInstaller01009.dll=3
; =================== Strings ===================

[Strings]
ProviderName="MyWinUsbTest"
USB\MyDevice.DeviceDesc="Test using WinUSB only"
WinUSB_SvcDesc="WinUSB Test"
DISK_NAME="My Install Disk"
ClassName="MyDeviceClass"



I appreciate your help.

Thanks and Best Regards,
Alexis Cortes.

Jan Axelson

  • Administrator
  • Frequent Contributor
  • *****
  • Posts: 3033
    • Lakeview Research
Re: WinUsb as a filter Driver
« Reply #3 on: January 06, 2011, 06:29:51 pm »
The setupapi log file might have useful information:

http://www.microsoft.com/whdc/archive/setupapilog.mspx

Jan

xiaofan

  • Member
  • ***
  • Posts: 2
Re: WinUsb as a filter Driver
« Reply #4 on: January 28, 2011, 01:53:32 am »
I think in the end it does not work even though the thread says that it works. Further testing shows that WinUSB can not be a generic filter. That test happened to work because libusb0.sys runs as a filter.
http://libusb.6.n5.nabble.com/Re-libusb-win32-and-WinUSB-as-a-filter-driver-td2642352.html