Battery miniclass driver's DispatchDeviceControl routine
The power manager sends device control IRPs (IRP_MJ_DEVICE_CONTROL) to miniclass drivers through the composite battery driver. The battery miniclass driver's DispatchDeviceControl routine handles IRPs containing battery IOCTLs.
In the DispatchDeviceControl routine, the miniclass driver can call the class driver's BatteryClassIoctl routine to perform system-defined device control tasks. BatteryClassIoctl handles device control IOCTLs for batteries.
The DispatchDeviceControl routine should:
Determine if the current IOCTL is a private IOCTL defined by the miniclass driver. If so, perform the requested operation, complete the IRP with IO_NO_INCREMENT, and proceed to step 4.
If the IOCTL isn't a private IOCTL, call BatteryClassIoctl with the IRP and the class handle returned by BatteryClassInitializeDevice. For example:
Status = BatteryClassIoctl (NewBattNP->ClassHandle, Irp);
The class driver's BatteryClassIoctl routine checks if the IOCTL is intended for the specified battery. If so, it calls the corresponding BatteryMiniXxx routine to satisfy the request and completes the IRP with STATUS_SUCCESS. Otherwise, it returns STATUS_NOT_SUPPORTED.
If BatteryClassIoctl returns STATUS_NOT_SUPPORTED, indicating that this isn't a battery IRP, pass the IRP to the next-lower driver.
Return the status as the function's return value.