How Windows 3.11 Processes PIF File Parameters
This article explores how Microsoft Windows 3.11 handled program
startup parameters through Program Information Files (PIF). In Windows
3.11, PIF files acted as configuration bridges between the Windows
graphical environment and legacy MS-DOS applications. The operating
system parsed predefined arguments, prompted for dynamic user input when
requested, merged parameters from multiple launch points, and populated
the DOS Program Segment Prefix (PSP) using the WINOLDAP
subsystem to deliver arguments to legacy executables.
The Role of the PIF Configuration Structure
In Windows 3.11, MS-DOS executables could not natively interpret
Windows environment settings. To manage DOS execution, Windows used PIF
files, which stored metadata such as memory limits, video modes,
execution priority, and command-line flags. Users configured these files
via the Windows PIF Editor (PIFEDIT.EXE).
Within the PIF binary structure, a dedicated string field stored
"Optional Parameters." This field allowed administrators or users to
define command-line flags (such as /w or
-config) that should accompany the executable each time it
was triggered. If an application was launched directly without its own
custom .PIF file, Windows 3.11 fell back to reading
parameters and configurations from _DEFAULT.PIF.
Dynamic Prompting Using the Question Mark
Windows 3.11 supported dynamic parameter entry through a specific
modifier. If a user entered a single question mark (?) in
the "Optional Parameters" field of the PIF Editor, Windows modified its
execution sequence:
- When the user executed the PIF file, Windows 3.11 paused the launch sequence.
- The operating system displayed a system dialog box asking the user to manually type the desired parameters.
- The string entered by the user replaced the
?token entirely before being handed to the underlying virtual machine.
If the "Optional Parameters" field contained static text alongside other arguments, only dynamic input matching the query prompt was supplemented, allowing partial hardcoding of required flags.
Parameter Precedence and Shell Execution
Parameters could be introduced from three distinct places: the Program Manager icon properties (the command-line field), the PIF file itself, or the File Manager "Run" dialog.
When a user launched a program through a shortcut in Program Manager, Windows 3.11 prioritized command line inheritance. If parameters were supplied in Program Manager's "Command Line" dialog, they generally appended to or superseded the static optional parameters found within the PIF file, depending on whether the PIF file explicitly reserved variable arguments.
Injection via WINOLDAP and the DOS PSP
Once Windows 3.11 resolved the final parameter string, it handed
execution over to WINOLDAP (the Windows Old Application
Manager, typically WINOLDAP.MOD running alongside the
virtual machine manager VMM32 or DOSX in
standard mode).
To transfer these parameters to the DOS application:
- Windows initialized an MS-DOS virtual environment (a Virtual 8086 session in 386 Enhanced Mode).
WINOLDAPset up the standard MS-DOS Program Segment Prefix (PSP) in memory for the new process.- The resolved parameter string was copied directly into the PSP
command tail buffer located at offset
80h(128 bytes). - Offset
80hwas assigned a byte defining the total length of the argument string, followed immediately by the ASCII characters starting at offset81h. - The string was terminated with a carriage return byte
(
0Dh), matching the standard MS-DOS specification.
When the application's executable code began running, it inspected
offset 80h of its PSP exactly as if it had been launched
from standard COMMAND.COM, completely unaware that Windows
3.11 had intercepted, parsed, and constructed the startup
parameters.