HwVidQueryNamedValueCallback Routine

As an alternative or in addition, the miniport driver might get configuration data it needs for its adapter from the registry key ..\CurrentControlSet\Services\DriverName\DeviceNumber by calling VideoPortGetRegistryParameters. A HwVidQueryNamedValueCallback can be used to retrieve this information.

A HwVidFindAdapter (or HwVidInitialize) function calls VideoPortGetRegistryParameters with a driver-supplied HwVidQueryNamedValueCallback function, pointers to the device extension and any driver-supplied context data (which can be the VIDEO_PORT_CONFIG_INFO buffer), and a pointer to a Unicode string naming the value to be retrieved from the registry.

A HwVidFindAdapter or HwVidInitialize function can set the IsFileNameParameter argument to TRUE if the driver-supplied Unicode string is a named registry entry whose value is a file name. For this specification, the returned data will be the contents of the named file.

When VideoPortGetRegistryParameters calls the HwVidQueryNamedValueCallback function, it processes whatever configuration data is made available. For example, a HwVidQueryNamedValueCallback function might use retrieved data to determine the miniport’s access ranges and to set up its emulator access ranges (if any), interrupt vector or interrupt IRQL (if any), and so forth in the VIDEO_PORT_CONFIG_INFO buffer, as well as in the miniport’s device extension, before returning control to the HwVidFindAdapter function.

A miniport’s HwVidInitialize function, described in HwVidInitialize Functionality, might also call VideoPortGetRegistryParameters with IsFileNameParameter set to TRUE so that the miniport-supplied HwVidQueryNamedValueCallback function could use the buffered contents of a named file to set up microcode on the adapter.