Skip to content

Instantly share code, notes, and snippets.

@DepthDeluxe
Created June 16, 2020 16:32
Show Gist options
  • Select an option

  • Save DepthDeluxe/ec343c6d0899dd9bef0be350dada7d5f to your computer and use it in GitHub Desktop.

Select an option

Save DepthDeluxe/ec343c6d0899dd9bef0be350dada7d5f to your computer and use it in GitHub Desktop.
Sample INF for control driver not associated with any PNP device
;
; DriverTests.inf
;
[Version]
Signature="$WINDOWS NT$"
Class=Sample ; TODO: edit Class
ClassGuid={78A1C341-4539-11d3-B88D-00C04FAD5171} ; TODO: edit ClassGuid
Provider=%ManufacturerName%
CatalogFile=DriverTests.cat
DriverVer= ; TODO: set DriverVer in stampinf property pages
[DestinationDirs]
DefaultDestDir = 12
DriverTests_Device_CoInstaller_CopyFiles = 11
; ================= Class section =====================
[ClassInstall32]
Addreg=SampleClassReg
[SampleClassReg]
HKR,,,0,%ClassName%
HKR,,Icon,,-5
[SourceDisksNames]
1 = %DiskName%,,,""
[SourceDisksFiles]
DriverTests.sys = 1,,
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll=1 ; make sure the number matches with SourceDisksNames
;*****************************************
; Install Section
;*****************************************
[DefaultInstall.NT$ARCH$]
OptionDesc = %DriverTests.DeviceDesc%
CopyFiles = Drivers_Dir
CopyFiles = DriverTests_Device_CoInstaller_CopyFiles
[DefaultUninstall.NT$ARCH$]
DelFiles = Drivers_Dir
DelService = DriverTests,0x200
DelReg = DriverTests_Device_CoInstaller_DelReg
DelFiles=DriverTests_Device_CoInstaller_CopyFiles
[Drivers_Dir]
DriverTests.sys
;-------------- Service installation
[DefaultInstall.NT$ARCH$.Services]
AddService = DriverTests,,DriverTests_Service_Inst
; -------------- DriverTests driver install sections
[DriverTests_Service_Inst]
DisplayName = DriverTests
ServiceType = 1 ; SERVICE_KERNEL_DRIVER
StartType = 3 ; SERVICE_DEMAND_START
ErrorControl = 1 ; SERVICE_ERROR_NORMAL
ServiceBinary = %12%\DriverTests.sys
AddReg=DriverTests_Device_CoInstaller_AddReg
;
;--- DriverTests_Device Coinstaller installation ------
;
[DriverTests_Device_CoInstaller_AddReg]
HKR,,CoInstallers32,0x00010000, "WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll,WdfCoInstaller"
[DriverTests_Device_CoInstaller_DelReg]
HKR,"Parameters",,,
[DriverTests_Device_CoInstaller_CopyFiles]
WdfCoInstaller$KMDFCOINSTALLERVERSION$.dll
[Strings]
ManufacturerName="<manufacturer name>" ;TODO: Replace with your manufacturer name
ClassName="Samples" ; TODO: edit ClassName
DiskName = "DriverTests Installation Disk"
DriverTests.DeviceDesc = "DriverTests Device"
DriverTests.SVCDESC = "DriverTests Service"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment