## The SEHTEST Sample

The SEHTEST Sample accompanies Chapter 3 and illustrates the use of a structured exception frame.

The sample includes one component:

- SEHTEST.SYS is a WDM driver for a non-existent hardware device.

### Building SEHTEST

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

### Testing SEHTEST

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

To verify that SEHTEST has done the right thing, you need to view the debugging output from the driver. Either run under the control of a debugger, or start DbgView (see http://www.sysinternals.com) beforehand.

Note that the SEHTEST device will show up in the Device Manager display with a yellow exclamation mark to indicate that no driver could be loaded. This is the normal result of installing this sample, because DriverEntry returns a failure code.

### What to look for

DriverEntry (in DriverEntry.cpp) raises a number of exceptions that it catches using structured exception frames.