Use custom driver for all new USB devices with same VID/PID

1

In order to use my USB HID complient device with LabView, I had to create a custom USB driver. That works fine, except when I connect a new device (same VID&PID, different GUID) windows automaticly uses the standard hid.dll driver instead of my custom driver. Therefor the new device doesn't work with LabView until I manualy change the driver. Since this should be used in an semi-automated process, this manual driver change is not feasable. Is there a way to tell windows to use my custom driver, whenever a device with the same VID and PID is connected? Or am I doing something else wrong?

edit:

Setupapi.app.log file after installing driver trough Driver Wizard 5.3:

>>>  [Build Driver List - USB\VID_0483&PID_1208&MI_01\8&35506E0F&1&0001]
>>>  Section start 2018/03/27 12:52:34.409
      cmd: "C:\Program Files (x86)\IVI Foundation\VISA\WinNT\NIvisa\DriverWizardInstallInf64.exe"  C:\Users\LOCALA~1\AppData\Local\Temp\LVTEMP~1.TMP
     cpy: Policy is set to make all digital signatures equal.
<<<  Section end 2018/03/27 12:52:34.413
<<<  [Exit status: SUCCESS]


>>>  [Build Driver List - USB\VID_0483&PID_1208&MI_01\8&35506E0F&1&0001]
>>>  Section start 2018/03/27 12:52:34.413
      cmd: "C:\Program Files (x86)\IVI Foundation\VISA\WinNT\NIvisa\DriverWizardInstallInf64.exe"  C:\Users\LOCALA~1\AppData\Local\Temp\LVTEMP~1.TMP
     cpy: Policy is set to make all digital signatures equal.
!    sig: Verifying file against specific (valid) catalog failed! (0x00000057)
!    sig: Error 87: The parameter is incorrect.
!    sig: Verifying file against specific Authenticode(tm) catalog failed! (0x80092003)
!    sig: Error 0x80092003: An error occurred while reading or writing to a file.
<<<  Section end 2018/03/27 12:52:34.421
<<<  [Exit status: SUCCESS]


>>>  [DIF_SELECTBESTCOMPATDRV - USB\VID_0483&PID_1208&MI_01\8&35506E0F&1&0001]
>>>  Section start 2018/03/27 12:52:34.422
      cmd: "C:\Program Files (x86)\IVI Foundation\VISA\WinNT\NIvisa\DriverWizardInstallInf64.exe"  C:\Users\LOCALA~1\AppData\Local\Temp\LVTEMP~1.TMP
<<<  Section end 2018/03/27 12:52:34.423
<<<  [Exit status: SUCCESS]

.inf file created by Driver Wizard 5.3:

;===========================================================================
;  This file was generated using:
;  NI-VISA Driver Development Wizard version 5.3
;===========================================================================
;
;  This file is for use with Windows 8/7/Vista. This will not work on Windows
;  XP.  This Windows Setup Information File contains the information
;  NI-VISA needs in order to access your instrument.  Do not modify the
;  contents of this file unless you are sure about what you are doing.
;
;===========================================================================
;
;  Windows Vista/7 Installation:
;  To apply the contents of this file to a system's settings, right-click
;  this file and choose "Install". If the device was plugged in before this
;  file is installed, the device will need to be removed from the "Unknown
;  Devices" class in the Windows Device Manager.
;
;===========================================================================
;
;  Windows 8 Installation:
;  To apply the contents of this file to a system's settings, a catalog file
;  must be generated and signed using either a personal certificate or a
;  certificate obtained from a Certificate Authority (CA).  For detailed
;  instructions on how to install your INF on Windows 8, visit
;  http://ni.com/info and enter the Info Code INFWin8.
;
;===========================================================================
;
;  Removal:
;  At installation, Windows copies the file into the %SystemRoot%\inf
;  directory using the alternate filename oem##.inf.  You may have
;  to search all the files to find the one from which this is copied.
;  Remove that file and its associated .pnf file (if it exists) from
;  %SystemRoot%\inf.  Either reboot the computer, or perform a
;  "Scan for hardware changes" from the Windows Device Manager.
;
;===========================================================================
    [Version]
    Signature=$WINDOWS NT$
    Class=visaUsbDevice
    ClassGUID={A3330EDF-239D-4206-833B-1D58952613D5}
    Provider=%Vendor0%
    DriverVer=03/26/2018,1.0
    CatalogFile=JumpSensor.cat

    ;===========================================================================
    ;  Default Installer
    ;===========================================================================

    [DefaultInstall]
    CopyINF=JumpSensor.inf

    [DestinationDirs]

    [SourceDisksNames]

    [SourceDisksFiles]

    ;===========================================================================
    ;  Class Installer
    ;===========================================================================

    [ClassInstall32]
    AddReg=AddClass_AddReg

    [AddClass_AddReg]
    HKR,,,0,%DeviceClassString%
    HKR,,Icon,,"-20"

    ;===========================================================================

    [Manufacturer]
    %Vendor1%=USBList,NTamd64

    [USBList]
    %USB\VID_0483&PID_1208&MI_00.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_00
    %USB\VID_0483&PID_1208&MI_01.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_01

    [USBList.NTamd64]
    %USB\VID_0483&PID_1208&MI_00.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_00
    %USB\VID_0483&PID_1208&MI_01.DeviceDesc%=WinUsb_Inst, USB\VID_0483&PID_1208&MI_01

    [PreCopySection]
    HKR,,NoSetupUI,,1

    [WinUsb_Inst]
    Include = winusb.inf
    Needs = WINUSB.NT

    [WinUsb_Inst.hw]
    AddReg=WinUsb_Inst_HW_AddReg

    [WinUsb_Inst.Services]
    Addservice = WinUsb, 0x00000002, WinUsb_AddService

    [WinUsb_AddService]
    DisplayName    = %WinUsb_Service_DisplayName%
    ServiceType    = %SERVICE_KERNEL_DRIVER%
    StartType      = %SERVICE_DEMAND_START%
    ErrorControl   = %SERVICE_ERROR_NORMAL%
    ServiceBinary  = %12%\WinUSB.sys

    [WinUsb_Inst_HW_AddReg]
    HKR,,DeviceInterfaceGUIDs, 0x10000,"{761ED34A-CCFA-416b-94BB-33486DB1F5D5}"

    [Strings]
    Vendor0="STMicroelectronics"
    Vendor1="STMicroelectronics"
    USB\VID_0483&PID_1208&MI_00.DeviceDesc="JUMP Sensor"
    USB\VID_0483&PID_1208&MI_01.DeviceDesc="JUMP Sensor"
    DeviceClassString="NI-VISA USB Devices"
    WinUsb_Service_DisplayName="WinUSB Driver"

    SERVICE_BOOT_START = 0x0
    SERVICE_SYSTEM_START = 0x1
    SERVICE_AUTO_START = 0x2
    SERVICE_DEMAND_START = 0x3
    SERVICE_DISABLED = 0x4

    SERVICE_KERNEL_DRIVER = 0x1
    SERVICE_ERROR_IGNORE = 0x0
    SERVICE_ERROR_NORMAL = 0x1
    SERVICE_ERROR_SEVERE = 0x2
    SERVICE_ERROR_CRITICAL = 0x3
usb
labview
hid
asked on Stack Overflow Mar 27, 2018 by P.J • edited Mar 28, 2018 by P.J

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0