Detecting Devices with Plug and Play

The WDM model is an extension of the NT driver model. DriverEntry still serves as the driver's initial entry point, but its responsibilities are reduced. In particular, the role of DriverEntry is limited to the announcement of other driver functions. Specifically, DriverEntry does not create device objects for hardware it is capable of controlling.

A new driver function, AddDevice, is announced within (interestingly) the Driver Extension. The prototype for the AddDevice function is shown in Table 9.1 and is announced with code typical of the following:

 NTSTATUS DriverEntry( IN PDRIVER_OBJECT pDriverObject, IN PUNICODE_STRING pRegistryPath ) { : // Export other driver entry points... // for example... pDriverObject->DriverUnload ...

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.