A driver pair is an important development paradigm in Windows driver development. In this, there are two constituent drivers:

  • One driver, called the port driver, handles general tasks common to a whole collection of devices (like a common USB). This is provided by Microsoft.
  • The other, called the miniport driver, miniclass driver, or minidriver, handles device-specific tasks. This is provided by the hardware vendor.

Architecture

Different hardware technology requires different types of driver pairs. Some examples:

  • (display miniport driver, display port driver)
  • (audio miniport driver, audio port driver)
  • (storage miniport driver, storage port driver)
  • (battery miniclass driver, battery class driver)
  • (HID minidriver, HID class driver)
  • (changer miniclass driver, changer port driver)
  • (NDIS miniport driver, NDIS library)

Programming

Windows will load the miniport driver and call its DriverEntry function. The miniport’s DriverEntry will pass the DRIVER_OBJECT struct to an initialisation function in the general driver. The general initialisation function will write its own function pointers to the DRIVER_OBJECT struct.

Core idea: any time an IRP is received by the driver pair, the IRP will first go to the general driver. Only if the general driver can’t resolve it will the miniport handle it.

Resources