Sample Display INF File

Below is a sample documented display INF file which describes the contents of a display INF file. This corresponds to SAMPLE.INF in the display driver samples directory, which you should use as a starting point for your Windows 95 INF file.


; INF file for Sample Win95 display driver
; Copyright 1995, Sample Company Name, Inc.

The header should contain semicolon comments identifying the driver name, manufacturer, copyright, etc.


[version]
Class=DISPLAY
signature="$CHICAGO$"
Provider=%Mfg%

The [version] section should be as above.


[DestinationDirs]
DefaultDestDir  = 11    ; LDID_SYS
Driver.Copy = 11

The [DestinationDirs] section associates file copy sections in the INF with destination directories on the hard disk. The number "11" is used for the subdirectory WINDOWS \SYSTEM, where most display driver files are copied to.


[SourceDisksNames]
1="Windows 95 Sample Driver Disk",,0

The [SourceDisksNames] section provides a description of the installation disk(s) used to install the display driver files, one line per disk. Each line should have a unique disk ID value on the left hand side. Usually, display driver disks will have only one line. Change the description string so that it matches the label on your driver installation disk.


[SourceDisksFiles]
sample.drv=1
sample.vxd=1

The [SourceDisksFiles] section associates driver files copied by the INF file with disk ID values defined in [SourceDisksNames].


[Manufacturer]
%Mfg%=Mfg

The [Manufacturer] section contains one line per manufacturer name (usually only one). The left hand side is a string identifier contained in the [Strings] section. The right hand side is the name of a section listing drivers for the manufacturer.


[Mfg]
%Sample1.DeviceDesc%=Driver.Install, Display_Sample1
%PCI\VEN_9999&DEV_9999.DeviceDesc%=Driver.Install, PCI\VEN_9999&DEV_9999

[Mfg] is an example of a driver section. Driver sections contain one line per unique device/driver combination. This example list two device types. The left hand side references string identifiers contained in the [Strings] section. The right hand side specifies the name of an install section, followed by corresponding device ID's.

The first line in this example is for a non-Plug and Play device (for example,. ISA or VLB adapter) which does not have a Plug and Play device ID. "Display_Sample1" is a dummy ID that is used in place of a real device ID. Dummy Ids are required for non-Plug and Play devices, so that the driver will be preserved if the user runs Windows Setup again in the future. Do not use "Display_Sample1", rather invent a dummy ID unique to your company and the driver, for example, "Display_ACME-123VLB".

The second line is for a PCI display adapter, with device ID "PCI\VEN_0000&DEV9999".

Note that both devices use the same install section, Driver.Install (below).


[Driver.Install]
CopyFiles=Driver.Copy
DelReg=Prev.DelReg
AddReg=Driver.AddReg

[Driver.Install] is an example install section. Install sections contain lines which tell the Windows device installer how to install the driver, that is, what files to copy, which registry keys to add or delete, which INI files to modify, etc.

The CopyFiles line points to one or more sections that contain files that need to be copied from the driver installation disk.

The DelReg line points to one or more sections that contain registry keys that need to be deleted.

The AddReg line points to one or more sections that contain registry keys that need to be added.

Install sections can also contain UpdateInis and UpdateIniFields sections, but these are usually not used for Windows 95 display drivers.


[Driver.Copy]
sample.drv
sample.vxd

[Driver.Copy] is an example file copy section. File copy sections contain one line for each driver file to be copied from the driver disk to the hard disk. The destination of the files (for example, the WINDOWS \SYSTEM subdirectory) is specified for the section in the [DestinationDirs] section (above).


[Prev.DelReg]
HKR,,Ver
HKR,,DevLoader
HKR,DEFAULT
HKR,MODES
HKR,CURRENT

[Prev.DelReg] should be include "as is" in all display driver INF files. It deletes old keys and values already present in the registry if the user is changing from an old driver to a new one using this INF.


[Driver.AddReg]
HKR,,Ver,,4.0

[Driver.AddReg] is an example of an AddReg section for a display driver. It writes registry values used by Windows to load and configure your driver.

"HKR" is always the registry root value for display AddReg lines. (See the general INF documentation for an explanation of what HKR means.)

"Ver" should be "4.0" for Windows 95 compatible display drivers. For Windows 3.x compatible drivers, it should be "3.x".


HKR,,DevLoader,,*vdd

*VDD is always the Plug and Play "dev loader" for Windows 95 display drivers, so this line is required. If your driver does not use the main Windows 95 VDD (for example, if it is a Windows 3.1 version driver), then change "*vdd" to "*configmg".


HKR,DEFAULT,Mode,,"8,640,480"

"DEFAULT" is a subkey of the display driver software key. It contains the following values, described below: drv, vdd, minivdd, cardvdd, RefreshRate, DDC, and ExtModeSwitch.

The "Mode" value of the DEFAULT subkey specifies the default video mode that Windows Setup will use after this driver is installed. Usually, this is 640x480, 8 bits per pixel.


HKR,DEFAULT,drv,,sample.drv

The "drv" value specifies the main DRV file that should be loaded for the modes supported by your display driver. Usually, there is only one DRV file (for example, a DIB engine minidriver), but in some cases different DRV files may be used for different video modes, especially planar VGA modes. For example, VGA.DRV is always used for 640x480x4bpp. SUPERVGA.DRV is often used for 800x600x4bpp. The MODES subkey explains this in more detail, below.


HKR,DEFAULT,vdd,,"*vdd,*vflatd"

The "vdd" value specifies what should be written to the "display=" line in the [386Enh] section of SYSTEM.INI. Windows 95 drivers should always have *VDD. Minidrivers that require VFLATD should also include *vflatd here, as shown above. If your driver does not use VFLATD, then this line can have the value "*vdd".


HKR,DEFAULT,minivdd,,sample.vxd

The "minivdd" value specifies the mini-VDD VxD that the VDD should load for this display driver.


HKR,DEFAULT,carddvdd,,cardsamp.vxd

The "cardvdd" value specifies a secondary, optional mini-VDD VxD that the VDD should load, in addition to the mini-VDD. Card VDD's can add to and/or override functions supported by the mini-VDD, such as adding refresh rate support, etc. If your driver uses a card VDD, remember to include it in the [SourceDisksFiles] and file copy sections.


HKR,DEFAULT,RefreshRate,,-1

The "RefreshRate = -1" value is required to cause VDD to return monitor information in the DISPLAYINFO structure returned by VDD_GetDisplayInfo. Include this line if your driver/mini-VDD/card VDD needs this information to set the refresh rate.


HKR,DEFAULT,DDC,,1

The "DDC = 1" value is required to cause the VDD to detect VESA DDC compatible monitors during Windows start up. Include this line if your driver supports DDC compatible display adapters.


HKR,DEFAULT,ExtModeSwitch,,0

The "ExtModeSwitch" value controls whether the VDD will allow users to switch away from full-screen MS-DOS programs running in extended and VESA graphics modes. By default, the VDD allows switching, assuming that your mini-VDD can properly save and restore the extended mode when the user returns to the MS-DOS program.

If your mini-VDD does not properly save and restore extended and VESA graphics modes, then you must include this line in your INF. This will cause the VDD to just beep if the user attempts to use ALT-TAB or ALT-ENTER to switch away from a full-screen virtual machine running in an extended graphics mode.


HKR,"MODES\4\640,480",drv,,vga.drv
HKR,"MODES\4\640,480",vdd,,*vdd
HKR,"MODES\4\800,600",drv,,supervga.drv
HKR,"MODES\4\800,600",vdd,,*vdd

"MODES" is a subkey of the display driver software key. It contains subkeys for all of the video modes supported by your driver. Pixel depths are specified as subkeys under MODES, and resolutions as subkeys under pixel depths. For example, using REGEDIT this would appear as:


MODES
    \8
        \640,480
        \800,600
        \1024,768

Under the resolution subkeys, there may be optional values included to override the default DRV and VDD values specified in the DEFAULT subkey.

All display drivers must support 640x480, 4 bits per pixel using the standard Windows VGA driver. VGA.DRV is used to override the default DRV, and "*VDD" overrides the default VDD (since *VFLATD is not needed by VGA.DRV).

Optionally, drivers may support 800x600, 4 bits per pixel using the standard Windows Super VGA driver (SUPERVGA.DRV), as shown in the lines above. If this driver does not work on your display adapters, then do not include these lines in your INF.


HKR,"MODES\8\640,480"
HKR,"MODES\8\800,600"
HKR,"MODES\8\1024,768"
HKR,"MODES\8\1152,900"
HKR,"MODES\8\1280,1024"
HKR,"MODES\16\640,480"
HKR,"MODES\16\800,600"
HKR,"MODES\16\1024,768"
HKR,"MODES\24\640,480"
HKR,"MODES\24\800,600"
HKR,"MODES\24\1024,768"
HKR,"MODES\32\640,480"
HKR,"MODES\32\800,600"

The above lines demonstrate example modes supported by the fictional SAMPLE.DRV installed by this INF file. Add and/or remove lines as appropriate for your driver. This list should be the superset of modes supported by the driver, regardless of variations on different adapters that the DRV supports. Your driver's ValidateMode function will be called for each entry under the MODES subkey. If for some reason the driver cannot support one or more of these modes on the current adapter, (for example, due to video memory or DAC limitations) it should fail the ValidateMode call, and the modes will not be available to the user.


[Strings]
Mfg="Sample Multimedia Visual Computer Technology Systems, Inc."
Sample1.DeviceDesc="Sample WhizKid 4000 VLB"
PCI\VEN_9999&DEV_9999.DeviceDesc="Sample WhizKid 4000 PCI"

The [Strings] section contains manufacturer and device description strings visible to users, and referenced in other sections in the INF. There should be one description per driver line in the driver section(s).

Note, for each Plug and Play ID, there should a line "<device ID>.DeviceDesc", as shown above for the PCI device.