PMINIPORT_QUERY_DEVICE_ROUTINE callback function

HwVidQueryDeviceCallback uses the specified configuration data to configure its adapter, and, possibly, to fill in missing configuration information in the VIDEO_PORT_CONFIG_INFO structure.

Syntax

PMINIPORT_QUERY_DEVICE_ROUTINE PminiportQueryDeviceRoutine;

VP_STATUS PminiportQueryDeviceRoutine(
  PVOID HwDeviceExtension,
  PVOID Context,
  VIDEO_DEVICE_DATA_TYPE DeviceDataType,
  PVOID Identifier,
  ULONG IdentiferLength,
  PVOID ConfigurationData,
  ULONG ConfigurationDataLength,
  PVOID ComponentInformation,
  ULONG ComponentInformationLength
)
{...}

Parameters

HwDeviceExtension

Pointer to the miniport driver's per-adapter storage area. For more information, see Device Extensions.

Context

Pointer to the context value set up by HwVidFindAdapter. Usually, it points to the VIDEO_PORT_CONFIG_INFO buffer or to an offset in that buffer.

DeviceDataType

Specifies the type of configuration information that was requested, which is one of the following:

VpBusData

VpCmosData

VpControllerData

VpMachineData

VpMonitorData

Miniport drivers of x86-type video adapters usually specify VpBusData, particularly for adapters on EISA buses. The VpControllerData and VpMonitorData values have meaning only on ARC-compliant platforms. The VpCmosData and VpMachineData values are seldom used.

Identifier

Pointer to the name of the device as determined by the ARC firmware. This parameter should be used only on ARC-compliant platforms. Otherwise, this pointer should be NULL.

IdentiferLength

ConfigurationData

Pointer to hardware configuration data. The format of this data is determined by the specified DeviceDataType and by the AdapterInterfaceType value in the VIDEO_PORT_CONFIG_INFO.

ConfigurationDataLength

Specifies the size in bytes of the ConfigurationData buffer. In effect, this indicates how much information was collected from the registry and stored in the ConfigurationData buffer allocated by VideoPortGetDeviceBase.

ComponentInformation

Reserved for system use.

ComponentInformationLength

Reserved for system use.

Return Value

HwVidQueryDeviceCallback returns the status of the operation.

Remarks

HwVidQueryDeviceCallback is passed in a call to VideoPortGetDeviceData from the miniport driver's HwVidFindAdapter function. VideoPortGetDeviceData calls HwVidQueryDeviceCallback after collecting available configuration information under the \Registry\Machine\Hardware\Description node of the registry.

HwVidQueryDeviceCallback examines the ConfigurationData, collected from the registry by VideoPortGetDeviceData. It uses this information to configure its adapter, and, possibly, to fill in missing configuration information in the VIDEO_PORT_CONFIG_INFO structure.

HwVidQueryDeviceCallback cannot pass access range values found in the ConfigurationData to any VideoPortReadXxx or VideoPortWriteXxx directly; such addresses first must be mapped by calling VideoPortGetDeviceBase.

If the ConfigurationData buffer has no access range information and the miniport driver's HwVidFindAdapter function has not already called VideoPortGetBusData (or VideoPortGetAccessRanges), its HwVidQueryDeviceCallback function can call VideoPortGetBusData. Access range information returned by VideoPortGetBusData also must be passed to VideoPortVerifyAccessRanges.

If VideoPortVerifyAccessRanges returns NO_ERROR, the miniport driver can call VideoPortGetDeviceBase to obtain mapped logical addresses that it can use to communicate with the adapter by calling the VideoPortReadXxx and/or VideoPortWriteXxx functions.

If it cannot get bus-relative access ranges values by calling VideoPortGetDeviceData, VideoPortGetBusData, or VideoPortGetAccessRanges, a miniport driver can use a set of driver-supplied default access-range values to find its adapter. In these circumstances, the miniport driver must call VideoPortVerifyAccessRanges with the miniport driver-supplied access ranges, and, then call VideoPortGetDeviceBase only if VideoPortVerifyAccessRanges returned NO_ERROR. If a call to VideoPortVerifyAccessRanges is unsuccessful, a given bus-relative range is already in use by the driver of another device.

HwVidQueryDeviceCallback should be made pageable.

Requirements

   
Target Platform Desktop
Header video.h (include Video.h)

See Also

VideoPortGetDeviceData

VideoPortGetAccessRanges

VideoPortVerifyAccessRanges

VideoPortGetBusData

VideoPortGetDeviceBase

Send comments about this topic to Microsoft