Windows Driver Kit: WDM Devices
Tablet PC Button Sample
Description
The Tablet PC button sample driver demonstrates how to support i8042 port-compatible button devices that are installed in a Tablet PC.
Theory of Operation
The sample code supports the infrastructure that is necessary for basic WDM driver operation, including standard driver routines, dispatch routines, Plug and Play (PnP), power management, and handling HIDClass device IOCTLs. Unless a device requires special handling of these basic operations, you do not have to modify the infrastructure code. The code includes Oem
Xxx functions, OEM_
Xxx structures, and OEM_
Xxx constants that indicate the code that a vendor typically needs to customize for a specific device type.
Building the Sample
Use the standard driver build tools for Microsoft Windows Vista. In a driver directory, type
build. The build script generates the corresponding driver (for example, HBtnKey.sys).
Installation
General
To install the driver, copy the driver files (the .sys file) and the INF files to the same location. In Device Manager, do the following:
- Right-click the device, and click Update Driver.
- Select Install from a list or specific location (Advanced), and then click Next.
- Select Don't search. I will choose the driver to install, and then click Have Disk.
- In the Install From Disk dialog box, enter the path of the directory where you copied the driver and INF file.
- Click OK, and then click Finish.
Code Tour
File Manifest
| File | Description |
| Errcodes.mc | Contains event code and messages |
| HBtnKey.c | Contains the OEM-specific code |
| HBtnKey.h | Contains the OEM-specific definitions |
| HBtnKey.rc | Resource file for the driver |
| HidBtn.c | Contains common driver routines |
| HidBtn.h | Contains common definitions |
| HidBtn.inf | INF file for the button driver |
| Ioctl.c | Handles all internal HIDClass IOCTLs |
| Pch.h | Precompile header file |
| Pnp.c | Handles PnP and power management |
| Sources | WDK sources file |
| Makefile | WDK build environment make file |
Build machine: CAPEBUILD