0

I built a simple driver using this tatourial (https://learn.microsoft.com/en-us/windows-hardware/drivers/gettingstarted/writing-a-very-small-kmdf--driver). I tried to install my driver but when i run the devcon tool i got:

Device node created. Install is complete when drivers are installed...
Updating drivers for Root/MyFiestDriver from C:\Users\WDKRemoteUser\Downloads\drive-download-20220107T092709Z-001\MyFiestDriver.inf.
devcon.exe failed.

i checked the logs and got the following error massages:

     [Device Install (UpdateDriverForPlugAndPlayDevices) - Root/MyFirstDriver]
>>>  Section start 2022/01/07 12:36:43.703
      cmd: devcon.exe  install MyFirstDriver.inf Root/MyFirstDriver
     ndv: INF path: C:\Users\WDKRemoteUser\Downloads\drive-download-20220107T092709Z-001\MyFirstDriver.inf
     ndv: Install flags: 0x00000001
     ndv: {Update Device Driver - ROOT\SYSTEM\0001}
     ndv:      Search options: 0x00000080
     ndv:      Searching single INF 'C:\Users\WDKRemoteUser\Downloads\drive-download-20220107T092709Z-001\MyFirstDriver.inf'
     dvi:      {Build Driver List} 12:36:43.734
     dvi:           Searching for hardware ID(s):
     dvi:                root/MyFirstDriver
     dvi:      {Build Driver List - exit(0x00000000)} 12:36:43.812
!    ndv:      No matching drivers found in single INF
     dvi:      {DIF_SELECTBESTCOMPATDRV} 12:36:43.828
     dvi:           Default installer: Enter 12:36:43.828
     dvi:                {Select Best Driver}
!    dvi:                     Selecting driver failed(0xe0000228)
     dvi:                {Select Best Driver - exit(0xe0000228)}
!    dvi:           Default installer: failed
!    dvi:           Error 0xe0000228: There are no compatible drivers for this device.
     dvi:      {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 12:36:43.859
!    ndv:      Unable to select best compatible driver. Error = 0xe0000228
     ndv:      No drivers found for device.
     ndv: {Update Device Driver - exit(00000103)}
!    ndv: No better matching drivers found for device 'ROOT\SYSTEM\0001'.
     ndv: {Update Device Driver - ROOT\SYSTEM\0002}
     ndv:      Search options: 0x00000080
     ndv:      Searching single INF 'C:\Users\WDKRemoteUser\Downloads\drive-download-20220107T092709Z-001\MyFirstDriver.inf'
     dvi:      {Build Driver List} 12:36:43.906
     dvi:           Searching for hardware ID(s):
     dvi:                root/MyFirstDriver
     dvi:      {Build Driver List - exit(0x00000000)} 12:36:43.922
!    ndv:      No matching drivers found in single INF
     dvi:      {DIF_SELECTBESTCOMPATDRV} 12:36:43.922
     dvi:           Default installer: Enter 12:36:43.937
     dvi:                {Select Best Driver}
!    dvi:                     Selecting driver failed(0xe0000228)
     dvi:                {Select Best Driver - exit(0xe0000228)}
!    dvi:           Default installer: failed
!    dvi:           Error 0xe0000228: There are no compatible drivers for this device.
     dvi:      {DIF_SELECTBESTCOMPATDRV - exit(0xe0000228)} 12:36:43.953
!    ndv:      Unable to select best compatible driver. Error = 0xe0000228
     ndv:      No drivers found for device.
     ndv: {Update Device Driver - exit(00000103)}
!    ndv: No better matching drivers found for device 'ROOT\SYSTEM\0002'.
!    ndv: No devices were updated.
<<<  Section end 2022/01/07 12:36:44.062
<<<  [Exit status: FAILURE(0x00000103)]

i used the inf file visual studio generated for me and couldn't find anyway to fix this.

the inf file i use looks like that:

    ;
; MyFirstDriver.inf
;

[Version]
Signature="$WINDOWS NT$"
Class=System ; TODO: specify appropriate Class
ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318} ; TODO: specify appropriate ClassGuid
Provider=%ManufacturerName%
CatalogFile=MyFirstDriver.cat
DriverVer = 01/04/2022,10.43.33.93
PnpLockdown=1

[DestinationDirs]
DefaultDestDir = 12
MyFirstDriver_Device_CoInstaller_CopyFiles = 11

[SourceDisksNames]
1 = %DiskName%,,,""

[SourceDisksFiles]
MyFirstDriver.sys  = 1,,
;


;*****************************************
; Install Section
;*****************************************

[Manufacturer]
%ManufacturerName%=Standard,NTamd64

[Standard.NTamd64]
%MyFirstDriver.DeviceDesc%=MyFirstDriver_Device, Root\MyFirstDriver ; TODO: edit hw-id

[MyFirstDriver_Device.NT]
CopyFiles=Drivers_Dir

[Drivers_Dir]
MyFirstDriver.sys

;-------------- Service installation
[MyFirstDriver_Device.NT.Services]
AddService = MyFirstDriver,%SPSVCINST_ASSOCSERVICE%, MyFirstDriver_Service_Inst

; -------------- MyFirstDriver driver install sections
[MyFirstDriver_Service_Inst]
DisplayName    = %MyFirstDriver.SVCDESC%
ServiceType    = 1               ; SERVICE_KERNEL_DRIVER
StartType      = 3               ; SERVICE_DEMAND_START
ErrorControl   = 1               ; SERVICE_ERROR_NORMAL
ServiceBinary  = %12%\MyFirstDriver.sys

;
;--- MyFirstDriver_Device Coinstaller installation ------
;

[MyFirstDriver_Device.NT.CoInstallers]
AddReg=MyFirstDriver_Device_CoInstaller_AddReg
CopyFiles=MyFirstDriver_Device_CoInstaller_CopyFiles

[MyFirstDriver_Device_CoInstaller_AddReg]
;


[MyFirstDriver_Device_CoInstaller_CopyFiles]
;


[MyFirstDriver_Device.NT.Wdf]
KmdfService =  MyFirstDriver, MyFirstDriver_wdfsect
[MyFirstDriver_wdfsect]
KmdfLibraryVersion = 1.15

[Strings]
SPSVCINST_ASSOCSERVICE= 0x00000002
ManufacturerName="<Your manufacturer name>" ;TODO: Replace with your manufacturer name
DiskName = "MyFirstDriver Installation Disk"
MyFirstDriver.DeviceDesc = "MyFirstDriver Device"
MyFirstDriver.SVCDESC = "MyFirstDriver Service"

1 Answers1

1

I had the same issue. In your case you are passing "root/MyFirstDriver" to devcon, but you have defined the id in the inx/inf file to be the similar but not identical string "root\MyFirstDriver". I am guessing that is why your devcon command is failing.

In my case the strings were identical, but I still got the "No matching drivers found in single INF" error. Eventually I found a Debug Win32 driver as I was using was not going to work. Switching the sample project to x64 Release build fixed the issue for me.

NuntiSunya
  • 11
  • 2