Checking Platform Compatibility
The WDMCHECK utility in the companion content evaluates a WDM driver for import compatibility with a Windows 98 or Windows Me platform. To use the tool, follow these steps:
Develop your driver under Windows XP.
Copy the driver binary to the %windir%\system32\drivers directory on a Windows 98/Me system.
Make the drivers directory current.
Invoke WDMCHECK with the name of your driver as the only command-line argument.
WDMCHECK gives you a report about any symbols you re importing that aren t exported by the operating system or any installed WDM library. Figure A-1 illustrates the result of running WDMCHECK on a driver that has no unresolved imports.
Figure A-1. Clean bill of health from WDMCHECK.
Contrast Figure A-1 with Figure A-2, which shows the results for a driver that calls three functions that Windows Me doesn t natively support.
Figure A-2. WDMCHECK results for a driver with missing imports.
WDMCHECK scans the import sections in your driver and attempts to resolve each imported symbol. For symbols imported from NTOSKRNL.EXE, HAL.DLL, NDIS.SYS, and SCSI.SYS, the utility calls a helper VxD. The VxD in turn uses the _PELDR_GetProcAddress service to resolve the symbol. (That s the same service that the system loader will be using when it tries to load your driver, by the way.) For symbols imported from other modules, WDMCHECK opens the target module and scans its table of exported symbols. This algorithm essentially duplicates how the system would resolve references from your driver and therefore constitutes a fair test.
If you want to check a driver for compatibility with Windows 2000 or later, copy it by hand to the drivers directory on the target system and run the DEPENDS utility from the Platform SDK. DEPENDS will flag any undefined imports. Figure A-3 is an example of using DEPENDS on Windows 2000 with a module that uses two functions added to Windows XP.
Figure A-3. DEPENDS shows missing imports.