Ask Learn
Preview
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign inThis browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Each driver must have a DriverEntry routine, which initializes driver-wide data structures and resources. The I/O manager calls the DriverEntry routine when it loads the driver.
In a driver that supports Plug and Play (PnP), as all drivers should, the DriverEntry routine is responsible for driver initialization, while the AddDevice routine (and, possibly, the dispatch routine that handles a PnP IRP_MN_START_DEVICE request) is responsible for device initialization. Driver initialization includes exporting the driver's other entry points, initializing certain objects the driver uses, and setting up various per-driver system resources. (Non-PnP drivers have significantly different requirements, as described in the Driver Development Kit [DDK] for Microsoft Windows NT 4.0 and earlier.)
DriverEntry routines are called in the context of a system thread at IRQL = PASSIVE_LEVEL.
A DriverEntry routine can be pageable and should be in an INIT segment so it will be discarded. Use an alloc_text pragma directive, as illustrated in the sample drivers that are provided with the Windows Driver Kit (WDK).
This section contains the following topics:
DriverEntry's Required Responsibilities
Ask Learn is an AI assistant that can answer questions, clarify concepts, and define terms using trusted Microsoft documentation.
Please sign in to use Ask Learn.
Sign in