Setting Up ControllerControl Routines
Call IoCreateController to set up the controller object, specifying the driver-determined Size for the controller extension, which the system allocates from nonpaged pool and initializes with zeros.
Save the ControllerObject pointer returned by IoCreateController, usually in the device extension of each device object representing a physical or logical device that is controlled by the hardware represented by the controller object.
Set up and/or initialize the driver-determined contents of the ControllerObject->ControllerExtension.
The returned ControllerObject pointer, the entry point of the driver's ControllerControl routine, the DeviceObject pointer representing the target device for the current IRP, and a Context pointer to an area already set up for the ControllerControl routine must be passed in the driver's calls to IoAllocateController. Usually, a driver's StartIo routine sets up the area at Context before it calls IoAllocateController.