Programmatically installing a system driver on Windows 7 x64

5

I am experimenting with the WinDDK and trying to install a system driver on a Windows 7 (x64)virtual box. I have an .inf file:

; testdriver.inf - install information file
[Version] 
Signature = "$Windows NT$" 
Class=System
ClassGUID={4d36e97d-e325-11ce-bfc1-08002be10318} 
Provider=%tester% 
DriverVer= 12/12/2012,1.0.0

[Manufacturer]
%DRV% = TestDriver.DRV

[TestDriver.DRV]
%Tst1%=Tst1.Install, *testdriver\TST1

[DestinationDirs]
Tst1.Files.Driver.NTx86=10,System32\Drivers

[SourceDisksNames]
1="Wdm1 build directory",,,

[SourceDisksFiles.x86]
testdriver.sys=1,objfre_wxp_x86\i386

[DestinationDirs]
DefaultDestDir           = 12
Tst1.DriverFiles         = 12           ;%windir%\system32\drivers
[DefaultInstall]
OptionDesc          = %Tst1%
CopyFiles           = Tst1.DriverFiles
[DefaultInstall.Services]

[DefaultUninstall]

[DefaultUninstall.Services]

[Tst1.Install.NTx86]
CopyFiles=Tst1.Files.Driver.NTx86

[Tst1.Files.Driver.NTx86]
testdriver.sys,,,%COPYFLG_NOSKIP%

[Tst1.Install.NTx86.Services]
AddService = Tst1, %SPSVCINST_ASSOCSERVICE%, Tst1.Service

[Tst1.Service]
DisplayName    = %Tst1.ServiceName%
ServiceType    = %SERVICE_KERNEL_DRIVER%
StartType      = %SERVICE_DEMAND_START%
ErrorControl   = %SERVICE_ERROR_NORMAL%
ServiceBinary  = %10%\System32\Drivers\testdriver.sys
[Tst1.DriverFiles]
testdriver.sys

[Strings]
tester="Tester"
DRV="Driver Development"
Tst1="TST1"
Tst1.ServiceName="TestDriver"
SPSVCINST_ASSOCSERVICE=0x00000002   ; Driver service is associated with device being   installed
COPYFLG_NOSKIP=2    ; Do not allow user to skip file
SERVICE_KERNEL_DRIVER=1
SERVICE_AUTO_START=2
SERVICE_DEMAND_START=3
SERVICE_ERROR_NORMAL=1

The driver is built using the "x64 Free Build Environment". When manually installing the driver on the target platform, the binary is copied to System32\drivers. However, registry entries are not created and therefore the driver cannot be managed through the device manager(as it does not show up in the "Non-Plug and Play Drivers"). What entries should be modified in the .inf file in order to successfully install the driver? Also, can this process be automated by simply moving the binary to System32\drivers and creating the proper registry keys programmatically?

windows-7
windows
drivers
64-bit
asked on Super User Jul 27, 2013 by Sebi

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0