Once you've managed to get your device driver loaded—a feat that might require, as I've just discussed, arranging to define Windows 98 stubs for certain support routines—you may need to base run-time decisions on which version of the operating system happens to be in charge of the computer. You might want, for example, to call functions that aren't, strictly speaking, part of the WDM. IoReportTargetDeviceChangeAsynchronous, which I used in the PNPEVENT sample, is such a function.
It's very easy for an application to learn the operation system platform by calling GetVersionEx. The closest equivalent function in kernel mode is IoIsWdmVersionAvailable:
BOOLEAN IoIsWdmVersionAvailable(MajorVersion, MinorVersion); |
Windows 2000 supports WDM version 1.10, which corresponds to the WDM_MAJORVERSION (1) and WDM_MINORVERSION (10) constants in the file WDM.H. Windows 98 (including Windows 98, Second Edition) supports WDM version 1.0 only. You can use this difference in support level to tell which platform you happen to be running on.