Windows USB Tutorial

0

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

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

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

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

     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

c++
windows-7
usb
visual-studio-2013
asked on Stack Overflow Mar 22, 2014 by Daniel Wong • edited Feb 21, 2016 by Adam B

1 Answer

1

I ran into the same problem with the WinUSB sample application from the Win 8.1 WDK. Their sample INF appears to be missing the following sections:

[USB_Install.Wdf]
KmdfService=WINUSB, WinUsb_Install

[WinUsb_Install]
KmdfLibraryVersion=1.11

After adding this to my INF, it installs OK.

answered on Stack Overflow Apr 16, 2014 by Matt M

User contributions licensed under CC BY-SA 3.0