WdmCheck Utility


WDMCHECK is an unsupported utility that will help you develop a WDM driver that is binary compatible with Windows and Windows NT. Using it, you can discover whether your driver calls kernel-mode functions that are defined in the DDK but aren't actually available in Windows 98.

If you develop a driver for Windows 2000 or Whistler, you may find that you need to call functions that are not implemented in Windows. Unresolved imports will prevent the driver from loading in Windows, and the operating system won't give you any clue as to why not. DEPENDS.EXE can't help you because nearly all of the kernel functions you call from a WDM driver are defined dynamically when NTKERN.VXD calls _PELDR_AddExportTable during system startup.

Click here to download WDMCHECK.ZIP

Extract the contents of the ZIP file to a directory that you normally have in your execution path.

Using WDMCHECK

WDMCHECK runs only in Windows 98 or a later edition of Windows, such as Millenium. Run WDMCHECK from a command prompt with an argument naming the driver you want to check. E.g.:

C:\>wdmcheck c:\myproject\objchk\i386\mydriver.sys

If your driver doesn't import any symbols that the Windows kernel fails to define, you'll see this message:

	Module has no missing import links
If your driver *does* import symbols that the Windows kernel fails to define, you'll see a message like this one:
	Module uses the following missing functions:

	MmMapLockedPagesSpecifyCache
	. . .
(Incidentally, MmMapLockedPagesSpecifyCache would indicate you've called MmGetSystemAddressForMdlSafe. Look at the StartIo routine in my LOOPBACK sample driver for an illustration of how to do that in a portable way.)

How WDMCHECK validates imported symbols

WDMCHECK uses two different ways to detect missing import symbols, depending on which library is supposed to contain the symbol. In some cases, there is a Windows VxD that creates loader table entries to define symbols that, in Windows 2000, would be defined by the operating system kernel or by a standard Microsoft driver. Such libraries include ntoskrnl.exe, hal.dll, ndis.sys, and scsi.sys. For these libraries, WDMCHECK uses a kernel-mode helper function to see if the referenced symbols have been defined.

In other cases, Windows loads a kernel-mode library to satisfy the import references from your driver. Examples of this case include USBD.SYS, SMCLIB.SYS, and many others. For these libraries, WDMCHECK looks in the %WINDIR%\system32\drivers directory (only) and tries to find the symbols your driver imports in the export directory for the library.

If you're running WDMSTUB...

If you run WDMCHECK on a system where you've installed the WDMSTUB.SYS or WDMSTUB.VXD modules from my book Programming the Microsoft Windows Driver Model (Microsoft Press 1999), you may receive a report like this one:
	Module uses the following missing functions:

	IoAllocateWorkItem (exported by WDMSTUB)
	...
This message is warning you that your driver is calling a kernel function that, but for the presence of WDMSTUB, would have been unresolved. You will need to ship WDMSTUB along with your driver if you want it to run under the same version of Windows 98 on end-user computers.


Walter Oney Software
4 Longfellow Place
Boston, MA 02114

For more information, contact waltoney@oneysoft.com