## Pen for OS/2 Device Driver Reference

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

### DevHlp_RegisterDeviceClass

A pen device driver is required to identify that it has Pen for OS/2 logical devices during initialization using DevHlp_RegisterDeviceClass. RegisterDeviceClass eliminates the need to modify the CONFIG.SYS statement for other device drivers, such as MOUSE.SYS with TYPE= statements to establish bindings.

The pen device driver registers as DevClass=DEVCLASS_INPUT with DCFlags declaring that extended information will be generated (allowing for the possibility of future uses of DEVCLASS_INPUT) and identifying the method of attaching the pen hardware product. MOUSE.SYS uses the latter to avoid loading built-in mouse support for devices supported by the pen device driver. The OS/2 mouse driver loads mouse support based on a query of likely mouse hardware connected. This support is called built-in mouse support.

    --------------------------------------------------------------------------

    ddname db 'PENDD$',0
            .
            .
            .
      mov  cx, DEVCLASS_INPUT            ; Device class
      mov  di, REG_EXT_IF                ; Device class flags
      lea  si, ddname                    ; Device driver name (ASCIIZ)
      mov  ax, cs                        ; Ax:bx ->driver entry point
      lea  bx, Idc_DriverEntryPoint
      mov  dl, DevHlp_RegisterDeviceClass
      call DeviceHelp                    ; Register my driver with Pen for OS/2

    --------------------------------------------------------------------------

The Pen for OS/2 Device Driver Services use the device driver name to perform a DevHlp_AttachDD. The pen device driver's device header must enable AttachDD and declare an AttachDD entry point. Logical Device Registration describes the use of the driver entry point. The Pen for OS/2 Device Driver Services do not use the AttachDD entry point and it is available for other private uses. See Pen for OS/2 Extended Interface for complete details of the DevHlp_RegisterDeviceClass interface.