VideoPortVerifyAccessRanges function (video.h)

The VideoPortVerifyAccessRanges function checks the registry for whether another driver has already claimed ownership of the specified bus-relative access ranges and any other hardware resources specified in the VIDEO_PORT_CONFIG_INFO structure. If not, this function claims the given resources for the caller.

Syntax

VIDEOPORT_DEPRECATED VIDEOPORT_API VP_STATUS VideoPortVerifyAccessRanges(
                 PVOID               HwDeviceExtension,
                 ULONG               NumAccessRanges,
  [in, optional] PVIDEO_ACCESS_RANGE AccessRanges
);

Parameters

HwDeviceExtension

Pointer to the miniport driver's device extension.

NumAccessRanges

Specifies the number of elements in the AccessRanges array, or zero.

[in, optional] AccessRanges

Pointer to the miniport driver's access ranges array, or NULL. Each VIDEO_ACCESS_RANGE-type element in this array specifies a bus-relative range of device memory, I/O ports, or register addresses for the adapter.

Return value

VideoPortVerifyAccessRanges returns one of the following values:

Return code Description
ERROR_INVALID_PARAMETER An error occurred or a conflict was found; that is, another driver has already claimed one or more of the given hardware resources for its device.
NO_ERROR The given AccessRanges are valid and have been claimed for use by the caller.

Remarks

Every video miniport driver either must call VideoPortVerifyAccessRanges, or use access ranges returned by VideoPortGetAccessRanges before attempting to access a video adapter during the driver (and system) initialization process.

VideoPortVerifyAccessRanges can be called only by a miniport driver's HwVidFindAdapter function.

Every video miniport driver must define the bus-relative access ranges for its device, either as statically allocated memory in the driver's header file or code or on the stack. Most miniport drivers set up their video access ranges on the stack, except for those that use PC standard address ranges for video memory, such as VGA-compatible SVGA miniport drivers.

The HwVidFindAdapter function should try to obtain bus-relative access range information by calling VideoPortGetAccessRanges, or by checking the registry through calls to VideoPortGetDeviceData or VideoPortGetRegistryParameters. If HwVidFindAdapter cannot get this information, the miniport driver should have a set of bus-relative default values for access ranges.

If a miniport driver's access ranges are externally configurable, the installation program sets up access ranges for the adapter in the registry. Such a miniport driver's HwVidFindAdapter function can call VideoPortGetRegistryParameters with a miniport driver-supplied HwVidQueryNamedValueCallback function that processes information retrieved from the registry.

HwVidFindAdapter must not pass any access range addresses to VideoPortGetDeviceBase unless it calls VideoPortVerifyAccessRanges or VideoPortGetAccessRanges first and the respective function returns NO_ERROR.

VideoPortVerifyAccessRanges can be called again if the initial AccessRanges specification or value in the VIDEO_PORT_CONFIG_INFO, such as an interrupt vector, causes it to return an ERROR_XXX indicating that another driver has already claimed the resource(s).

If VideoPortVerifyAccessRanges returns NO_ERROR, a subsequent call for the same adapter overwrites the miniport driver's claim on resources for that adapter in the registry.

Note that a miniport driver cannot communicate with its video adapter, except by using mapped addresses returned by VideoPortGetDeviceBase with the VideoPortRead/WriteXxx functions.

If the HwVidFindAdapter function claims bus-relative access ranges and possibly other hardware resources for an adapter but then determines that it does not support the adapter, the miniport driver must relinquish its claims on hardware resources in the registry by calling VideoPortVerifyAccessRanges or VideoPortGetAccessRanges with NumAccessRanges set to zero and AccessRanges set to NULL.

To relinquish claims on a subset of claimed access ranges that the miniport driver is no longer using, do the following:

  1. Modify the AccessRanges specification for the adapter so that each element describing a range to be released still has RangeStart set to the bus-relative base of a claimed range, but RangeLength reset to zero.
  2. Call VideoPortVerifyAccessRanges with this modified AccessRanges array.

Requirements

Requirement Value
Minimum supported client Available in Windows 2000 and later versions of the Windows operating systems.
Target Platform Desktop
Header video.h (include Video.h)
Library Videoprt.lib
DLL Videoprt.sys
IRQL PASSIVE_LEVEL

See also

HwVidFindAdapter

HwVidQueryDeviceCallback

HwVidQueryNamedValueCallback

VIDEO_ACCESS_RANGE

VIDEO_PORT_CONFIG_INFO

VideoPortGetAccessRanges

VideoPortGetDeviceBase

VideoPortGetDeviceData

VideoPortGetRegistryParameters