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

Home NTDEV

Before Posting...

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

More Info on Driver Writing and Debugging


The free OSR Learning Library has more than 50 articles on a wide variety of topics about writing and debugging device drivers and Minifilters. From introductory level to advanced. All the articles have been recently reviewed and updated, and are written using the clear and definitive style you've come to expect from OSR over the years.


Check out The OSR Learning Library at: https://www.osr.com/osr-learning-library/


build windows driver with kmdf 1.11 and visual studio 2015 for windows 7 (64 bit)

mesi_gabaymesi_gabay Member Posts: 9

Hello,
I am building a KMDF driver in Visual Studio 2015 using KMDF version 1.11
I know that with visual studio 2015 I supposed to use at least 1.15 , the reason that I'm using 1.11 is that I will be install that driver on Windows7 64 bit and my understanding was that if I want to support Windows 7 I need to use KMDF version 1.11.
Once the driver is built and I attempt to install it on my test system (Windows7 64 bit) the driver didn't install perfectly, the error given within device manager is:
Windows cannot load the device driver for this hardware. The driver may be corrupted or missing. (Code 39)

I took the following steps :
1. I built a KMDF driver with Visual Studio 2015 (update 3) on pc with windows 10 OS.
2. I changed in my project the next details : Configuration -> Driver Settings -> Target OS Version is set to Windows 7 with Target Platform being desktop.
3. I Took the three files (.inf , .sys and WdfCoinstaller01011.dll) and tried to install the driver on my test system (Windows 7 64 bit).

How can I build a driver in visual studio 2015 (update 3)that running on windows 10 (64 bit) os, That will install perfectly on windows 7 (64 bit)..??
What am I doing wrong?

Thank's,
mesi

Comments

  • Peter_Viscarola_(OSR)Peter_Viscarola_(OSR) Administrator Posts: 9,159

    KMDF 1.11 should work on Windows 7, as you noted.

    You’re sure you’re building a 64-bit driver, for the x64 target?

    Are you supplying a co-installer as part of your INF?

    Why are you using such an ancient version of Visual Studio and the WDK? Why not use the latest and greatest? You can still target Win7 using VS 2017 and WDK 1809.

    Peter

    Peter Viscarola
    OSR
    @OSRDrivers

  • mesi_gabaymesi_gabay Member Posts: 9
    Y> @"Peter_Viscarola_(OSR)" said:
    > KMDF 1.11 should work on Windows 7, as you noted.
    >
    > You’re sure you’re building a 64-bit driver, for the x64 target?
    >
    > Are you supplying a co-installer as part of your INF?
    >
    > Why are you using such an ancient version of Visual Studio and the WDK? Why not use the latest and greatest? You can still target Win7 using VS 2017 and WDK 1809.
    >
    > Peter
  • mesi_gabaymesi_gabay Member Posts: 9
    Hi,

    Thanks for your quick response

    1. yes I'm building a 64-bit driver, for the x64 target
    2. Until you said I did supply a co-installer as part of my INF
    But after I added co-installer section to my inf file, the error given within device manager is: code 10 now

    below is my inf file with the co installer section:

    a;/*++
    ;
    ;Copyright (c) Microsoft Corporation. All rights reserved.
    ;
    ; THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
    ; KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
    ; IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR
    ; PURPOSE.
    ;
    ;Module Name:
    ;
    ; Pci9x5x.INF
    ;
    ;Abstract:
    ; INF file for the PLx PCI9x5xRDK-Lite driver.
    ;
    ;--*/

    [Version]
    Signature="$WINDOWS NT$"
    ;Class=Sample
    ;ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171}
    Class=Multifunction
    ClassGuid={4d36e971-e325-11ce-bfc1-08002be10318}
    Provider=%ProviderString%
    DriverVer = 01/20/2019,9.35.17.14
    CatalogFile=KmdfSamples.cat

    [DestinationDirs]
    DefaultDestDir = 12
    CoInstaller_CopyFiles=11

    [PciOgt_Inst.NT.CoInstallers]
    AddReg=CoInstallers_AddReg
    CopyFiles=CoInstaller_CopyFiles

    [CoInstallers_AddReg]
    HKR,,CoInstallers32,0x00010000,"WdfCoinstaller01011.dll, WdfCoInstaller"
    ;WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll

    [CoInstaller_CopyFiles]
    WdfCoinstaller01000.dll

    [SourceDisksFiles]
    WdfCoInstaller01011.dll=1
    PciOgt.sys=1


    ; ================= Class section =====================

    ;[ClassInstall32]
    ;Addreg=SampleClassReg

    ;[SampleClassReg]
    ;HKR,,,0,%ClassName%
    ;HKR,,Icon,,-5
    ;HKR,,DeviceCharacteristics,0x10001,0x100 ;Use same security checks on relative opens
    ;HKR,,Security,,"D:P(A;;GA;;;SY)(A;;GA;;;BA)" ;Allow generic all access to system and built-in Admin.


    ; ================= Device Install section =====================

    [ControlFlags]
    ExcludeFromSelect=*

    [Manufacturer]
    %ManufacturerString%=MSFT,NTamd64




    [SourceDisksNames]
    1=%DISK_NAME%,

    ; For XP and later
    [MSFT.NTamd64]
    ; DisplayName Section DeviceId
    ; ----------- ------- --------
    %Pci9056.DRVDESC%= PciOgt_Inst, PCI\VEN_1556&DEV_5555
    %Pci9656.DRVDESC%= PciOgt_Inst, PCI\VEN_1172&DEV_0001

    [PciOgt_Inst.NT]
    CopyFiles=PciOgt.CopyFiles

    [PciOgt.CopyFiles]
    PciOgt.sys

    [PciOgt_Inst.NT.Services]
    AddService=PciOgt,0x00000002,PciOgt_Service

    [PciOgt_Service]
    DisplayName = %PciOgt.SVCDESC%
    ServiceType = 1 ; SERVICE_KERNEL_DRIVER
    StartType = 3 ; SERVICE_DEMAND_START
    ErrorControl = 1 ; SERVICE_ERROR_NORMAL
    ServiceBinary = %12%\PciOgt.sys

    [PciOgt_Inst.NT.Wdf]
    KmdfService = PciOgt, PciOgt_wdfsect
    [PciOgt_wdfsect]
    KmdfLibraryVersion = 1.11



    [Strings]
    ProviderString = "ELTA SYSTEMS LTD"
    ManufacturerString = "ELTA SYSTEMS LTD"
    ClassName = "Multifunction Device"
    PciOgt.SVCDESC = "Driver Service for PCI4"
    Pci9056.DRVDESC = "Driver for PCI4"
    Pci9656.DRVDESC = "Driver for PCI4"
    DISK_NAME = "PciOgt Sample Install Disk"


    [PciOgt_Inst.NT.HW]
    AddReg = PciOgt_addreg

    [PciOgt_addreg]
    HKR,Interrupt Management,,0x00000010
    HKR,Interrupt Management\MessageSignaledInterruptProperties,,0x00000010
    HKR,Interrupt Management\MessageSignaledInterruptProperties,MSISupported,0x00010001,1


    What am I doing wrong now ?

    Thanks'
    mesi
  • Tim_RobertsTim_Roberts Member - All Emails Posts: 14,831
    via Email
    On Jan 20, 2019, at 1:03 AM, mesi_gabay wrote:
    >
    > [CoInstallers_AddReg]
    > HKR,,CoInstallers32,0x00010000,"WdfCoinstaller01011.dll, WdfCoInstaller"
    > ;WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
    >
    > [CoInstaller_CopyFiles]
    > WdfCoinstaller01000.dll
    >
    > [SourceDisksFiles]
    > WdfCoInstaller01011.dll=1
    > PciOgt.sys=1

    Note that those last two sections disagree on the name of the KMDF DLL. The INF checker would have caught that.

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

    Tim Roberts, [email protected]
    Software Wizard Emeritus

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. Sign in or register to get started.

Upcoming OSR Seminars
OSR has suspended in-person seminars due to the Covid-19 outbreak. But, don't miss your training! Attend via the internet instead!
Kernel Debugging 13-17 May 2024 Live, Online
Developing Minifilters 1-5 Apr 2024 Live, Online
Internals & Software Drivers 11-15 Mar 2024 Live, Online
Writing WDF Drivers 20-24 May 2024 Live, Online