Code Example: Driver Initialization

The following example shows how a basic kernel-mode device driver initializes itself. The code for this example is in chapter 6 directory on the disk that accompanies this book.

This first minimal driver must be manually loaded. It does not touch any hardware, but instead creates an internal device name (MINIMAL0) and a symbolic link name (MIN1). It consists of a single source module, Driver.cpp. A header file, Driver.h, declares driver-specific information about our nonhardware device, such as the DEVICE_EXTENSION.

DRIVERENTRY

In our first non-WDM driver example, the DriverEntry routine is small and straightforward. The responsibilities include

  1. Announcing other DriverEntry points. For the Minimal driver, the ...

Get Windows® 2000 Device Driver Book: A Guide for Programmers, Second Edition, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.