WacomKMDF Driver

Description

The WacomKMDF directory contains a KMDF version of the sample Wacom HID minidriver.

The WacomPen drivers are HID minidrivers for pen devices from Wacom Technology Corporation. These are electromagnetic input devices that use a 16550 UART-compatible interface. If such a device is installed on a computer system, the corresponding driver is loaded on top of the system-supplied Serial.sys driver, which acts as a lower-level device filter driver. The corresponding sample INF file can be generated from Wacompen.inx. This INF file installs the WacomPen driver for devices whose device ID is ACPI\WACF004. To install a device of this type by using Wacompen.inf, you must specify a device ID of ACPI\WACF004 in the ACPI BIOS.

The sample drivers share code that is located in the following directories:

  • The src\input\hiddigi\common directory contains code that is common to the WacomPen and EloMT sample drivers.

  • The src\input\hiddigi\util directory contains utility functions that are common to all the sample drivers. The utility functions handle tracing driver operation and error logging.

The sample driver demonstrates how to write a KMDF driver for a HID device even though KMDF does not natively support minidrivers. This is achieved by a WDM shim driver (Hidkmdf.sys) that acts as the HIDCLASS minidriver while the real driver is a lower filter in the driver stack. Otherwise, the sample is very similar to the WDM version in terms of how easy it is to customize for a new driver project.

Building the Sample

Use the standard driver build tools from the Windows Driver Kit. In a driver directory, type build. The build script will generate the Wacomdigi.sys driver.

Installation

Driver Files:

  • Wacompen.inf

  • Wacomdigi.sys

  • Hidkmdf.sys (build from the src\hid\hidusbfx2\hidmapper directory)

  • WDF co-installer from <WDK ROOT>\redist\wdf\<platform>\

To install the drivers, copy the driver files and the INF files to the same location. In Device Manager, complete the following steps:

On Windows XP Tablet PC Edition:

  1. Right-click the device, and click Update Driver.

  2. Select Install from a list or specific location (Advanced), and then click Next..

  3. Select Don't search. I will choose the driver to install, and then click Have Disk..

  4. In the Install From Disk dialog box, type the path of the directory where you copied the driver and INF file, and then click OK..

  5. Click Finish.

On Windows Vista and Windows 7:

  1. Right-click the device, and then click Update Driver.

  2. Click the Browse my computer for driver software link.

  3. Click the Let me pick from a list of device drivers on my computer link.

  4. Click Have Disk.

  5. Navigate to the location of the driver file, and then click the INF file.

  6. Click OK.

Code Tour

This section includes a file manifest of all the files in the src\input\hiddigi directory.

File Manifest

src\input\hiddigi\WacomKMDF

File Description

Errcodes.mc

Contains event code and messages.

Pch.h

Precompiled header file.

Sources

WDK sources file.

Makefile

WDK build environment make file.

WacomPen.c

Contains the OEM specific code.

Oempen.c

Contains the OEM specific code.

WacomPen.h

Contains the OEM specific definitions.

WacomPen.rc

The resource file for the driver.

Wacompen.inx

INX file that is used to generate INF files.

src\input\hiddigi\common

File Description

hid.c

Handles all the internal HIDClass IOCTLs.

naturalInput.h

Contains common definitions for UART digitizer drivers.

Pnp.c

Handles PnP and power management.

Serial.c

Contains all functions that deal with the serial port.

Serial.h

Contains serial port definitions.

src\input\hiddigi\util

File Description

Errlog.c

Contains all the error logging functions.

Errlog.h

Contains error logging definitions.

Wtrace.h

Definitions for trace macros. This should be edited to enable tracing if needed.