Windows 3.1 DDK Samples
(Return to the Windows DDK page)
Download the samples.
The samples assume that you are using the Microsoft Windows 3.1 SDK with Microsoft C
and Microsoft MASM 5.1. If you are using a different compiler or assembler, the makefiles
may need to be modified.
In order to build the virtual device Driver (VxD) examples, you must have the Windows
3.1 DDK. At the time of writing these notes, the DDK is the only source for assembling and
linking 32-bit code that can be used as a VxD. In consideration of this, the VxD samples
are provided completely built with debugging information included.
The files provided are:
- SNAPMONO - A snapshot program to snapshot the mono display. This is handy for taking a
snapshot of a debugging session screen and illustrates how to access physical memory in
the upper memory area (UMA) from a protected mode program.
- VXD1 - A skeleton Virtual Device Driver (VxD). This VxD outputs debugging messages to
the debugger display (typically AUX:) for each control that the VxD received. It
illustrates the layout of a VxD and the timing of the various controls.
- VXD2A - A VxD that virtualizes an I/O port. Although it has no corresponding hardware,
this VxD makes a virtual machine think it has hardware at I/O port 0141h. This illustrates
I/O port trapping.
- VXD2B - An extension of VXD2A, this VxD virtualizes an I/O port and simulates interrupts
into a VM. This sample also contains DOS and Windows drivers to access the device and
process interrupts. This sample illustrates how to simulate an interrupt into a VM and the
associated Windows test program illustrates how to process interrupts from a Windows DLL
and post event messages to a Windows application. You can find a full explanation of this
code in the December 1992 issue of C User's Journal.
- CAS1 - This is an API mapper that works in standard and 386 enhanced modes. It
illustrates the use of DPMI for API mapping, allowing protected mode applications to
access a real-mode INT 2Fh API. The API is the Intel Communicating Applications
Specification (CAS) for transmitting telefaxes and graphical images.
- CHTIMER - This is a DLL that hooks the timer interrupt (IRQ0) and posts a message on the
first interrupt. This can easily be modified to serve as an arbitrary interval timer by
changing the number of timer interrupts per interval.
This page Copyright ©1995, CHSW Corporation. All Rights Reserved.
To e-mail a comment about this Web page, click here.
(Updated 11-Apr-1995)