Calling VideoPortInitialize

A miniport driver might have a set of bus-type-specific HwVidFindAdapter functions if its adapter can be connected on various types of I/O bus, or it can call VideoPortInitialize with the same HwVidFindAdapter function for each type of bus and possibly use driver-supplied HwVid..Callback functions to get adapter configuration information from the registry.

A miniport driver must modify the AdapterInterfaceType member in VIDEO_HW_INITIALIZATION_DATA after each call to VideoPortInitialize, possibly modify the context data (and HwFindAdapter member, if the driver writer implements separate HwVidFindAdapter functions) for the new bus type, and call VideoPortInitialize once for each type of I/O bus on which a supported adapter could be connected.

VideoPortInitialize does the following:

If the miniport driver sets an AdapterInterfaceType value in VIDEO_HW_INITIALIZATION_DATA but there is no I/O bus of that type in the machine, the port driver returns STATUS_NO_SUCH_DEVICE. VideoPortInitialize does not call the miniport-supplied HwVidFindAdapter function for that bus type. The miniport driver does not remain loaded if there are no I/O buses of the corresponding AdapterInterfaceType(s) for its adapter(s) in the machine.

Note that VideoPortInitialize also is responsible for the following before it calls the miniport’s HwFindAdapter routine:

VideoPortInitialize can be called only from a miniport driver’s DriverEntry function.