none
Display Driver Unloads Installed Driver RRS feed

  • Question

  • I am working through the KMDOD Sample  found on the msdn website. I am having an interesting problem. I have compiled the code and tried to install using device manager (added the certificate to my computer), and pointing it to my inf file.

    When it installs it gives me the follow error code: This device is not working properly because Windows cannot load the drivers required for this device. (Code 31). It could just be that I need to reboot the computer (as per the doc instructions and what I found here)

    However, it seems to get rid of my normal display driver, which it shouldn't do.  Does anyone know why its doing this, and how to fix?

    Before installation:


    After installation (AMD Radeon is gone!):

    Tuesday, March 5, 2013 2:05 AM

Answers

  • What does the %windir%\inf\setupapi.dev.log file say about the install of the sample driver?  Did you change what IDs the sample INF matches on?  The sample matches on some very generic PCI class codes (i.e. PCI\CC_0300 and PCI\CC_0301).  When a display driver is being installed, the display class installer makes sure that that display driver is used on all display devices on the system that the driver matches on.  Assuming your AMD display device exposes one of those PCI class codes (which is likely), in the %windir%\inf\setupapi.dev.log file, you should see the display class installer updating your AMD display device to use the sample driver when you create a new device and put that driver on it.  If you want to stop your AMD display device from getting its driver changed while you are experimenting with the sample, you should update the sample INF to match on some ID of your creation and then use devcon to create a device per Doron's response.
    Wednesday, March 6, 2013 5:30 PM
  • Which device in device manager did you pick to install your driver/inf on? Probably the amd device. By doing so you changed the display name of the device, to confirm right click on the device, goto the properties tab and look at the hardware ids or location. Another way is to view devices by connection and verify they are in the same part of the tree toplogy

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, March 5, 2013 3:50 AM

All replies

  • Which device in device manager did you pick to install your driver/inf on? Probably the amd device. By doing so you changed the display name of the device, to confirm right click on the device, goto the properties tab and look at the hardware ids or location. Another way is to view devices by connection and verify they are in the same part of the tree toplogy

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, March 5, 2013 3:50 AM
  • Interesting. I don't think I had anything selected. I simply went to the menu, hit "add legacy hardware", walked through the wizard and when it prompted me for a disk, directed it to the inf file. The driver installed, gave me a "This device is not working properly because Windows cannot load the drivers required for this device. (Code 31)", but when the computer rebooted, it was fine.

    Is this a wrong way to install the driver?

    Tuesday, March 5, 2013 5:25 PM
  • easiest way is not to use the UI :).  run

    devcon install <hwid> <inf>


    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Tuesday, March 5, 2013 10:40 PM
  • Where do I find the hardware id? Is it possible to load it virtually?
    Wednesday, March 6, 2013 3:10 AM
  • the HWID would be the ID in your INF that is matched to the DDInstall section

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Wednesday, March 6, 2013 5:44 AM
  • What does the %windir%\inf\setupapi.dev.log file say about the install of the sample driver?  Did you change what IDs the sample INF matches on?  The sample matches on some very generic PCI class codes (i.e. PCI\CC_0300 and PCI\CC_0301).  When a display driver is being installed, the display class installer makes sure that that display driver is used on all display devices on the system that the driver matches on.  Assuming your AMD display device exposes one of those PCI class codes (which is likely), in the %windir%\inf\setupapi.dev.log file, you should see the display class installer updating your AMD display device to use the sample driver when you create a new device and put that driver on it.  If you want to stop your AMD display device from getting its driver changed while you are experimenting with the sample, you should update the sample INF to match on some ID of your creation and then use devcon to create a device per Doron's response.
    Wednesday, March 6, 2013 5:30 PM
  • Great answer. Here's the log file:

    [Device Install Log]
         OS Version = 6.2.9200
         Service Pack = 0.0
         Suite = 0x0100
         ProductType = 1
         Architecture = amd64
    
    [BeginLog]
    
    [Boot Session: 2013/03/16 09:29:03.485]
    
    >>>  [Device Install (DiInstallDriver) - C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\sampledisplay.inf]
    >>>  Section start 2013/03/16 11:02:14.652
          cmd: "C:\WINDOWS\System32\InfDefaultInstall.exe" "C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\sampledisplay.inf"
         inf: {SetupCopyOEMInf: C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\sampledisplay.inf} 11:02:14.653
         sto:      {Import Driver Package: C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\sampledisplay.inf} 11:02:14.775
         sto:           Driver Store   = C:\WINDOWS\System32\DriverStore [Online] (6.2.9200)
         sto:           Driver Package = C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\sampledisplay.inf
         sto:           Architecture   = amd64
         sto:           Flags          = 0x00000000
         inf:           Provider       = Microsoft
         inf:           Class GUID     = {4d36e968-e325-11ce-bfc1-08002be10318}
         inf:           Driver Version = 03/16/2013,10.5.15.717
         inf:           Catalog File   = SampleDisplay.cat
         inf:           Version Flags  = 0x00000001
         flq:           Copying 'C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\SampleDisplay.cat' to 'C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\SampleDisplay.cat'.
         flq:           Copying 'C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\sampledisplay.inf' to 'C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\sampledisplay.inf'.
         flq:           Copying 'C:\Users\MyUser\Documents\Visual Studio 2012\Samples\Kernel mode display\Win8Debug\Package\SampleDisplay.sys' to 'C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\SampleDisplay.sys'.
         pol:           {Driver package policy check} 11:02:15.102
         pol:           {Driver package policy check - exit(0x00000000)} 11:02:15.102
         sto:           {Stage Driver Package: C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\sampledisplay.inf} 11:02:15.103
         inf:                {Query Configurability: C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\sampledisplay.inf} 11:02:15.112
         inf:                     Driver package 'sampledisplay.inf' is configurable.
         inf:                {Query Configurability: exit(0x00000000)} 11:02:15.118
         flq:                Copying 'C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\SampleDisplay.cat' to 'C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}\SampleDisplay.cat'.
         flq:                Copying 'C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\sampledisplay.inf' to 'C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}\sampledisplay.inf'.
         flq:                Copying 'C:\Users\MyUser\AppData\Local\Temp\{3dabb360-8556-0b49-b70b-a20d0f1f7523}\SampleDisplay.sys' to 'C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}\SampleDisplay.sys'.
         sto:                {DRIVERSTORE IMPORT VALIDATE} 11:02:15.160
         sig:                     {_VERIFY_FILE_SIGNATURE} 11:02:15.168
         sig:                          Key      = sampledisplay.inf
         sig:                          FilePath = C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}\sampledisplay.inf
         sig:                          Catalog  = C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}\SampleDisplay.cat
    !    sig:                          Verifying file against specific (valid) catalog failed! (0x800b0109)
    !    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)} 11:02:15.177
         sig:                     {_VERIFY_FILE_SIGNATURE} 11:02:15.177
         sig:                          Key      = sampledisplay.inf
         sig:                          FilePath = C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}\sampledisplay.inf
         sig:                          Catalog  = C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}\SampleDisplay.cat
         sig:                          Success: File is signed in Authenticode(tm) catalog.
         sig:                          Error 0xe0000241: The INF was signed with an Authenticode(tm) catalog from a trusted publisher.
         sig:                     {_VERIFY_FILE_SIGNATURE exit(0xe0000241)} 11:02:15.182
         sto:                {DRIVERSTORE IMPORT VALIDATE: exit(0x00000000)} 11:02:15.191
         sig:                Signer Score = 0x0F000000
         sig:                Signer Name  = WDKTestCert MyUser,130064938328051482
         sto:                {DRIVERSTORE IMPORT BEGIN} 11:02:15.191
         sto:                {DRIVERSTORE IMPORT BEGIN: exit(0x00000000)} 11:02:15.191
         cpy:                {Copy Directory: C:\WINDOWS\System32\DriverStore\Temp\{370518ab-fa72-2e4f-8283-c13101d3e978}} 11:02:15.192
         cpy:                     Target Path = C:\WINDOWS\System32\DriverStore\FileRepository\sampledisplay.inf_amd64_681adc31c1d547c3
         cpy:                {Copy Directory: exit(0x00000000)} 11:02:15.193
         idb:                {Register Driver Package: C:\WINDOWS\System32\DriverStore\FileRepository\sampledisplay.inf_amd64_681adc31c1d547c3\sampledisplay.inf} 11:02:15.194
         idb:                     Created driver package object 'sampledisplay.inf_amd64_681adc31c1d547c3' in DRIVERS database node.
         idb:                     Created driver INF file object 'oem59.inf' in DRIVERS database node.
         idb:                     Registered driver package 'sampledisplay.inf_amd64_681adc31c1d547c3' with 'oem59.inf'.
         idb:                {Register Driver Package: exit(0x00000000)} 11:02:15.196
         idb:                {Publish Driver Package: C:\WINDOWS\System32\DriverStore\FileRepository\sampledisplay.inf_amd64_681adc31c1d547c3\sampledisplay.inf} 11:02:15.197
         idb:                     Activating driver package 'sampledisplay.inf_amd64_681adc31c1d547c3'.
         cpy:                     Published 'sampledisplay.inf_amd64_681adc31c1d547c3\sampledisplay.inf' to 'oem59.inf'.
         idb:                     Indexed 3 device IDs for 'sampledisplay.inf_amd64_681adc31c1d547c3'.
         idb:                {Publish Driver Package: exit(0x00000000)} 11:02:15.219
         sto:                {DRIVERSTORE IMPORT END} 11:02:15.222
         sig:                     Installed catalog 'SampleDisplay.cat' as 'oem59.cat'.
         sto:                {DRIVERSTORE IMPORT END: exit(0x00000000)} 11:02:15.309
         sto:           {Stage Driver Package: exit(0x00000000)} 11:02:15.312
         sto:           Driver Store Filename = C:\WINDOWS\System32\DriverStore\FileRepository\sampledisplay.inf_amd64_681adc31c1d547c3\sampledisplay.inf
         sto:      {Import Driver Package: exit(0x00000000)} 11:02:15.328
         inf:      Driver Store Path: C:\WINDOWS\System32\DriverStore\FileRepository\sampledisplay.inf_amd64_681adc31c1d547c3\sampledisplay.inf
         inf:      Published Inf Path: C:\WINDOWS\INF\oem59.inf
         inf: {SetupCopyOEMInf exit (0x00000000)} 11:02:15.338
         dvi: {Build Driver List} 11:02:15.405
         dvi:      Searching for hardware ID(s):
         dvi:           pci\ven_1002&dev_6738&subsys_00d01002&rev_00
         dvi:           pci\ven_1002&dev_6738&subsys_00d01002
         dvi:           pci\ven_1002&dev_6738&cc_030000
         dvi:           pci\ven_1002&dev_6738&cc_0300
         dvi:      Searching for compatible ID(s):
         dvi:           pci\ven_1002&dev_6738&rev_00
         dvi:           pci\ven_1002&dev_6738
         dvi:           pci\ven_1002&cc_030000
         dvi:           pci\ven_1002&cc_0300
         dvi:           pci\ven_1002
         dvi:           pci\cc_030000
         dvi:           pci\cc_0300
         cpy:      Policy is set to make all digital signatures equal.
         dvi:      Created Driver Node:
         dvi:           HardwareID   - PCI\CC_0300
         dvi:           InfName      - c:\users\MyUser\documents\visual studio 2012\samples\kernel mode display\win8debug\package\sampledisplay.inf
         dvi:           DevDesc      - Kernel mode display only sample driver
         dvi:           Section      - KDODSamp_Inst
         dvi:           Rank         - 0x00f92006
         dvi:           Signer Score - Authenticode
         dvi:           DrvDate      - 03/16/2013
         dvi:           Version      - 10.5.15.717
         dvi: {Build Driver List - exit(0x00000000)} 11:02:15.411
         dvi: {Build Driver List} 11:02:15.412
         dvi:      Searching for hardware ID(s):
         dvi:           pci\ven_1002&dev_6738&subsys_00d01002&rev_00
         dvi:           pci\ven_1002&dev_6738&subsys_00d01002
         dvi:           pci\ven_1002&dev_6738&cc_030000
         dvi:           pci\ven_1002&dev_6738&cc_0300
         dvi:      Searching for compatible ID(s):
         dvi:           pci\ven_1002&dev_6738&rev_00
         dvi:           pci\ven_1002&dev_6738
         dvi:           pci\ven_1002&cc_030000
         dvi:           pci\ven_1002&cc_0300
         dvi:           pci\ven_1002
         dvi:           pci\cc_030000
         dvi:           pci\cc_0300
         cpy:      Policy is set to make all digital signatures equal.
         dvi:      Created Driver Node:
         dvi:           HardwareID   - PCI\VEN_1002&DEV_6738
         dvi:           InfName      - C:\WINDOWS\System32\DriverStore\FileRepository\c8148276.inf_amd64_c022173cac51fb21\c8148276.inf
         dvi:           DevDesc      - AMD Radeon HD 6800 Series
         dvi:           Section      - ati2mtag_NI
         dvi:           Rank         - 0x00e02001
         dvi:           Signer Score - WHQL
         dvi:           DrvDate      - 09/27/2012
         dvi:           Version      - 9.2.0.0
         dvi: {Build Driver List - exit(0x00000000)} 11:02:15.432
         dvi: {DIF_SELECTBESTCOMPATDRV} 11:02:15.432
         dvi:      Using exported function 'DisplayClassInstaller' in module 'C:\WINDOWS\system32\DispCI.dll'.
         dvi:      Class installer == DispCI.dll,DisplayClassInstaller
         dvi:      Using exported function 'CoInstallerEntry' in module 'C:\WINDOWS\system32\coinst_9.002.dll'.
         dvi:      CoInstaller 1 == coinst_9.002.dll,CoInstallerEntry
         dvi:      CoInstaller 1: Enter 11:02:15.470
         dvi:      CoInstaller 1: Exit
         dvi:      Class installer: Enter 11:02:15.470
         dvi:      Class installer: Exit
         dvi:      Default installer: Enter 11:02:15.471
         dvi:           {Select Best Driver}
         dvi:                Class GUID of device remains: {4d36e968-e325-11ce-bfc1-08002be10318}.
         dvi:                Selected:
         dvi:                     Description - [AMD Radeon HD 6800 Series]
         dvi:                     InfFile     - [c:\windows\system32\driverstore\filerepository\c8148276.inf_amd64_c022173cac51fb21\c8148276.inf]
         dvi:                     Section     - [ati2mtag_NI]
         dvi:           {Select Best Driver - exit(0x00000000)}
         dvi:      Default installer: Exit
         dvi: {DIF_SELECTBESTCOMPATDRV - exit(0x00000000)} 11:02:15.473
         dvi: {DIF_DESTROYPRIVATEDATA} 11:02:15.473
         dvi:      CoInstaller 1: Enter 11:02:15.474
         dvi:      CoInstaller 1: Exit
         dvi:      Class installer: Enter 11:02:15.474
         dvi:      Class installer: Exit
         dvi:      Default installer: Enter 11:02:15.474
         dvi:      Default installer: Exit
         dvi: {DIF_DESTROYPRIVATEDATA - exit(0xe000020e)} 11:02:15.475
    <<<  Section end 2013/03/16 11:02:15.475
    <<<  [Exit status: FAILURE(0x00000103)]

    Can I just do 

    devcon install
    PCI\CC_9999 sampledisplay.inf


    and then update the inf to:

    ;++
    ;
    ; Copyright (c) 2011 Microsoft Corporation
    ;
    ; Module Name:
    ;
    ;    SampleDisplay.inf
    ;
    ; Abstract:
    ;
    ;    Inf file for Kernel mode display only sample driver
    ;
    ;--
    
    [Version]
    Signature = "$Windows NT$"
    Class=Display
    ClassGUID={4d36e968-e325-11ce-bfc1-08002be10318}
    Provider=%MS%
    DriverVer=03/16/2013,10.5.15.717
    CatalogFile=SampleDisplay.cat
    
    [DestinationDirs]
    KDODSamp.Files = 12
    
    [SourceDisksNames]
    0=%Desc_Sample%
    
    [SourceDisksNames.ia64]
    
    [SourceDisksFiles]
    SampleDisplay.sys=0
    
    [SourceDisksNames.ia64]
    
    
    [Manufacturer]
    %MS%=MS,NTamd64,NTarm
    
    [MS]
    ;
    ;	Allow the driver to be loaded on VGA and XGA
    ;
    "Kernel mode display only sample driver" = KDODSamp_Inst, PCI\CC_9999
    "Kernel mode display only sample driver" = KDODSamp_Inst, PCI\CC_9999
    
    [MS.NTamd64]
    ;
    ;	Allow the driver to be loaded on VGA and XGA
    ;
    "Kernel mode display only sample driver" = KDODSamp_Inst, PCI\CC_9999
    "Kernel mode display only sample driver" = KDODSamp_Inst, PCI\CC_9999
    
    
    [MS.NTarm]
    ;
    ;	Allow the driver to be loaded on NVIDIA TEGRA
    ;
    "Kernel mode display only sample driver" = KDODSamp_Inst, ACPI\NVD_GFX
    "Kernel mode display only sample driver" = KDODSamp_Inst, ACPI\NVD0001
    
    
    [KDODSamp_Inst]
    Include=msdv.inf
    FeatureScore=F9
    CopyFiles = KDODSamp.Files
    AddReg = KDODSamp_SoftwareDeviceSettings
    
    ;
    ;   Install driver service
    ;
    [KDODSamp_Inst.Services]
    AddService = KDODSamp,0x00000002,KDODSamp_Service_Inst,
    
    [KDODSamp_Service_Inst]
    ServiceType = %SERVICE_KERNEL_DRIVER%
    StartType = %SERVICE_DEMAND_START%
    ErrorControl = %SERVICE_ERROR_IGNORE%
    ServiceBinary = %12%\SampleDisplay.sys
    
    ;
    ;   Display Adapter Specific Settings
    ;
    [KDODSamp.SoftwareSettings]
    AddReg = KDODSamp_SoftwareDeviceSettings
    
    [KDODSamp_SoftwareDeviceSettings]
    HKR,, VgaCompatible,               %REG_DWORD%, 0
    
    [KDODSamp.Files]
    SampleDisplay.sys
    
    [KDODSamp_EventLog_Inst]
    AddReg = KDODSamp_EventLog_Inst.AddReg
    
    [KDODSamp_EventLog_Inst.AddReg]
    HKR,,EventMessageFile,%REG_EXPAND_SZ%,"%%SystemRoot%%\System32\IoLogMsg.dll"
    HKR,,TypesSupported,%REG_DWORD%,7
    
    
    [Strings]
    
    ;  *******Localizable Strings*******
    MS= "Microsoft"
    Desc_Sample = "Data"
    
    ;  *******Non Localizable Strings*******
    
    SERVICE_BOOT_START = 0x0
    SERVICE_SYSTEM_START = 0x1
    SERVICE_AUTO_START = 0x2
    SERVICE_DEMAND_START = 0x3
    SERVICE_DISABLED = 0x4
    
    SERVICE_KERNEL_DRIVER = 0x1
    SERVICE_ERROR_IGNORE = 0x0
    SERVICE_ERROR_NORMAL = 0x1
    SERVICE_ERROR_SEVERE = 0x2
    SERVICE_ERROR_CRITICAL = 0x3
    
    REG_MULTI_SZ   = 0x00010000
    REG_EXPAND_SZ = 0x00020000
    REG_DWORD = 0x00010001

    Is this a valid approach? I guess I'm still confused on how I create a virtual hardware device/device id


    Saturday, March 16, 2013 3:10 PM
  • Devcon update changes the driver on an existing device. The PCI\Xxxx id is appropriate for this scenario. Devcon install creates a root enumerated (virtual in your terms) device, the PCI\Xxxx id is not appropriate for this since PCI ids belong to PCI enumerated devices.

    d -- This posting is provided "AS IS" with no warranties, and confers no rights.

    Saturday, March 16, 2013 5:36 PM