Accessing Device Configuration Space
This article explains how a driver can get information from a target device's configuration space, provided the driver is loaded in the same driver stack as the driver for the target device, either as a function driver or a filter driver.
The configuration space for a device contains a description of the device and its resource requirements. Typically, a driver receives resources from the Plug and Play (PnP) manager in IRP_MN_START_DEVICE, and does not need to query a device to find resources. If the driver does need to access the configuration space:
- Use BUS_INTERFACE_STANDARD provided by the bus driver. For sample code, see Obtaining Device Configuration Information at IRQL = DISPATCH_LEVEL.
- Use IRP_MN_READ_CONFIG and IRP_MN_WRITE_CONFIG. For sample code, see Obtaining Device Configuration Information at IRQL = PASSIVE_LEVEL.
If you need the configuration space of a device whose driver is on a stack other than the one that your driver is on, see Obtaining Configuration Information from Other Driver Stacks.