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:

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.