简体   繁体   English

Windows USB教程

[英]Windows USB Tutorial

I've been trying to follow the Windows USB Tutorial at Microsoft MSDN I've followed it through to the end without error and this is the output 我一直在尝试按照Microsoft MSDN上的Windows USB教程进行操作,直到没有错误为止,这是输出

1>------ Build started: Project: USB Application1, Configuration: Win7 Debug x64 ------
1>  device.cpp
1>  main.cpp
1>  Generating Code...
1>  USB Application1.vcxproj -> c:\users\hp\documents\visual studio 2013\Projects\USB Application1\x64\Win7Debug\USBApplication1.exe
2>------ Build started: Project: USB Application1 Package, Configuration: Win7 Debug x64 ------
2>  Stamping x64\Win7Debug\USBApplication1.inf [Version] section with DriverVer=03/22/2014,13.49.5.125
2>C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets(1300,5): warning : The driver package project c:\Users\hp\documents\visual studio 2013\Projects\USB Application1\USB Application1 Package\USB Application1 Package.vcxproj doesn't have any references to other projects and no projects were packaged.
2>C:\Program Files (x86)\Windows Kits\8.1\build\WindowsDriver.common.targets(1300,5): warning : 
2>  ........................
2>  Signability test complete.
2>  
2>  Errors:
2>  None
2>  
2>  Warnings:
2>  None
2>  
2>  Catalog generation complete.
2>  c:\users\hp\documents\visual studio 2013\Projects\USB Application1\x64\Win7Debug\USB Application1 Package\usbapplication1.cat
2>  Done Adding Additional Store
2>  Successfully signed: c:\users\hp\documents\visual studio 2013\Projects\USB Application1\x64\Win7Debug\USB Application1 Package\usbapplication1.cat
2>  
========== Build: 2 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

When I try to manually update the USB driver in the device manager, I keep getting 当我尝试在设备管理器中手动更新USB驱动程序时,我不断

The required section was not found in the INF.

I have tried with two devices, a thumbdrive and a mobile phone but all with the same (non) results. 我尝试了两种设备,即指驱动器和移动电话,但均具有相同(非)结果。 Anybody know what is wrong please? 有人知道怎么了吗?

This is one of the INF files 这是INF文件之一

;
; USBApplication1.inf
;
; Installs WinUsb
;

[Version]
Signature = "$Windows NT$"
Class     = USBDevice
ClassGUID = {88BAE032-5A81-49f0-BC3D-A4FF138216D6}
Provider = %ManufacturerName%
CatalogFile=USBApplication1.cat
DriverVer=03/22/2014,13.49.5.125

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

[Manufacturer]
%ManufacturerName% = Standard,NTamd64

[Standard.NTamd64]
%DeviceName% =USB_Install, USB\VID_04E8&PID_685E

; ========== 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 ===================

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

[USB_Install.Services]
Include=winusb.inf
AddService=WinUsb,0x00000002,WinUsb_ServiceInstall

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

[USB_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,"{5aecf9ec-5a73-421b-841d-e9ab9b241a2b}"

[USB_Install.CoInstallers]
AddReg=CoInstallers_AddReg
CopyFiles=CoInstallers_CopyFiles

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

[CoInstallers_CopyFiles]
WdfCoInstaller01011.dll

[DestinationDirs]
CoInstallers_CopyFiles=11

; ================= Source Media Section =====================

[SourceDisksNames]
1 = %DiskName%

[SourceDisksFiles]
WdfCoInstaller01011.dll=1

; =================== Strings ===================

[Strings]
ManufacturerName=""
ClassName="Universal Serial Bus devices"
DiskName="USBApplication1 Installation Disk"
WinUsb_SvcDesc="WinUSB Driver"
DeviceName="USBApplication1 Device"
REG_MULTI_SZ = 0x00010000

Okay, I found c:\\windows\\inf\\setupapi.dev and I think the part in question is 好的,我找到了c:\\ windows \\ inf \\ setupapi.dev,我认为有问题的部分是

     dvi:                     CoInstaller 1: Enter 20:25:55.535
     inf:                          Opened PNF: 'C:\Windows\INF\oem75.inf' ([strings])
!!!  dvi:                     CoInstaller 1: failed(0xe0000101)!
!!!  dvi:                     Error 0xe0000101: The required section was not found in the INF.
     dvi:                {DIF_INSTALLDEVICE - exit(0xe0000101)} 20:25:55.703
!!!  ndv:                Error(e0000101) installing device!
     ndv:                Device install status=0xe0000101
     ndv:                Performing device install final cleanup...
!    ndv:                Queueing up error report since device installation failed...
     ndv:           {Core Device Install - exit(0xe0000101)} 20:25:55.708
     dvi:           {DIF_DESTROYPRIVATEDATA} 20:25:55.709
     dvi:                CoInstaller 1: Enter 20:25:55.709
     dvi:                CoInstaller 1: Exit
     dvi:                Default installer: Enter 20:25:55.710
     dvi:                Default installer: Exit
     dvi:           {DIF_DESTROYPRIVATEDATA - exit(0xe000020e)} 20:25:55.711
     ump:           Server install process exited with code 0xe0000101 20:25:55.718
     ump:      {Plug and Play Service: Device Install exit(e0000101)}
     ndv: {Update Driver Software Wizard exit(e0000101)}
<<<  Section end 2014/03/22 20:26:31.825
<<<  [Exit status: FAILURE(0xe0000101)]

There are also some occurrences of 也有一些发生

     sig:                Key      = usbapplication1.inf
     sig:                FilePath = C:\Windows\System32\DriverStore\FileRepository\usbapplication1.inf_amd64_neutral_bebc4e93bfc6a60a\usbapplication1.inf
     sig:                Catalog  = C:\Windows\System32\DriverStore\FileRepository\usbapplication1.inf_amd64_neutral_bebc4e93bfc6a60a\USBApplication1.cat
!    sig:                Verifying file against specific Authenticode(tm) catalog failed! (0x800b0109).
!    sig:                Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.

for various files above that 对于上面的各种文件

I ran into the same problem with the WinUSB sample application from the Win 8.1 WDK. 我在Win 8.1 WDK的WinUSB示例应用程序中遇到了同样的问题。 Their sample INF appears to be missing the following sections: 他们的样本INF似乎缺少以下部分:

[USB_Install.Wdf]
KmdfService=WINUSB, WinUsb_Install

[WinUsb_Install]
KmdfLibraryVersion=1.11

After adding this to my INF, it installs OK. 将其添加到我的INF后,它将安装确定。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM