2016-07-26 132 views
0

我終於找到了一個關於創建驅動程序的指南,建立它並遵循本指南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安裝%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 
+0

也許您應該再次嘗試並按照此時的說明操作。 –

+0

我在哪裏可以找到硬件ID?這就是爲什麼我沒有按照指南進行操作 – Tom

+0

只需連接設備並查看其在設備管理器中的屬性即可。硬件和兼容的ID也存在。 –

回答

0

你的INF文件似乎不包含有關硬件ID信息(兼容ID也可能是一種選擇,我想)你的驅動程序支持的設備。您需要指定它們,以便系統在搜索與新連接的設備的ID匹配的驅動程序時可以使用它們。

深入研究一個想法的WDK示例如何做到這一點(RAMDisk示例可以幫助你,如果你正在寫一個功能驅動程序)。例如,我的一個內核驅動程序被加載用於報告RemBus \ RAMDisk和RemBus \ FileDisk硬件ID的設備。我指示Windows通過我的INF文件的以下部分執行此操作:

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

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

聲音就像這是我的問題,但我設置PID和VID,這是不夠的?我會看看這些例子,這是我爲創建驅動程序而遵循的指南,第2步是我認爲我定義了ID的地方https://msdn.microsoft.com/en-us/library/windows/hardware/hh706184 (v = vs.85).aspx – Tom

+0

我剛剛嘗試過使用兼容的ID,並且Visual Studio不會對它進行簽名,說第三方驅動程序必須安裝使用vid + pid – Tom

相關問題