没有使用新的驱动程序

时间:2016-07-26 17:39:35

标签: windows driver

我终于找到了一个关于创建驱动程序的指南,构建它并遵循本指南https://www.nccgroup.trust/us/about-us/newsroom-and-events/blog/2016/april/adventures-in-windows-driver-development-part-1/将其安装在VM上,但是当我插入我的设备时,它显示为串行端口,而不是我命名的它,所以它使用Windows驱动程序而不是我的。我怎样才能使用我的?

我在Windows 10上,我完全按照指南直到它说使用“​​devcon.exe install%filepath%echo.inf root \ ECHO”的部分来安装它,我只是右键单击并单击安装相反,会这样做吗?我为证书做了同样的事情。

 ;
; USBDriver1.inf
;

[Version]
Signature="$Windows NT$"
Class=USBDevice
ClassGuid={88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider=%ManufacturerName%
CatalogFile=USBDriver1.cat
DriverVer=

[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$

[Standard.NT$ARCH$]
%DeviceName%=MyDevice_Install, USB\VID_2341&PID_8036&MI_00

[SourceDisksFiles]
USBDriver1.dll=1
WudfUpdate_$UMDFCOINSTALLERVERSION$.dll=1

[SourceDisksNames]
1 = %DiskName%


; =================== UMDF Device ==================================

[MyDevice_Install.NT]
CopyFiles=UMDriverCopy
Include=WINUSB.INF                      ; Import sections from WINUSB.INF
Needs=WINUSB.NT                         ; Run the CopyFiles & AddReg directives for WinUsb.INF

[MyDevice_Install.NT.hw]
AddReg=USBDriver1_AddReg

[MyDevice_Install.NT.Services]
AddService=WUDFRd,0x000001fa,WUDFRD_ServiceInstall  ; flag 0x2 sets this as the service for the device
AddService=WinUsb,0x000001f8,WinUsb_ServiceInstall  ; this service is installed because its a filter.

[MyDevice_Install.NT.CoInstallers]
CopyFiles=CoInstallers_CopyFiles
AddReg=CoInstallers_AddReg

[MyDevice_Install.NT.Wdf]
UmdfDispatcher=WinUsb
UmdfService=USBDriver1,USBDriver1_Install
UmdfServiceOrder=USBDriver1

[USBDriver1_Install]
UmdfLibraryVersion=$UMDFVERSION$ 
ServiceBinary=%12%\UMDF\USBDriver1.dll
DriverCLSID={5138ba31-5a05-4a39-b1d0-2f7c0dd59d36}

[USBDriver1_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,,"LowerFilters",0x00010008,"WinUsb" ; FLG_ADDREG_TYPE_MULTI_SZ | FLG_ADDREG_APPEND
HKR,,"WinUsbPowerPolicyOwnershipDisabled",0x00010001,1

[WUDFRD_ServiceInstall]
DisplayName = %WudfRdDisplayName%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WUDFRd.sys

[WinUsb_ServiceInstall]
DisplayName = %WinUsb_SvcDesc%
ServiceType = 1
StartType = 3
ErrorControl = 1
ServiceBinary = %12%\WinUSB.sys

[CoInstallers_CopyFiles]
WudfUpdate_$UMDFCOINSTALLERVERSION$.dll

[CoInstallers_AddReg]
HKR,,CoInstallers32,0x00010008,"WudfUpdate_$UMDFCOINSTALLERVERSION$.dll"

[DestinationDirs]
UMDriverCopy=12,UMDF ; copy to drivers\umdf
CoInstallers_CopyFiles=11

[UMDriverCopy]
USBDriver1.dll

; =================== Generic ==================================

[Strings]
ManufacturerName="<Your manufacturer name>" ;TODO: Replace with your manufacturer name
ClassName="Universal Serial Bus devices"
DiskName = "USBDriver1 Installation Disk"
WudfRdDisplayName="Windows Driver Foundation - User-mode Driver Framework Reflector"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="USBDriver1 Device"
REG_MULTI_SZ = 0x00010000

1 个答案:

答案 0 :(得分:0)

您的INF文件似乎不包含有关您的驱动程序支持的设备的硬件ID(兼容ID也可能是我认为的选项)的信息。您需要指定它们,以便系统在搜索与新连接设备的ID匹配的驱动程序时可以使用它们。

查看WDK示例以了解如何操作(如果您正在编写函数驱动程序,RAMDisk示例可能会对您有帮助)。例如,我的一个内核驱动程序被加载用于报告RemBus \ RAMDisk和RemBus \ FileDisk硬件ID的设备。我通过INF文件的以下部分指示Windows执行此操作:

[Manufacturer]
%ManufacturerName%=Standard,NT$ARCH$

[Standard.NT$ARCH$]
%ramdisk.DeviceDesc%=remdisk_Device, RemBus\RAMDisk
%filedisk.DeviceDesc%=remdisk_Device, RemBus\FileDisk