How to Provide Virtual Device Support

In Windows NT, a 16-bit MS-DOS application runs in the context of the VDM. Likewise, any TSRs or 16-bit drivers also run in the VDM layer, just as they would on a normal MS-DOS machine. Attempts to perform privileged hardware access from the VDM layer must be intercepted and routed to the kernel-mode device driver where those operations can occur without compromising system integrity.

There are two strategies for intercepting an application’s attempts to access its hardware:

  1. Modify your application (or its 16-bit device driver) to call the VDD you have written for Windows NT, instead of directly accessing the hardware.

  2. Instead of modifying your MS-DOS application, rely on the VDM to intercept disallowed hardware accesses and route them to your VDD.

These two strategies and the support routines provided by Windows NT are discussed in the following sections.