## Input/Output Device Driver Reference

[prev][next][parent][TOC]

### Building the WIN-OS/2 Mouse Device Driver

WIN-OS/2* provides support for pointing devices using a generic mouse driver (MOUSE.DRV). Some devices may not work correctly with this driver. If this is the case, you should write a WIN-OS/2 mouse driver to support the new device type.

To write a WIN-OS/2 driver, examine the Windows** mouse driver example provided on the Microsoft Device Driver Kit. Use the source code as a template for writing a WIN-OS/2 driver. In order for the driver to run correctly in the operating system, you must replace two files (MOUSE.ASM and INT33H.ASM) used in the Windows mouse driver. The source modifications (which are within the ifdef WINOS2 statements) support the WIN-OS/2 mouse driver. The replacement source files are available on the IBM Device Driver Source Kit for OS/2.

The source code in the MOUSE.ASM file was modified to include global variables needed to support the device.

The source code in the INT33H.ASM file was modified to include the following:

Add the external declarations for the new global variables

Alter the execution path to enable the driver to run seamlessly

Include additional code to support the mouse running under OS/2

Change the state_xlate table

Load ES with a driver code segment value

Call the virtual device driver interface

Add a routine that determines if the DOS session is running seamlessly

These modifications can be used with any device driver that is based on the Windows mouse device driver.