The New WDM IRP Dispatch Functions
The AddDevice function, called by the PnP Manager, merely initializes the device (and its extension) object. It is apparent from the AddDevice code that hardware is not yet touched. In fact, two general responsibilities remain for a driver.
Reserve and configure hardware resource requirements for the device
Initialize the hardware to prepare it for use
Both tasks are performed by a driver upon receipt of a special IRP function (and subfunction) code that is new for WDM drivers: IRP_MJ_PNP. PnP IRP codes are sent by the PnP Manager when a variety of events occur, including
Device initialization (perhaps due to insertion)
Device shutdown (perhaps due to removal)
Configuration queries
As described in chapter 6, IRP ...
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.