## The WMI42 Sample

The WMI42 Sample accompanies Chapter 10 and illustrates the most basic WMI calls. The test procedure was revised in the 2d edition to use a scripting language instead of C++.

The sample includes one component: WMI42.SYS is a WDM driver for a non-existent hardware device.

### Building WMI42

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

### Testing WMI42

Install the WMI42 "device." Follow the general instructions for using FastInst in Windows XP or Windows 98/Me. The INF file is named WMI42.INF.

If you're testing in Windows 98/Me, please refer to the general instructions for WMI in Windows 98/Me for additional information.

Once you’ve installed WMI42, open a command prompt and launch TEST.VBS with the CSCRIPT command. It will read and report the current value of the Answer property. Then it will change the property value to be one higher. Successive invocations of TEST will print successively higher numbers.

### What to look for

Look at the routines in wmi.cpp to see how to handle simple WMI requests.