Sample Code

windows driver samples/ Print Driver INF Sample/ C++/ PreVista/ PreVista.inf/

; This inf file provides the general structure for using a 
; single INF file to install different printing  drivers on
; Windows 2000, Windows 9x, Windows XP and Windows Server 2003.
;
; It includes specific INF constructs to demonstrate:
;	Platform extensions, including consistent usage
;	Installation on multiple platforms from one INF file
; 	Installation of different local language versions of binaries
;
; Limitation - Windows 9x does not recognize or handle localized 
; 	[Strings.LanguageID] sections, and so the localization
;	techniques exemplified in this INF file cannot be used 
;	on Windows 9x. See the readme file accompanying this
;	sample for suggestions for Windows 9x handling. 
;	The installation sections for Windows 9x present in this sample
;	are included for llustrative purposes only.
;
; Copyright 2003 Microsoft Corporation


[Version]
Signature="$CHICAGO$"		;Use "$CHICAGO$" for 9x - NT-based platforms recognize this too
Class=Printing						

ClassGUID={4D36E979-E325-11CE-BFC1-08002BE10318}
Provider=%VendorName%
CatalogFile=PreVista.cat	;Single Catalog file for all OS versions - Windows 9x/ME, Windows 2000,
				;Windows XP and Windows Server 2003 - and all locales supported by this INF file
DriverVer=07/01/2001, 1.0.0.0


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Manufacturer and Models Sections 
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[Manufacturer]
;Use decorations and platform extensions to differentiate between different platforms
%WhoMakesIt% = Company, NT.5.1, NTamd64, NTia64

;Models section for installation on Win9x and Windows 2000
[Company]
%Device.Description%      = DriverInstall, OEM_Company_NameABC_640A, ABC_Printer

;Models section for installation of x86 driver on Windows XP and above
[Company.NT.5.1]
%DeviceXP.Description%  = DriverInstallXP, OEM_Company_NameABC_640A, ABC_UniDrv5_Printer

;Models section for installation of x64 driver on Windows Server 2003 SP1 and above
[Company.NTamd64]
%DeviceXP.Description%  = DriverInstallXP, OEM_Company_NameABC_640A, ABC_UniDrv5_Printer

;Models section for installation of ia64 driver on Windows Server 2003 SP1 and above
[Company.NTia64]
%DeviceXP.Description%  = DriverInstallXP, OEM_Company_NameABC_640A, ABC_UniDrv5_Printer

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; ControlFlags Section
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[ControlFlags]
ExcludeFromSelect = *	; Don't display Plug & Play capable devices in the Add Hardware UI
			; (See the DDK reference "INF ControlFlags Section" for more details)


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DDInstall and Related Sections for Windows 9x
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DriverInstall]
DriverVer=7/1/2001, 1.0		;Windows 98 doesn't recognize DriverVer in the [Version]
				;section, so include it here in the [DDInstall] section
AddReg = Win9xAddReg, CommonAddReg
CopyFiles = Win9xCopyFiles

[Win9xAddReg]
;add appropriate registry entries for device installation on Windows 9x here

[Win9xCopyFiles]
Win9xDriverFile.vxd
Win9xDriverDll.dll


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DDInstall and Related Sections for Windows 2000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DriverInstall.NTx86]
;Same DDInstall name as for Win9x, with the addition of the .NTx86 
;platform extension
AddReg = Win2KAddReg, CommonAddReg
CopyFiles = Win2KCopyDriver, Win2KCopyDlls
Include = =NTPRINT.INF
Needs = TTFSUB.OEM,UNIDRV.OEM

[Win2KAddReg]
;add appropriate registry entries for device installation on 
;Windows 2000 here 

;Use two CopyFiles sections, to differentiate between destinations 
;for the files
[Win2KCopyDriver]
Win2kDriver.GPD

[Win2KCopyDlls]
Win2kDriverGUI.dll
Win2kDriverPlugIn.dll

[DriverInstall.NTx86.Services]
AddService = Win2KDriverFile, %SPSVCINST_ASSOCSERVICE%, Win2KServiceInstallSection
;Use driver binary name for service name
;Use Include and Needs entries as needed
;Include = <INF file distributed with Windows 2000>
;Needs = <DDInstall.Services section from that INF file>

[Win2KServiceInstallSection]
DisplayName = Win2KDriverFile			;Display name is not visible in UI, so use same name 
						;as service name
ServiceType = %SERVICE_KERNEL_DRIVER%		;kernel-mode driver
StartType = %SERVICE_DEMAND_START%		;that will be started as needed
ErrorControl = %SERVICE_ERROR_IGNORE%		;proceed with system startup if driver load fails
ServiceBinary = %12%\Win2KDriverFile.sys	;binary for this service, installed into the
						;\Windows\system32\drivers directory
						;binary name should be listed in the CopyFiles section
AddReg = Win2KServiceAddReg			;Registry entries for this service

[Win2KServiceAddReg]
;add appropriate registry entries for service installation 
;on Windows 2000 here


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DDInstall and Related Sections for Windows XP,
;Windows Server 2003 x86
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DriverInstallXP.NTx86]
;Platform extension .NTx86 used for specific installation on x86 systems

AddReg = WinXPx86AddReg, CommonAddReg, CommonXPAddReg
CopyFiles = WinXPCopyDriver, WinXPCopyDlls
Include = NTPRINT.INF
Needs = TTFSUB.OEM,UNIDRV.OEM

[WinXPx86AddReg]
;add appropriate registry entries for device installation on Windows XP x86 here 

[DriverInstallXP.NTx86.Services]
AddService = WinXPDriverFile, %SPSVCINST_ASSOCSERVICE%, WinXPServiceInstallSection
;Use driver binary name for service name
;Use common service installation section for both x86, ia64, and x64
;Use Include and Needs entries as needed
;Include = <INF file distributed with Windows XP>
;Needs = <DDInstall.Services section from that INF file>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DDInstall and Related Sections for Windows Server 2003 SP1 x64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DriverInstallXP.NTamd64]
;Platform extension .NTamd64 used for specific installation on x64 systems

AddReg = WinXPamd64AddReg, CommonAddReg, CommonXPAddReg
CopyFiles = WinXPCopyDriver, WinXPCopyDlls
Include = NTPRINT.INF
Needs = TTFSUB.OEM,UNIDRV.OEM

[WinXPamd64AddReg]
;add appropriate registry entries for device installation on Windows Server 2003 SP1 x64 here 

[DriverInstallXP.NTamd64.Services]
AddService = WinXPDriverFile, %SPSVCINST_ASSOCSERVICE%, WinXPServiceInstallSection
;Use driver binary name for service name
;Use common service installation section for both x86, ia64, and x64
;Use Include and Needs entries as needed
;Include = <INF file distributed with Windows XP>
;Needs = <DDInstall.Services section from that INF file>

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;DDInstall and Related Sections for Windows XP, 
;Windows Server 2003 ia64
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[DriverInstallXP.NTia64]
;Platform extension .NTia64 used for specific installation on ia64 systems

AddReg = WinXPia64AddReg, CommonAddReg, CommonXPAddReg
CopyFiles = WinXPCopyDriver, WinXPCopyDlls
Include = NTPRINT.INF
Needs = TTFSUB.OEM,UNIDRV.OEM

[WinXPia64AddReg]
;add appropriate registry entries for device installation on Windows XP ia64 here 

[DriverInstallXP.NTia64.Services]
AddService = WinXPDriverFile, %SPSVCINST_ASSOCSERVICE%, WinXPServiceInstallSection
;Use driver binary name for service name
;Use common service installation section for both x86, ia64, and x64
;Use Include and Needs entries as needed
;Include = <INF file distributed with Windows XP>
;Needs = <DDInstall.Services section from that INF file>


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Common Sections for installing on both platforms (x86, ia64, and x64) for Windows XP and above
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[CommonXPAddReg]
;add appropriate registry entries for device installation on all Windows XP platforms here 

;Use two CopyFiles sections, to differentiate between destinations for the files
[WinXPCopyDriver]
WinXPDriver.GPD

[WinXPCopyDlls]
WinXPDriverGUI.dll
WinXPDriverPlugIn.dll


;Common service install section for x86, ia64, and x64
[WinXPServiceInstallSection]
DisplayName = WinXPDriverFile			;Display name is not visible in UI, so use same name 
						;as service name
ServiceType = %SERVICE_KERNEL_DRIVER%		;kernel-mode driver
StartType = %SERVICE_DEMAND_START%		;that will be started as needed
ErrorControl = %SERVICE_ERROR_IGNORE%		;proceed with system startup if driver load fails
ServiceBinary = %12%\WinXPDriverFile.sys	;binary for this service, installed into the
						;\Windows\system32\drivers directory
						;binary name should be listed in the CopyFiles section
AddReg = WinXPServiceAddReg			;Registry entries for this service

[WinXPServiceAddReg]
;add appropriate registry entries for service installation on Windows XP (x86, ia64, and x64) here



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Common Registry Section for installing on all supported platforms
; - Windows 9x/ME, Windows 2000, Windows XP
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[CommonAddReg]
;add appropriate registry entries for device installation on all Windows platforms here 



;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Source Media Information Sections
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

[DestinationDirs]
			;Setting DefaultDestDir isn't required, but it is advisable
DefaultDestDir = 12	;12 is %windir%\system32\drivers for NT-based systems, 
			; %windir%\system\IoSubsys for Windows 9x/Me

Win9xCopyFiles	= 11
Win2KCopyDriver = 12
Win2KCopyDlls	= 11
WinXPCopyDriver = 12
WinXPCopyDlls	= 11


[SourceDisksNames]
1  =  %MediaDescription%

[SourceDisksFiles]
;Specify different paths for different platforms, OS versions and local languages.
;Note that these paths are relative to the root of the source media as specificied 
;in the [SourceDisksNames] sections. In this sample, that root of the source medaia
;is not specified and is assumed to be the root of the physical media.

Win9xDriverFile.vxd		= 1, Win9x
Win9xDriverDll.dll		= 1, Win9x

Win2KDriver.GPD			= 1, Win2K\%LocalLanguage%
Win2KDriverGUI.dll		= 1, Win2K\%LocalLanguage%
Win2KDriverPlugIn.dll		= 1, Win2K\%LocalLanguage%

Win2KDriver.GPD			= 1, Win2K\%LocalLanguage%
WinXPDriverGUI.dll		= 1, WinXP\%LocalLanguage%\x86
WinXPDriverPlugIn.dll		= 1, WinXP\%LocalLanguage%\x86

[SourceDisksFiles.amd64]
Win2KDriver.GPD			= 1, Win2K\%LocalLanguage%
WinXPDriverGUI.dll		= 1, WinXP\%LocalLanguage%\amd64
WinXPDriverPlugIn.dll		= 1, WinXP\%LocalLanguage%\amd64

[SourceDisksFiles.ia64]
Win2KDriver.GPD			= 1, Win2K\%LocalLanguage%
WinXPDriverGUI.dll		= 1, WinXP\%LocalLanguage%\ia64
WinXPDriverPlugIn.dll		= 1, WinXP\%LocalLanguage%\ia64


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; Strings Sections
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Base strings section for use on US English language systems
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Strings]
;List common, non-localizable strings first
;Also list useful constants
SPSVCINST_ASSOCSERVICE = 0x00000002		;Assign this service as the driver for the device installed by this INF file
SERVICE_KERNEL_DRIVER = 0x00000001		;Kernel-mode driver service (NT-based platforms)
SERVICE_DEMAND_START = 0x3			;Driver will be started on demand. Services for most driver
						;should be SERVICE_DEMAND_START
SERVICE_ERROR_IGNORE = 0x0			;proceed with system startup if driver fails to load or initialize


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; US localizable strings section
;
; Separate the localizable strings from the non-localizable strings above
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
VendorName = "Vendor Name"			;Vendor who developed this INF file
WhoMakesIt = "Manufacturer Name"		;Manufacturer of the device and the drivers

;Device descriptions:
Device.Description = "123 Device for Windows 2000/9x"
DeviceXP.Description = "123 Device For Windows XP"

;Media related strings
MediaDescription = "Description for Vendor provided media"
LocalLanguage = "usa"


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;French strings section to be used on French language systems
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Strings.040c]
;Substitute French translations for English language strings below, as appropriate.
;List common, non-localizable strings first
;Also list useful constants
SPSVCINST_ASSOCSERVICE = 0x00000002		;Assign this service as the driver for the device installed by this INF file
SERVICE_KERNEL_DRIVER = 0x00000001		;Kernel-mode driver service (NT-based platforms)
SERVICE_DEMAND_START = 0x3			;Driver will be started on demand. Services for most driver
						;should be SERVICE_DEMAND_START
SERVICE_ERROR_IGNORE = 0x0			;proceed with system startup if driver fails to load or initialize


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; French localizable strings Sections
;
; Separate the localizable strings from the non-localizable strings above
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Substitute French translations for English language text below, as appropriate.
VendorName = "Vendor Name"			;Vendor who developed this INF file
WhoMakesIt = "Manufacturer Name"		;Manufacturer of the device and the drivers

;Device descriptions:
Device.Description = "123 Device for Windows 2000/9x"
DeviceXP.Description = "123 Device For Windows XP"

;Media related strings
MediaDescription = "Description for Vendor provided media"
LocalLanguage = "fre"


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;German strings section to be used on German language systems
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
[Strings.0407]
;List common, non-localizable strings first
;Also list useful constants
SPSVCINST_ASSOCSERVICE = 0x00000002		;Assign this service as the driver for the device installed by this INF file
SERVICE_KERNEL_DRIVER = 0x00000001		;Kernel-mode driver service (NT-based platforms)
SERVICE_DEMAND_START = 0x3			;Driver will be started on demand. Services for most driver
						;should be SERVICE_DEMAND_START
SERVICE_ERROR_IGNORE = 0x0			;proceed with system startup if driver fails to load or initialize


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; German localizable strings Sections
;
; Separate the localizable strings from the non-localizable strings above
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;Substitute German translations for English language text below, as appropriate.
VendorName = "Vendor Name"			;Vendor who developed this INF file
WhoMakesIt = "Manufacturer Name"		;Manufacturer of the device and the drivers
;Device descriptions:
Device.Description = "123 Device for Windows 2000/9x"
DeviceXP.Description = "123 Device For Windows XP"

;Media related strings
MediaDescription = "Description for Vendor provided media"
LocalLanguage = "ger"

Our Services

  • What our customers say about us?

© 2011-2025 All Rights Reserved. Joya Systems. 4425 South Mopac Building II Suite 101 Austin, TX 78735 Tel: 800-DEV-KERNEL

Privacy Policy. Terms of use. Valid XHTML & CSS