Bus drivers for buses with configuration space must handle this request for their child devices (child PDOs). Filter and function drivers do not handle this request.
A driver or other system component sends this IRP to read the configuration space of a device's parent bus.
A driver or other system component sends this IRP at IRQL < DISPATCH_LEVEL in an arbitrary thread context.
The Parameters.ReadWriteConfig member of the IO_STACK_LOCATION structure is itself a structure containing the following information:
ULONG WhichSpace; PVOID Buffer; ULONG Offset; ULONG Length
The members of the structure can be interpreted differently by different bus drivers, but the members are typically defined as follows:
| Value | Bus | Meaning |
|---|---|---|
| PCI_WHICHSPACE_CONFIG | PCI | PCI configuration space. |
| PCI_WHICHSPACE_ROM | PCI | Read only memory. |
| PCCARD_COMMON_MEMORY_SPACE | PCMCIA | Main PCCARD memory. |
| PCCARD_ATTRIBUTE_MEMORY_SPACE | PCMCIA | PCMCIA attribute (configuration) space. |
| PCCARD_PCI_CONFIGURATION_MEMORY_SPACE | PCMCIA | PCI configuration space. |
On success, a bus driver fills the buffer at Parameters.ReadWriteConfig.Buffer with the requested data.
A bus driver sets Irp->IoStatus.Status to STATUS_SUCCESS or to an appropriate error status such as STATUS_INVALID_PARAMETER_n, STATUS_NO_SUCH_DEVICE, or STATUS_DEVICE_NOT_READY.
On success, a bus driver sets Irp->IoStatus.Information to the number of bytes returned.
If a bus driver is unable to complete this request immediately it can mark the IRP pending, return STATUS_PENDING, and complete the IRP at a later time.
A bus driver handles this IRP for its child devices (child PDOs).
Function and filter drivers do not handle this IRP; they pass it to the next lower driver with no changes to Irp->IoStatus.Status and do not set an IoCompletion routine.
A bus driver that handles this request should check the WhichSpace parameter to ensure that it contains a value that the driver supports.
See Plug and Play for the general rules for handling Plug and Play Minor IRPs.
Typically, a function driver sends this IRP to the top driver in the device stack to which it is attached and the IRP is handled by the parent bus driver.
See Handling IRPs for information on sending IRPs. The following steps apply specifically to this IRP:
Drivers must send this IRP from IRQL < DISPATCH_LEVEL.
A driver can access a bus's configuration space at DISPATCH_LEVEL through a bus interface routine, if the parent bus driver supports such an interface. To get a bus interface, a driver sends an IRP_MN_QUERY_INTERFACE request to the device stack in which the driver is attached. The driver then calls the appropriate routine returned in the interface.
For example, to read configuration space from DISPATCH_LEVEL a driver can call IRP_MN_QUERY_INTERFACE during driver initialization to get the BUS_INTERFACE_STANDARD interface from the parent bus driver. The driver sends the query IRP from IRQL PASSIVE_LEVEL. Later, from code at IRQL DISPATCH_LEVEL, the driver calls the appropriate routine returned in the interface, such as the Interface.GetBusData routine.