A complete reference to the general structure and content of a Windows 95 INF file is in Device Information (INF) File Reference. A brief summary of that information follows because in order to become immediately productive with Infedit, it helps to have a model of the parts of an INF file in mind. The structural parts of an INF file are sections and items. Infedit builds an INF file one section and one item at a time.
An INF file is made up of a set of named sections. A section contains one or more items. Each section begins with the section name enclosed in square brackets. There can be any number of sections in an INF file, but there are a limited number of types of sections.
Sections can be put in any order in an INF file, but the sample modem INF files provided in the MDK have the different types of sections laid out in roughly the same order in each INF file so its easier to find sections of the same type in different INF files. For the same reason, the modem INF files you will find in the \WINDOWS\SYSTEM\INF directory on your Windows 95 computer have the types of sections in roughly the same order. But this is a convention only, not a requirement. The sections that deal with IDs are usually at the beginning of the INF file, sections that support modem-specific commands, voice modem commands, and Voice View are kept separate from each other in the middle of the INF file, and the modem responses are near the end of the file.
Each type of section has a particular purpose; for example, to add entries to the registry or to copy files.
Each of the items in a section contributes to that section's purpose and the syntax of each type of item that can be used in a particular type of section reflects that.
Three sections from a sample INF file are shown in the following, so you can more easily visualize an INF file being made up of sections and each section being made up of one or more items. The section named Manufacturer contains one item, the section named Microsoft contains two items, and the section named Strings contains four items plus three lines of comments.
[Manufacturer]
%Microsoft% = Microsoft
[Microsoft]
%Modem1% = Modem1, PCMCIA\RIPICAB-RC144ACL-3BD0
%Modem2% = Modem2, UNIMODEME9DF4BA4
[Strings]
; This section lists strings that are used by the Modems control panel applet
; and the Install New Modem wizard.
; For example, Modem1 will appear as "Microsoft 144 PCMCIA Data Fax Modem".
ClassName = "Modem"
Microsoft = "Microsoft"
Modem1 = "Microsoft 144 PCMCIA Data Fax Modem"
Modem2 = "Microsoft 288 External Data Fax Modem"
All the types of sections that can be in an INF file are listed in the following summary table. The types of sections that are most often used in a modem INF file are listed at the top of the table.
Type of INF File Section | Purpose | Comment |
---|---|---|
INF file header. | The standard header for all INF files. | Every INF file must have a header section, which is always the named section [Version] |
Manufacturer | Identifies the manufacturer of one or more devices defined in the INF file, describes the device(s), and identifies the Install section that contains the script for installing each device. | Every INF file must have a [Manufacturer] section. |
Install sections | Identifies the other sections in the INF file that describe the resource requirements of a device and which add entries to the registry, copy files, etc. | Every INF file must have at least in Install-type section. Typically, there is one Install-type section for each modem model the INF file is capable of installing. |
Add Registry sections | Adds subkeys or value names to the registry, optionally setting values. | Most of the information in a modem INF file is in Add Registry-type sections, also known as AddReg sections. |
Strings section | Defines one or more names that represent a string of displayable characters. | Every INF file has a [Strings] section. |
NoResDup section | Provides a method for the installing devices that use no resources. | See the topic Using PosDup and NoResDup INF Sections for example uses of this type of section. |
PosDup section | Provides a method for identifying devices that may appear to be separate devices but are in fact the same device. | See the topic Using PosDup and NoResDup INF Sections for example uses of this type of section. |
ControlFlags section | Provides limited control over UI displays and events during device installation. | May be used to prevent the names of Plug and Play modems from being displayed in a list of modems user can choose to install. |
CopyFiles sections | Names the files copied from the source disk(s) to the destination directories during device installation. | Must be used if your modem requires driver files to be installed in addition to the INF file. |
Rename Files sections | Names the files to be renamed when they are copied from the source disk(s) to the destination directories during device installation. Also gives the new filenames on the destination directories. | May be used if your modem requires driver files to be installed in addition to the INF file. |
DelFiles sections | Names the files to be deleted from destination directories during device installation. | May be used in the uninstall part of your INF file. |
Delete Registry sections | Deletes subkeys or value names from the registry. | Probably always used in the uninstall part of your INF file. |
Log Config sections | Defines device configuration details such as IRQs, memory address ranges, I/O address ranges, and/or DMA channels. | |
Disk Names section | Identifies and names the disk(s) that are the source of files that are copied to the hard disk during installation. Also names the files that are on each of the installation disk(s). | |
Update Autoexec.bat sections | Manipulates lines in the AUTOEXEC.BAT file. | |
Update Config.sys sections | Manipulates lines in the CONFIG.SYS file. | |
Ini File to Registry sections | Moves lines or sections from an INI file to the registry, creating or replacing an entry under a specific key in the registry. | |
Update Ini File sections | Replaces, adds, and deletes entries in an INI file. | |
Update Ini Fields sections | Replaces, adds, and deletes fields in the value of a given entry in an INI file. | |
HW section | A special case of an Install section. The only type of section that allows entries to be made to the Hardware branch of the registry. | |
ClassInstall section | Installs a new class for a device in the Class section of the registry on a Windows 95 machine. |