## The EVENTLOG Sample

The EVENTLOG Sample accompanies Chapter 14 and illustrates how to log an event.

The sample includes one component:

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

### Building EVENTLOG

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

### Testing EVENTLOG

Follow the general instructions for using FastInst in Windows 2000 or Windows 98. The INF file is named EVENTLOG.INF. Each time you start the EVENTLOG device (including the first time, which occurs during installation), it will write an entry to the log. To view the log, open the Administrative Tools applet in Control Panel and launch Event Viewer.

Since Windows 98 doesn’t have an event log, EVENTLOG doesn’t try to write any entries to the log under Windows 98. There’s no point in installing this device in Windows 98, in other words.

### What to look for

The LogEvent function (ReadWrite.cpp) illustrates the mechanics of writing an entry to the event log. The file eventlog.mc illustrates a basic message file using several languages.