Windows System Software -- Consulting, Training, Development -- Unique Expertise, Guaranteed Results

Before Posting...
Please check out the Community Guidelines in the Announcements and Administration Category.

devcon doesn't create my device node

mblinovmblinov Member Posts: 14

Hi all, I am trying to get my head around windows drivers. I am using WDM (I was thinking of writing some drivers for some old hardware, windows 2000 type stuff), but currently using latest Windows 10 for devel.

Here are my files ahead of time:
==================================
My first inf attempt with a Manufacturers section: https://pastebin.com/WK6CX8Py
My latest inf that uses DefaultInstall (as per this forum: https://social.msdn.microsoft.com/Forums/en-US/077a70dc-06b6-47ab-b124-d68a6682234b/inf-error-1212-cannot-have-both-manufacturer-and-defaultinstall-sections?forum=wdk): https://pastebin.com/QuHTiArt
Source code: https://pastebin.com/u30fJ5WT
==================================
by running >devcon drivernodes *ROOT* i see devices like

ROOT\VDRVROOT\0000
    Name: Microsoft Virtual Drive Enumerator
...
ROOT\NDISVIRTUALBUS\0000
    Name: NDIS Virtual Network Adapter Enumerator

I would also like to install a virtual driver for a virtual device, and have written a placeholder driver (just a hello world type thing).

I understand the inf is not technically neccesary for non-pnp devices, and in my case the driver is really nothing more than a service? it is only used for certification?
I try to install my driver by running >devcon install MyDriver1.inf root\mydevice.

I understand this should create a device node called "root\mydevice"? However, this fails with

Device node created. Install is complete when drivers are installed...
Updating drivers for root\maxim from C:\Users\Maxim\dev\driver\MyDriver1\Debug\MyDriver1.inf.
devcon failed.

C:\Windows\INF\setupapi.dev.log`, i see the following:

https://pastebin.com/AFamv9px

I should say at this point, that I have ran this command a lot now, and devcon reports the following nodes:

Why does devcon not create the node that I told it to? It always seems to default to the ROOT\SYSTEM\xxxx node. Other drivers seem to be able to create their own nodes no problem, but mine always defaults.

Ive also recently read that the Manufacturers section in the .inf is only for PnP devices, and one should use the DefaultInstall section. I tried this, but in both cases devcon still didnt create the device node that I wanted.

I also receive the following warning: Hardware 'Device 1' does not have an associated service using install section 'mydev.NT'
for the inf file with the [Manufacturers] section. I have read the MSDN note on this, but haven't been able to get rid of it with seemingly every combination of architecture specifiers (.NT, .NTx86, .NTx64), and would also be grateful for some pointers as to how to get rid of it.

I would be very grateful for some pointers.

Comments

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,007

    KMDF 1.5 works perfectly fine on Windows 2000, assuming you can find any systems still running it.

    When you have an INF with a Manufacturers section, you have a PnP device. Your driver will only be loaded when the root enumerator creates a device that is matched by your INF, and that's exactly what "devcon install" does for you. In your case, the INF matches ROOT\SYSTEM, so I'm unclear on why you would want to create a device node called "root\mydevice". When you say "devcon install xxxx.inf root\system", it creates a new node under root\system, and then tells PnP to go load drivers for any nodes without one. That's when your driver will be loaded.

    And every time you call "devcon install", it's going to create another node. That's why you now have 17 of them. Once you have a node, you don't need to call "devcon install" again. Just disable the node, copy the driver into place, and re-enable.

    Your INF says this:

    AddService = mydrvsrv,0,ServiceInstall

    That's wrong. The numeric parameter needs to be a 2 to say "THIS is the service for my device". By using a 0, the system will create the service, but it won't associate that service with your device. That's probably why you get "no driver nodes found for this device".

    DefaultInstall can be used to install non-PnP ("legacy") drivers, but such drivers do not use "devcon install". Instead, you start and stop them using the service manager, "net start" or "sc start".

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • mblinovmblinov Member Posts: 14

    I forgot to ask one more thing:

    KMDF 1.5 works perfectly fine on Windows 2000, assuming you can find any systems still running it.

    Truth be told, I decided to use the WDM API under the blind assumption that because it's older, its more lower level and maybe I could learn more about the Windows driver stuff that way. Realistically, is there really any compelling reason (educational or else) to use WDM over KMDF/UMDF?

  • Doron_HolanDoron_Holan Member - All Emails Posts: 10,435
    via Email
    There is no compelling reason whatsoever. You will be reinventing already tested and validated implementations with implementations that will not be as complete.

    d
    d
  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,283

    There are only compelling arguments:
    1. To use KMDF, instead of WDM
    2. To avoid using WDM, to avoid dealing with a ton of old, annoying, stupid, legacy shit that nobody cares about anymore.

    Even devs who wrote WDM drivers for more than 10 years before KMDF was released (like me) look for every possible reason to avoid WDM.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • mblinovmblinov Member Posts: 14
    edited May 25

    Thanks everyone for your advice,

    That's wrong. The numeric parameter needs to be a 2

    Thanks, this removed the warning.

    When you have an INF with a Manufacturers section, you have a PnP device. Your driver will only be loaded when the root enumerator creates a device that is matched by your INF, and that's exactly what "devcon install" does for you

    This is what I don't understand. devcon simply refuses to create the device node that I tell it to. when I write devcon install MyDevice.inf ROOT\MYDEVICE, it goes off and creates ROOT\SYSTEM\xxxx instead, and then refuses to load the .INF.

    In your case, the INF matches ROOT\SYSTEM

    How do i specify in the INF file what hardware ID it should match? I tried specifying the matching hardware ID in the model section like this:

    [Manufacturer]
    %dev1% = Model, NT$ARCH$
    
    [Model.NT$ARCH$]
    %dev1% = Install,ROOT\MYDEVICE
    

    But this had seemingly no effect; the devcon tool still insists on creating a node called ROOT\SYSTEM\xxxx when I look through the log. Furthermore, If I remove the [Manufacturers] entry, how do I specify what hardware ID it should match?

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,283

    Hmmmm... you seem to be confused about a number of things. I think you’re fighting a symptom of a basic comprehension problem, not an issue with devcon.

    First, a root-enumerated device is a PnP device, plain and simple. The name is kind of the hint: it’s enumerated by “root” during the PnP process, and “root” Is the PnP Manager.

    So, your driver needs to be a PnP compliant driver.

    I haven’t looked at your INF, because I don’t open arbitrary links... you might have better luck posting the actual content here... that’s why we support markdown after all.

    There’s a lot that could be going on to cause what you’re doing to fail, I’m sorry to say. For one thing, you can’t repeatedly re-install your driver on the same system once it’s been installed without changing the driverver in the INF file. The system will use the cached driver package if the driverver directive is the same.

    Your install section looks OK... For reference, the following works:

    [Manufacturer]
    %ManufacturerName%=Standard,NT$ARCH$
    
    [Standard.NT$ARCH$]
    %Nothing_KMDF.DeviceDesc%=Nothing_KMDF_Device, Root\Nothing
    
    [Nothing_KMDF_Device.NT]
    CopyFiles=Drivers_Dir
    
    [Drivers_Dir]
    Nothing_KMDF.sys
    
    

    I realize that’s probably of limited help... but it’s all I’ve got. It’s a holiday weekend here in the States.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • mblinovmblinov Member Posts: 14

    I see, I didn't know about the caching and DriveVer thing.

    Anyhow, I decided to clean up the mess of driver nodes that I've created, and I can't even seem to do that! I am in an administrator console. Here's how I tried to do it:

    C:\Windows\System32>devcon find ROOT*
    ROOT\VOLMGR\0000                                            : Volume Manager
    ROOT\BASICDISPLAY\0000                                      : Microsoft Basic Display Driver
    ROOT\COMPOSITEBUS\0000                                      : Composite Bus Enumerator
    ROOT\VDRVROOT\0000                                          : Microsoft Virtual Drive Enumerator
    ROOT\ISCSIPRT\0000                                          : Microsoft iSCSI Initiator
    ROOT\SPACEPORT\0000                                         : Microsoft Storage Spaces Controller
    ROOT\KDNIC\0000                                             : Microsoft Kernel Debug Network Adapter
    ROOT\UMBUS\0000                                             : UMBus Root Bus Enumerator
    ROOT\CAD\0000                                               : Charge Arbitration Driver
    ROOT\BASICRENDER\0000                                       : Microsoft Basic Render Driver
    ROOT\UNNAMED_DEVICE\0001                                    : NVVHCI Enumerator
    ROOT\NDISVIRTUALBUS\0000                                    : NDIS Virtual Network Adapter Enumerator
    ROOT\MSSMBIOS\0000                                          : Microsoft System Management BIOS Driver
    ROOT\SYSTEM\0000                                            : Plug and Play Software Device Enumerator
    ROOT\SYSTEM\0001                                            : IWD Bus Enumerator
    ROOT\SYSTEM\0004
    ROOT\SYSTEM\0005
    ROOT\SYSTEM\0006
    ROOT\SYSTEM\0007
    ROOT\SYSTEM\0008
    ROOT\SYSTEM\0009
    ROOT\SYSTEM\0011
    ROOT\SYSTEM\0012
    ROOT\SYSTEM\0013
    ROOT\SYSTEM\0014
    ROOT\SYSTEM\0015
    ROOT\SYSTEM\0016
    ROOT\SYSTEM\0017
    ROOT\SYSTEM\0018
    ROOT\SYSTEM\0019
    ROOT\RDPBUS\0000                                            : Remote Desktop Device Redirector Bus
    31 matching device(s) found.
    
    C:\Windows\System32>devcon disable "ROOT\SYSTEM\0019"
    No matching devices found.
    
    C:\Windows\System32>devcon remove "ROOT\SYSTEM\0019"
    No devices were removed.
    

    I tried without the quotation marks, and it still didn't work. I am really lost.

  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,007
    via Email
    On May 25, 2019, at 7:31 AM, mblinov wrote:
    >
    > I tried without the quotation marks, and it still didn't work. I am really lost.

    Then do it from Device Manager, devmgmt.msc. You can uninstall the ones you don't want and get rid of them completely.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • mblinovmblinov Member Posts: 14
    edited May 26

    Hi all,

    Then do it from Device Manager, devmgmt.msc. You can uninstall the ones you don't want and get rid of them completely.

    Ok, that did the trick. I've removed all my device nodes. I still can't get devcon to do what I (think I) want. Below is the complete .INF file.

    ; MyDriver1.inf
    
    [Version]
    Signature="$WINDOWS NT$"
    Class=System
    ClassGuid={4d36e97d-e325-11ce-bfc1-08002be10318}
    Provider=%ManufacturerName%
    DriverVer=05/25/2019,11.0.0.0
    CatalogFile=MyDriver1.cat
    
    [Manufacturer]
    %dev1% = Model, NT$ARCH$
    
    [Model.NT$ARCH$]
    %dev1% = Install, root\mydevice
    
    [Install.NT]
    CopyFiles = DriverCopy
    
    [Install.NT.Services]
    AddService = mydrvsrv,2,ServiceInstall
    
    [DriverCopy]
    MyDriver1.sys
    
    [ServiceInstall]
    ServiceType = 1
    StartType = 1
    ErrorControl = 1
    ServiceBinary = %12%/MyDriver1.sys
    
    [DestinationDirs]
    DefaultDestDir = 12
    
    [SourceDisksNames]
    1 = %DiskName%,,,""
    
    [SourceDisksFiles]
    MyDriver1.sys = 1
    
    [Strings]
    ServiceDesc = "This is the service for the MyDriver1 source"
    main_install_disk = "Main installation disk"
    dev1 = "Device 1"
    ManufacturerName = "Manufacturer of MyDevice1"
    ClassName = ""
    DiskName = "MyDriver1 Source Disk"
    

    What my build directory looks like:

     Directory of C:\Users\Maxim\dev\driver\MyDriver1\Debug
    
    24/05/2019  13:29    <DIR>          .
    24/05/2019  13:29    <DIR>          ..
    24/05/2019  13:29    <DIR>          MyDriver1
    26/05/2019  18:14               784 MyDriver1.cer
    26/05/2019  18:14               912 MyDriver1.inf
    24/05/2019  13:29           225,280 MyDriver1.pdb
    24/05/2019  13:29             5,712 MyDriver1.sys
                   4 File(s)        232,688 bytes
                   3 Dir(s)  42,008,248,320 bytes free
    

    The command I invoke (whilst in this directory)

    C:\Users\Maxim\dev\driver\MyDriver1\Debug>devcon install MyDriver1.inf root\mydevice
    

    This fails with

    Device node created. Install is complete when drivers are installed...
    Updating drivers for root\mydevice from C:\Users\Maxim\dev\driver\MyDriver1\Debug\MyDriver1.inf.
    devcon failed.
    

    The log file reads the following:

    >>>  [Device Install (UpdateDriverForPlugAndPlayDevices) - root\mydevice]
    >>>  Section start 2019/05/26 18:19:11.363
          cmd: devcon  install MyDriver1.inf root\mydevice
         ndv: INF path: C:\Users\Maxim\dev\driver\MyDriver1\Debug\MyDriver1.inf
         ndv: Install flags: 0x00000001
         ndv: {Update Device Driver - ROOT\SYSTEM\0002}
         ndv:      Search options: 0x00000080
         ndv:      Searching single INF 'C:\Users\Maxim\dev\driver\MyDriver1\Debug\MyDriver1.inf'
         dvi:      {Build Driver List} 18:19:11.403
         dvi:           Searching for hardware ID(s):
         dvi:                root\mydevice
         dvi:      {Build Driver List - exit(0x00000000)} 18:19:11.403
    !    ndv:      No matching drivers found in single INF
         dvi:      {DIF_SELECTBESTCOMPATDRV} 18:19:11.403
         dvi:           Default installer: Enter 18:19:11.403
         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)} 18:19:11.413
    !    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 2019/05/26 18:19:11.423
    <<<  [Exit status: FAILURE(0x00000103)]
    

    I can see from the log, that it is failing to find a match for the given hardware ID root\mydevice, but I can see it right there in my .INF.

    Do I need to constantly bump my DriveVer directive every rebuild to ensure that Windows will use the newly-build version instead of taking the cached version?

  • mblinovmblinov Member Posts: 14
    edited May 26

    Ok, I finally got devcon to see it!

    I had the 64-bit version of the WDK toolset in my path, but I was building 32-bit .SYS file. I just needed to switch Visual Studio to build the x64 build, and when I loaded that, devcon finally did something interesting.

    For future reference, I got the hint from here: https://stackoverflow.com/questions/27737232/devcon-disable-cannot-disable-device-not-found

    However, there are still some erorrs. Here is a new, complete log:

    >>>  [Device Install (UpdateDriverForPlugAndPlayDevices) - root\mydevice]
    >>>  Section start 2019/05/26 18:30:00.365
          cmd: devcon  install MyDriver1.inf root\mydevice
         ndv: INF path: C:\Users\Maxim\dev\driver\MyDriver1\MyDriver1\x64\Debug\MyDriver1.inf
         ndv: Install flags: 0x00000001
         ndv: {Update Device Driver - ROOT\SYSTEM\0002}
         ndv:      Search options: 0x00000080
         ndv:      Searching single INF 'C:\Users\Maxim\dev\driver\MyDriver1\MyDriver1\x64\Debug\MyDriver1.inf'
         dvi:      {Build Driver List} 18:30:00.413
         dvi:           Searching for hardware ID(s):
         dvi:                root\mydevice
         sig:           {_VERIFY_FILE_SIGNATURE} 18:30:00.451
         sig:                Key      = mydriver1.inf
         sig:                FilePath = c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf
         sig:                Catalog  = c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\MyDriver1.cat
    !    sig:                Verifying file against specific (valid) catalog failed.
    !    sig:                Error 0x800b0100: No signature was present in the subject.
         sig:           {_VERIFY_FILE_SIGNATURE exit(0x800b0100)} 18:30:00.476
         sig:           {_VERIFY_FILE_SIGNATURE} 18:30:00.478
         sig:                Key      = mydriver1.inf
         sig:                FilePath = c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf
         sig:                Catalog  = c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\MyDriver1.cat
    !    sig:                Verifying file against specific Authenticode(tm) catalog failed.
    !    sig:                Error 0x80092003: An error occurred while reading or writing to a file.
         sig:           {_VERIFY_FILE_SIGNATURE exit(0x80092003)} 18:30:00.484
         dvi:           Created Driver Node:
         dvi:                HardwareID   - root\mydevice
         dvi:                InfName      - c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf
         dvi:                DevDesc      - Device 1
         dvi:                Section      - Install.NT
         dvi:                Rank         - 0x80ff0000
         dvi:                Signer Score - Not digitally signed
         dvi:                DrvDate      - 05/26/2019
         dvi:                Version      - 18.28.18.60
         dvi:      {Build Driver List - exit(0x00000000)} 18:30:00.493
         dvi:      {DIF_SELECTBESTCOMPATDRV} 18:30:00.494
         dvi:           Default installer: Enter 18:30:00.495
         dvi:                {Select Best Driver}
         dvi:                     Class GUID of device changed to: {4d36e97d-e325-11ce-bfc1-08002be10318}.
         dvi:                     Selected Driver:
         dvi:                          Description - Device 1
         dvi:                          InfFile     - c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf
         dvi:                          Section     - Install
         dvi:                {Select Best Driver - exit(0x00000000)}
         dvi:           Default installer: Exit
         dvi:      {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 18:30:00.503
         ndv:      Force Installing Driver:
         ndv:           Inf Name       - mydriver1.inf
         ndv:           Driver Date    - 05/26/2019
         ndv:           Driver Version - 18.28.18.60
         sto:      {Setup Import Driver Package: c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf} 18:30:00.509
         inf:           Provider: Manufacturer of MyDevice1
         inf:           Class GUID: {4d36e97d-e325-11ce-bfc1-08002be10318}
         inf:           Driver Version: 05/26/2019,18.28.18.60
         inf:           Catalog File: MyDriver1.cat
         sto:           {Copy Driver Package: c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf} 18:30:00.518
         sto:                Driver Package = c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf
         sto:                Flags          = 0x00000007
         sto:                Destination    = C:\Users\Maxim\AppData\Local\Temp\{5a59f059-bcb7-6249-a569-2b184dbc2106}
         sto:                Copying driver package files to 'C:\Users\Maxim\AppData\Local\Temp\{5a59f059-bcb7-6249-a569-2b184dbc2106}'.
         flq:                Copying 'c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\mydriver1.inf' to 'C:\Users\Maxim\AppData\Local\Temp\{5a59f059-bcb7-6249-a569-2b184dbc2106}\mydriver1.inf'.
    !!!  flq:                Error installing file (0x00000002)
    !!!  flq:                Error 2: The system cannot find the file specified.
    !    flq:                     SourceFile   - 'c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\MyDriver1.sys'
    !    flq:                     TargetFile   - 'C:\Users\Maxim\AppData\Local\Temp\{5a59f059-bcb7-6249-a569-2b184dbc2106}\MyDriver1.sys'
    !!!  cpy:                Failed to copy file 'c:\users\maxim\dev\driver\mydriver1\mydriver1\x64\debug\MyDriver1.sys' to 'C:\Users\Maxim\AppData\Local\Temp\{5a59f059-bcb7-6249-a569-2b184dbc2106}\MyDriver1.sys'. Error = 0x00000002
    !!!  flq:                SPFQNOTIFY_COPYERROR: returned SPFQOPERATION_ABORT.
    !!!  flq:                Error 995: The I/O operation has been aborted because of either a thread exit or an application request.
    !!!  flq:                FileQueueCommit aborting!
    !!!  flq:                Error 995: The I/O operation has been aborted because of either a thread exit or an application request.
    !!!  sto:                Failed to copy driver package to 'C:\Users\Maxim\AppData\Local\Temp\{5a59f059-bcb7-6249-a569-2b184dbc2106}'. Error = 0x00000002
         sto:           {Copy Driver Package: exit(0x00000002)} 18:30:00.542
         sto:      {Setup Import Driver Package - exit (0x00000002)} 18:30:00.544
    !!!  ndv:      Driver package import failed for device.
    !!!  ndv:      Error 2: The system cannot find the file specified.
         ndv:      Installing NULL driver.
         dvi:      {Plug and Play Service: Device Install for ROOT\SYSTEM\0002}
    !    dvi:           Installing NULL driver!
         dvi:           {DIF_ALLOW_INSTALL} 18:30:00.748
         dvi:                Default installer: Enter 18:30:00.750
         dvi:                Default installer: Exit
         dvi:           {DIF_ALLOW_INSTALL - exit(0xe000020e)} 18:30:00.751
         dvi:           {DIF_REGISTER_COINSTALLERS} 18:30:00.752
         dvi:                Default installer: Enter 18:30:00.753
         dvi:                Default installer: Exit
         dvi:           {DIF_REGISTER_COINSTALLERS - exit(0x00000000)} 18:30:00.755
         dvi:           {DIF_INSTALLDEVICE} 18:30:00.756
         dvi:                Default installer: Enter 18:30:00.757
    !    dvi:                     Installing NULL driver!
         dvi:                     Install Null Driver: Removing device sub-tree. 18:30:00.760
         dvi:                     Install Null Driver: Removing device sub-tree completed. 18:30:00.762
         dvi:                     Install Null Driver: Restarting device. 18:30:00.766
         dvi:                     Install Null Driver: Restarting device completed. 18:30:00.768
         dvi:                     Install Device: Configuring device class. 18:30:00.769
         dvi:                     Install Device: Configuring device class completed. 18:30:00.770
         dvi:                     Device Status: 0x01802401, Problem: 0x1c (0x00000000)
         dvi:                     Install Device: Starting device 'ROOT\SYSTEM\0002'. 18:30:00.772
         dvi:                     Install Device: Starting device completed. 18:30:00.777
         dvi:                Default installer: Exit
         dvi:           {DIF_INSTALLDEVICE - exit(0x00000000)} 18:30:00.779
         ump:      {Plug and Play Service: Device Install exit(00000000)}
         ndv: {Update Device Driver - exit(00000002)}
    !!!  ndv: Failed to install device instance 'ROOT\SYSTEM\0002'. Error = 0x00000002
    <<<  Section end 2019/05/26 18:30:00.789
    <<<  [Exit status: FAILURE(0x00000002)]
    

    I can see that it is failing, twice, to "verify file signature". Visual Studio 2019 log says that it "succesfully signed ... MyDevice1.cat", and I checked that the current day is the same as in the .INF, and bumped the .INF version, but it still complains. So I am not sure about this one.

    After that it complains that it cannot find the file specified, I assume it's talking about the destination, with the long GUID in its pathname, in the temp directory. Why is it copying stuff into temp? I thought I stated in the directives to put it under %12%, which is the system directory?

  • mblinovmblinov Member Posts: 14

    I write the following mostly incase anyone else has the same issue.

    I'm an idiot... I checked the directory, and sure enough MyDriver.sys wasn't there. I was in some intermediate build directory which had the .INF, but not the .SYS, or the .CAT . Changing into the right directory, devcon can now find the files no problem.

    Running devcon again, I got certification errors as per the log below.

    This is because there is no public driver certificate on the system:
    https://community.osr.com/discussion/274519/a-signed-driver-installs-only-with-windbg

    A public cert for release build kernel-mode drivers is only obtainable through Microsoft:
    https://docs.microsoft.com/en-us/windows-hardware/drivers/install/kernel-mode-code-signing-requirements--windows-vista-and-later-

    However, for development purposes, the following can be done:
    https://docs.microsoft.com/en-us/windows-hardware/drivers/install/installing-an-unsigned-driver-during-development-and-test

    The aforementioned log for reference:

         sig:           {_VERIFY_FILE_SIGNATURE} 20:39:21.815
         sig:                Key      = mydriver1.inf
         sig:                FilePath = c:\users\maxim\dev\driver\mydriver1\x64\debug\mydriver1\mydriver1.inf
         sig:                Catalog  = c:\users\maxim\dev\driver\mydriver1\x64\debug\mydriver1\MyDriver1.cat
    !    sig:                Verifying file against specific (valid) catalog failed.
    !    sig:                Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
         sig:           {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 20:39:21.841
         sig:           {_VERIFY_FILE_SIGNATURE} 20:39:21.844
         sig:                Key      = mydriver1.inf
         sig:                FilePath = c:\users\maxim\dev\driver\mydriver1\x64\debug\mydriver1\mydriver1.inf
         sig:                Catalog  = c:\users\maxim\dev\driver\mydriver1\x64\debug\mydriver1\MyDriver1.cat
    !    sig:                Verifying file against specific Authenticode(tm) catalog failed.
    !    sig:                Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
         sig:           {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 20:39:21.850
         dvi:           Created Driver Node:
         dvi:                HardwareID   - root\mydevice
         dvi:                InfName      - c:\users\maxim\dev\driver\mydriver1\x64\debug\mydriver1\mydriver1.inf
         dvi:                DevDesc      - Device 1
         dvi:                Section      - Install.NT
         dvi:                Rank         - 0x80ff0000
         dvi:                Signer Score - Not digitally signed
         dvi:                DrvDate      - 05/26/2019
         dvi:                Version      - 20.39.7.270
    ........................ stuff omitted for clarity.....................
         sto:                {DRIVERSTORE IMPORT VALIDATE} 20:39:21.950
         sig:                     {_VERIFY_FILE_SIGNATURE} 20:39:21.972
         sig:                          Key      = mydriver1.inf
         sig:                          FilePath = C:\WINDOWS\System32\DriverStore\Temp\{0ef0ad50-4e93-cd4b-a707-a98d6e42a18e}\mydriver1.inf
         sig:                          Catalog  = C:\WINDOWS\System32\DriverStore\Temp\{0ef0ad50-4e93-cd4b-a707-a98d6e42a18e}\MyDriver1.cat
    !    sig:                          Verifying file against specific (valid) catalog failed.
    !    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
         sig:                     {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 20:39:21.982
         sig:                     {_VERIFY_FILE_SIGNATURE} 20:39:21.984
         sig:                          Key      = mydriver1.inf
         sig:                          FilePath = C:\WINDOWS\System32\DriverStore\Temp\{0ef0ad50-4e93-cd4b-a707-a98d6e42a18e}\mydriver1.inf
         sig:                          Catalog  = C:\WINDOWS\System32\DriverStore\Temp\{0ef0ad50-4e93-cd4b-a707-a98d6e42a18e}\MyDriver1.cat
    !    sig:                          Verifying file against specific Authenticode(tm) catalog failed.
    !    sig:                          Error 0x800b0109: A certificate chain processed, but terminated in a root certificate which is not trusted by the trust provider.
         sig:                     {_VERIFY_FILE_SIGNATURE exit(0x800b0109)} 20:39:21.992
    !!!  sig:                     Driver package catalog file certificate does not belong to Trusted Root Certificates, and Code Integrity is enforced.
    !!!  sig:                     Driver package failed signature validation. Error = 0xE0000247
         sto:                {DRIVERSTORE IMPORT VALIDATE: exit(0xe0000247)} 20:39:21.996
    !!!  sig:                Driver package failed signature verification. Error = 0xE0000247
    !!!  sto:                Failed to import driver package into Driver Store. Error = 0xE0000247
         sto:           {Stage Driver Package: exit(0xe0000247)} 20:39:21.998
         sto:      {Setup Import Driver Package - exit (0xe0000247)} 20:39:22.003
    !!!  ndv:      Driver package import failed for device.
    !!!  ndv:      Error 0xe0000247: A problem was encountered while attempting to add the driver to the store.
         ndv:      Installing NULL driver.
    ......................
    
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 13,007

    OK, now you've entered the magical world of driver signing. In Windows 10, unless you have a kernel debugger attached, all drivers must be signed by Microsoft, either through the WHQL process or by using attestation signing.

    Or, for a computer you control, you can turn off "Secure Boot" in the BIOS settings. That will allow you to load drivers signed and cross-signed in the old way.

    Tim Roberts, [email protected]
    Providenza & Boekelheide, Inc.

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 7,283

    Or use a test certificate that you install in the Trusted Root CA store, and enable test signing.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Upcoming OSR Seminars
Developing Minifilters 29 July 2019 OSR Seminar Space
Writing WDF Drivers 23 Sept 2019 OSR Seminar Space
Kernel Debugging 21 Oct 2019 OSR Seminar Space
Internals & Software Drivers 18 Nov 2019 Dulles, VA