Bus drivers for buses with configuration space must handle this request for their child devices (child PDOs). Function and filter drivers do not handle this request.
A driver or other system component sends this IRP to write data to 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.
Parameters.ReadWriteConfig is 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:
Returned in the I/O status block.
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 written.
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.
See Plug and Play for the general rules for handling Plug and Play Minor IRPs.
Typically, a function driver sends this IRP to 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 exports such an interface. To get a bus interface, a driver sends an IRP_MN_QUERY_INTERFACE request to its parent bus driver. The driver then calls the appropriate routine returned in the interface.
For example, to write 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.SetBusData routine.