Return from HwVidFindAdapter

If the miniport’s HwVidFindAdapter function cannot find an adapter it supports, it should set Again to FALSE and return ERROR_DEV_NOT_EXIST. If the HwVidFindAdapter function finds a supported adapter but the driver cannot find valid configuration data for its adapter on a particular I/O bus, it should set Again to FALSE and return ERROR_INVALID_PARAMETER.

Note that setting Again to FALSE and returning control with ERROR_DEV_NOT_EXIST or ERROR_INVALID_PARAMETER indicates that a given I/O bus, identified by the SystemIoBusNumber in the input VIDEO_PORT_CONFIG_INFO buffer, has no video adapters that the miniport driver can support. It does not prevent the video port driver from calling HwVidFindAdapter again with an updated SystemIoBusNumber so that HwVidFindAdapter can look for its video adapter on another I/O bus of the same AdapterInterfaceType.

When the HwVidFindAdapter function finds an adapter it can support, this function must fill in pertinent fields, as appropriate for its adapter and the given AdapterInterfaceType, in the input VIDEO_PORT_CONFIG_INFO buffer, and return NO_ERROR. The HwVidFindAdapter function can set Again to TRUE to be called again with some of the same input VIDEO_PORT_CONFIG_INFO values and a new device extension if there might be another of its adapters on the same I/O bus. Usually, such a miniport driver’s adapter has relocatable I/O ports or device memory.

If a miniport driver’s HwVidFindAdapter function finds that the video adapter does not generate interrupts or that it cannot determine a valid interrupt vector/level for the adapter, HwVidFindAdapter should set both InterruptLevel and InterruptVector in the VIDEO_PORT_CONFIG_INFO structure to zero.

When HwVidFindAdapter returns control, the video port driver checks the interrupt configuration members in VIDEO_PORT_CONFIG_INFO and, if both are zero, does not connect an interrupt for the miniport. Explicitly setting both interrupt configuration members to zero in the HwVidFindAdapter function disables the HwVidInterrupt entry point, if any, that was set up by the miniport’s DriverEntry function.

When a miniport driver’s HwVidFindAdapter routine returns control, VideoPortInitialize returns to the DriverEntry routine if the call(s) to HwVidFindAdapter indicated that the miniport driver could not support an adapter. If a miniport’s HwVidFindAdapter function does not return NO_ERROR for at least one adapter, the driver does not remain loaded after its DriverEntry function returns control. If a miniport’s HwVidFindAdapter function returns anything other than NO_ERROR for a particular adapter, and no other miniport driver returns NO_ERROR from its HwVidFindAdapter routine, then that adapter will be unavailable to any display drivers.