HwVidQueryDeviceCallback Routine

When the system bootstrap loader runs, as much information as possible is stored in the registry about the I/O buses and peripherals that can be found in the machine in the \Registry\Machine\Hardware\Description tree. A HwVidQueryDeviceCallback routine can be used to retrieve this information.

A video miniport driver can attempt to find an adapter it supports by calling VideoPortGetDeviceData with a driver-supplied HwVidQueryDeviceCallback function, a pointer to the miniport's device extension, and a pointer to any driver-supplied context data (which can be the VIDEO_PORT_CONFIG_INFO), requesting one of the following types of data:

·VpBusData for bus-type-specific configuration data if the AdapterInterfaceType in the VIDEO_PORT_CONFIG_INFO was set to Eisa or MicroChannel

·VpControllerData for bus-relative configuration information about a video adapter on the I/O bus in ARC-compliant (RISC-based) machines

·VpMonitorData for configuration information about the video monitor in ARC-compliant machines

·VpMachineData for information on the identifier, specific resource configuration data, and component information about the specific machine

·VpCmosData to return a copy of the CMOS and extended CMOS memory.

If they call VideoPortGetDeviceData, video miniport drivers usually request VpBusData-type configuration information.

VideoPortGetDeviceData calls the HwVidQueryDeviceCallback function with pointers to the input device extension and context data, and with a pointer to a buffer containing the requested information and the length in bytes of the returned data if any is available in the registry.

As already mentioned in Setting up Video Adapter Access Ranges, any bus-relative addresses retrieved from the registry for VIDEO_ACCESS_RANGEs must be mapped to logical address ranges by calling VideoPortGetDeviceBase before they are stored in the miniport's device extension and before they are passed to a VideoPortReadXxx or VideoPortWriteXxx function to communicate with the device.