Windows 98/Me Compatibility Notes
Windows 98/Me uses completely different technology for installing and maintaining devices than does Windows XP. In this section, I ll describe some of the ways this might affect you.
Property Page Providers
A property page provider for a new device class must be a 16-bit DLL. Look at SAMCLS16 in the companion content if you want to see an example, and don t discard your 16-bit compiler just yet!
Installers and Co-installers
A class installer for Windows 98/Me is a 16-bit DLL and uses functions from SETUPX.DLL, which are documented in MSDN rather than in the DDK. I know of no samples to give guidance in writing one. Windows 98/Me doesn t support co-installer DLLs.
Preinstalled Driver Packages
SetupCopyOEMInf isn t implemented in Windows 98 or Windows Me. To preinstall a driver package on these platforms, simply copy the files to the correct locations and design the INF file not to require any file copies.
Digital Signatures
Windows 98 doesn t use digital signatures. Windows Me won t install an unsigned driver to replace a signed driver for audio and certain other multimedia devices or for a display adapter. The DDK describes other rules for when Windows Me uses digital signatures. I confess I couldn t understand all the qualifications and special cases, so I can t explain them to you.
Installing Drivers Programmatically
Because the Windows 98/Me setup program is 16-bit, and because Update Driver ForPlugAndPlayDevices isn t implemented in those systems, relatively heroic means are required to programmatically install a driver for a non-PnP device. I cobbled together the Windows 98/Me version of FASTINST in the companion content by trial and error because the documentation of the 16-bit setup functions is pretty sparse. The basic trick is to construct a Device Information structure for the INF file, restrict it to the driver for the decided-upon device identifier, and call DiInstallDevice. Needless to say, you ll need to get a bunch of details just right to make this process work.
CONFIGMG API
In Windows 98/Me, you often need to call entry points in the protected-mode API exported by CONFIGMG.VXD. The functions you call are documented in the Windows 95 DDK as ring-0 service calls whose names begin with CONFIGMG_. The API functions you call from ring 3 have the same names and arguments except with the prefix CM_. The SAMCLS16.DLL sample in the companion content contains a few CONFIGMG calls that illustrate the mechanics of making these calls.
INF Incompatibilities
Windows 98/Me uses parsing technology and setup libraries that are completely different from those of Windows 2000 and later systems. Consequently, there are many restrictions on how you write an INF file that will be used in both environments. Here s a partial list of them:
Section names are limited to 28 characters.
Windows 98/Me ignores Unicode INF files and decorated [Strings] sections. Thus, to localize an installation for Windows 98/Me, you have to provide a completely new INF file (which requires a new WHQL signature). These facts provide additional reasons for not marketing your driver for Windows 98 or Windows Me on the planet Chronos.
Windows 98/Me doesn t append platform or operating system decorations to the names of sections. Generally, this behavior means that you use undecorated section names for Windows 98/Me and decorated names for the later systems.
Windows 98/Me doesn t combine identically named sections into one section as do Windows 2000 and later systems. Instead, it picks the first one.
Windows 98/Me requires a [ClassInstall] section to define a new setup class.
The Windows 98/Me setup program doesn t handle long filenames (that is, names with components longer than 8 characters) in the first instance. For example, if you specify mydriverfile.sys in a CopyFiles section, setup will present a dialog box saying it can t find the file, even when the file exists. You can then press the OK button, whereupon setup will happily copy the file. A similar issue arises with the directory path in a [SourceDisksFiles] directive. You might notice that all the sample INF files specify objchk~1\i386 instead of objchk_wxp_x86\i386, so you won t be discommoded by this quirk.
Registry Usage
Windows 98/Me uses a registry structure that s completely different from that of Windows XP:
Hardware keys are found in HKLM\Enum.
There is no separate hardware parameters subkey of the hardware key. Instead, standard and nonstandard properties are mixed together in the hardware key.
Class keys are found in HKLM\System\CurrentControlSet\Services\Class. They re identified merely by the class name. (There is a dummy key under Class that has the class GUID as its name, but it s not important.)
Driver keys are numbered subkeys of the class key, as in Windows XP.
Although there can be a service key, it s not very important in Windows 98/Me. Instead, the Configuration Manager relies on entries in the driver key to load the right driver.
To initialize the driver key, your Windows 98/Me install section should have an AddReg directive similar to this example:
[DriverInstall] AddReg=DriverAddReg <other install directives> [DriverAddReg] HKR,,DevLoader,,*ntkern HKR,,NTMPDriver,,pktdma.sys
That is, you designate NTKERN.VXD as the device loader for your device, and you designate your WDM driver as the NTMPDriver for which NTKERN looks.
Getting Device Properties
Windows 98/Me incorrectly implements IoGetDeviceProperty for the FriendlyName property. To retrieve the friendly name in a WDM driver, you should use IoOpenDeviceRegistryKey and interrogate the property by name. The DEVPROP sample illustrates how to do this.