Checking Platform Compatibility

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:

  1. Develop your driver under Windows XP.

  2. Copy the driver binary to the %windir%\system32\drivers directory on a Windows 98/Me system.

  3. Make the drivers directory current.

  4. 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.

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.

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.

Figure A-3. DEPENDS shows missing imports.



Programming the Microsoft Windows Driver Model
Programming the Microsoft Windows Driver Model
ISBN: 0735618038
EAN: 2147483647
Year: 2003
Pages: 119
Authors: Walter Oney

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net