Infverif fails on usbser referenced driver

Hi all,
I cant figure out how to make my INF pass the infverif testing.

It appears infverif is completely disregarding the "include=mdmcpq.inf" parameter as suggested by the "How to use or reference the Usbser.sys driver from universal serial bus (USB) modem .inf files" MS doccument.

If I add the required sections from mdmcpq.inf, I end up with the problem of having to specify a sourcedisk for usbser.sys, which obviously i shouldn't need to do.

Does anyone know why this is a problem?
Thanks in advance!

[Version]
Signature   = "$WINDOWS NT$"
Class       = Ports
ClassGUID   = {4D36E978-E325-11CE-BFC1-08002BE10318}
Provider    = %ManufacturerName%
PnpLockdown = 1
DriverVer   = 03/03/2025,2.5.5.0
CatalogFile = short_test.cat

;----------------------------------------------------------
; Targets
;----------------------------------------------------------

[Manufacturer]
%ManufacturerName%=DeviceList,NTx86,NTamd64,NTarm,NTarm64

[SourceDisksNames]
1=%DriversDisk%,,,

[SourceDisksFiles]

[DestinationDirs]
DefaultDestDir=12

;----------------------------------------------------------
; Device List
;----------------------------------------------------------

[DeviceList.NTx86]
%CF213B0000%=DriverInstall, USB\VID_213B&PID_0000

[DeviceList.NTamd64]
%CF213B0000%=DriverInstall, USB\VID_213B&PID_0000

[DeviceList.NTarm]
%CF213B0000%=DriverInstall, USB\VID_213B&PID_0000

[DeviceList.NTarm64]
%CF213B0000%=DriverInstall, USB\VID_213B&PID_0000

;----------------------------------------------------------
; Installers
;----------------------------------------------------------

[DriverInstall.NT]
include=mdmcpq.inf
CopyFiles=FakeModemCopyFileSection

[DriverInstall.NT.Services]
include=mdmcpq.inf
AddService=usbser,0x00000000,LowerFilter_Service_Inst

[DriverInstall.NT.HW]
include=mdmcpq.inf
AddReg=LowerFilterAddReg

;----------------------------------------------------------
; Strings
;----------------------------------------------------------

[Strings]
ManufacturerName="Test Inc"
ServiceName="Test USB Serial Driver"
DriversDisk="Test USB Drivers Disk"
CF213B0000="0x213B:0x0000"
>> "c:\Program Files (x86)\Windows Kits\10\Tools\10.0.26100.0\x64\infverif.exe" short_test.inf

WARNING(2006) in short_test.inf, line 0: Undefined service 'usbser' under [LowerFilter_Service_Inst] section.
WARNING(1296) in short_test.inf, line 45: Hardware '0x213B:0x0000' does not have an associated service using install section 'DriverInstall.NT'.
ERROR(1203) in short_test.inf, line 47: Section [fakemodemcopyfilesection] not found.
ERROR(1203) in short_test.inf, line 51: Section [LowerFilter_Service_Inst] not found.
ERROR(1203) in short_test.inf, line 51: Section [lowerfilter_service_inst] not found.
ERROR(1203) in short_test.inf, line 55: Section [lowerfilteraddreg] not found.

"Include" just tells it which files to look in, but it doesn't bring in any other sections. To bring in parts of that file, you have to use "Needs".

2 Likes

Ok, so I dont understand how every other usbser referenced driver INF that I can find uses "includes" (not "needs") can work?

[edit] Ok, so this is a change for Windows 11. The MS docs I referenced above have not been updated yet.

I havent worked out how to use "needs=" to fix this yet, but will keep at it.
Any assistance/examples would be very much appreciated!

Actually right in the middle of mdmcpq.inf, above the sections you're referencing, there is this comment blob:

;**********************************************************
; Legacy usbser section
;**********************************************************
;
; WARNING: The following sections are legacy usbser sections
; retained for compatibility with INFs that Include/Needs
; the modem INF
;
; New INFs should Include/Needs usbser.inf like below
;
;
; [DDInstall]
; Include = usbser.inf
; Needs   = UsbSerial_Install or UsbSerial_ModemFilter_Install
; 
;
; [DDInstall.Hw]
; Include = usbser.inf
; Needs   = UsbSerial_Install.Hw or UsbSerial_ModemFilter_Install.Hw
; 
;
; [DDInstall.Services]
; Include = usbser.inf
; Needs   = UsbSerial_Install.Services or UsbSerial_ModemFilter_Install.Services
;

Includes is the INF equivalent to a LoadLibrary call, and Needs is GetProcAddress + call the function. Includes just tells the parser to find another INF.

There is a bit of history with the old INF parser, though, that makes this less straightforward. A Needs directive can only reference other DDInstall.* sections (which we treat functionally like DLL exports), but the old parser would allow you to just reference any section from a loaded INF using any directive at all. That's not great behavior and we want new INFs to use Needs to use an inbox INF. InfVerif is catching you trying to use another INF without Needs.

1 Like

Thank you!
I believe that has fixed the problem (for now).

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.