none
Using in-box USB video class driver with WinUSB RRS feed

  • Question

  • Hi,

    I am developing a USB video class product, and want to send vendor-specified control transfers to the device.

    According to MSDN, a control transfer can be sent using WinUSB. So I wrote a customized INF for my device (see below).

    The driver was installed successfully, but the problem is WinUSB can't detect the device.

    In my application, it fails in SetupDiEnumDeviceInterfaces(), and return ERROR_NO_MORE_ITEMS.

    I tried to remove the line "AddService=usbvideo...", and then WinUSB can detect my device successfully. However, I lose its video capture source function (provided in in-box USB class driver, I guess).

    So my problem is:

    • In INF, I merged both usbvideo & WinUSB services. Is it legal?
    • Is there anyway to use in-box USB video class driver with WinUSB?


    [Version]
    Signature = "$Windows NT$"
    Class     = Image
    ClassGUID = {6bdd1fc6-810f-11d0-bec7-08002be2092f}
    Provider = %ManufacturerName%
    CatalogFile=MyDev.cat
    
    ; ========== Manufacturer/Models sections ===========
    
    [Manufacturer]
    %ManufacturerName% = Standard,NT$ARCH$
    
    [Standard.NT$ARCH$]
    %DeviceName% =My_Install, USB\VID_{my-vid}&PID_{my-pid
    
    ; ========== Class definition ===========
    
    [ClassInstall32]
    AddReg = ClassInstall_AddReg
    
    [ClassInstall_AddReg]
    HKR,,,,%ClassName%
    HKR,,NoInstallClass,,1
    HKR,,IconPath,%REG_MULTI_SZ%,"%systemroot%\system32\setupapi.dll,-20"
    HKR,,LowerLogoVersion,,5.2
    
    ; =================== Installation ===================
    
    [My_Install]
    Include=winusb.inf, usbvideo.inf, ks.inf, kscaptur.inf
    Needs=WINUSB.NT, USBVideo.NT, KS.Registration, KSCAPTUR.Registration.NT
    
    [My_Install.Services]
    Include=winusb.inf, usbvideo.inf
    AddService=usbvideo,0x00000002,UsbVideo_ServiceInstall
    AddService=WinUsb,0x000001f8,WinUsb_ServiceInstall
    
    [My_Install.Interfaces]
    AddInterface=%KSCATEGORY_CAPTURE%,GLOBAL,USBVideo.Interface
    AddInterface=%KSCATEGORY_RENDER%,GLOBAL,USBVideo.Interface
    AddInterface=%KSCATEGORY_VIDEO%,GLOBAL,USBVideo.Interface
    AddInterface=%KSCATEGORY_RENDER_EXT%,GLOBAL,USBVideo.Interface
    
    [WinUsb_ServiceInstall]
    DisplayName     = %WinUsb_SvcDesc%
    ServiceType     = 1
    StartType       = 3
    ErrorControl    = 1
    ServiceBinary   = %12%\WinUSB.sys
    
    [UsbVideo_ServiceInstall]
    DisplayName   = %USBVideo.SvcDesc%
    ServiceType   = 1
    StartType     = 3
    ErrorControl  = 1
    ServiceBinary = %12%\usbvideo.sys
    
    [My_Install.HW]
    AddReg=Dev_AddReg
    
    [Dev_AddReg]
    ; By default, USBDevice class uses iProduct descriptor to name the device in
    ; Device Manager on Windows 8 and higher.
    ; Uncomment for this device to use %DeviceName% on Windows 8 and higher:
    ;HKR,,FriendlyName,,%DeviceName%
    HKR,,DeviceInterfaceGUIDs,0x10000,"{46454286-19E7-4D5A-82D3-7E7C1B99EFD1}"
    
    [My_Install.CoInstallers]
    AddReg=CoInstallers_AddReg
    CopyFiles=CoInstallers_CopyFiles
    
    [CoInstallers_AddReg]
    HKR,,CoInstallers32,0x00010000,"WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"
    
    [CoInstallers_CopyFiles]
    WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
    
    [DestinationDirs]
    CoInstallers_CopyFiles=11
    
    ; ================= Source Media Section =====================
    
    [SourceDisksNames]
    1 = %DiskName%
    
    [SourceDisksFiles]
    WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1
    
    ; =================== Windows Driver Framework Section ===================
    ; PS: Missing in WinUSB template
    
    [My_Install.Wdf]
    KmdfService=WINUSB, WinUsb_Install
    UmdfDispatcher=WinUsb
    
    [WinUsb_Install]
    KmdfLibraryVersion=1.11
    
    ; =================== Strings ===================
    
    [Strings]
    ManufacturerName="My"
    ClassName="Universal Serial Bus devices"
    DiskName="Installation Disk"
    WinUsb_SvcDesc="WinUSB Driver"
    DeviceName="My Device"
    REG_MULTI_SZ = 0x00010000
    KSCATEGORY_RENDER="{65E8773E-8F56-11D0-A3B9-00A0C9223196}"
    KSCATEGORY_CAPTURE="{65E8773D-8F56-11D0-A3B9-00A0C9223196}"
    KSCATEGORY_VIDEO="{6994AD05-93EF-11D0-A3CC-00A0C9223196}"
    KSCATEGORY_RENDER_EXT="{CC7BFB41-F175-11D1-A392-00E0291F3959}"
    



    Wednesday, May 14, 2014 10:55 AM

All replies

  • you can't put both of these drivers in the same stack, both expect to be the function driver and won't let each other work properly (as you have seen). Perhaps the usbvideo driver has a vendor command passthrough alternatively you can split out the vendor commandset to a different USB function and then load winusb on that function.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    • Marked as answer by Doron Holan [MSFT] Wednesday, May 14, 2014 9:53 PM
    • Unmarked as answer by Leavinel Tuesday, May 20, 2014 7:32 AM
    Wednesday, May 14, 2014 9:53 PM
  • Hi Doron,

    Thanks for your reply. Actually, what I want to do is to access the buggy UVC extension unit on the device.

    The device doesn't support GET_LEN request. When I plugged the device, I noticed that usbvideo.sys initializes UVC extension unit, sending GET_LEN request to every control selectors on the extension unit.

    Later I tried to send GET_CUR request via UVC extension unit plug-in (MSDN library). It simply returned an error ERROR_NOT_FOUND, without sending any control transfer. I guess that usbvideo.sys found GET_LEN is unsupported, and then blocked my GET_CUR request.

    To make GET_CUR work, I need to send a customized control transfer. You mentioned that "Perhaps usbvideo driver has a vendor command passthrough". So:

    • Does usbvideo.sys support such API? Where can I found this information?
    • Or, is there any way to bypass GET_LEN checking?
    Friday, May 16, 2014 9:10 AM