## The HIDFAKE Sample

The HIDFAKE Sample accompanies Chapter 13 and illustrates how to build a HID minidriver for a non-standard HID device.

The sample includes two components:

- HIDFAKE.SYS (SYS subdirectory) is a WDM driver for nonexistent hardware.
- TEST.EXE (TEST subdirectory) is a dialog-based application for testing HIDFAKE.SYS.

### Building HIDFAKE

To build HIDFAKE.SYS, follow the general instructions for building a WDM sample. The Microsoft Visual C++ project file is named HIDFAKE.DSP in the SYS subdirectory.

To build TEST.EXE, follow the general instructions for building user-mode programs. The Microsoft Visual C++ project file is named TEST.DSP in the TEST subdirectory.

### Testing HIDFAKE

Install HIDFAKE.SYS. Follow the general instructions for using FastInst in Windows XP or Windows 98/Me. The INF file is named SYS\HIDFAKE.INF.

Now launch TEST.EXE from the TEST\DEBUG directory. TEST presents a dialog box like this:

When it starts up, TEST reads a feature report from the driver to determine the revision level (1.00 in this picture) of the driver. Each time you press one of the radio buttons, TEST writes a feature report to the driver. The driver continuously reports the setting of the fake button it contains.

### What to look for

The files named DriverEntry.cpp and Control.cpp contain the code that interfaces with HIDCLASS, which is the whole point of this sample. It's all important, unfortunately.