The VideoPortGetDeviceBase function maps a range of bus-relative device memory or I/O addresses into system space.
VIDEOPORT_API PVOID VideoPortGetDeviceBase( PVOID HwDeviceExtension, PHYSICAL_ADDRESS IoAddress, ULONG NumberOfUchars, UCHAR InIoSpace );
Pointer to the miniport driver's device extension.
The base physical address of the range to map. You get this bus-relative value by calling VideoPortGetDeviceData, VideoPortGetRegistryParameters, or VideoPortGetAccessRanges. Otherwise, this value is a driver-supplied, default base address for the device memory or I/O ports.
You must have successfully claimed the range described by IoAddress and NumberOfUchars in the registry through a preceding call to VideoPortVerifyAccessRanges or VideoPortGetAccessRanges.
The number of bytes, starting at IoAddress, to map.
The location of the IoAddress range. This parameter can be one of the following flags or an ORed, compatible combination of these flags.
|VIDEO_MEMORY_SPACE_IO||The address range is in I/O space, not in memory space.|
|VIDEO_MEMORY_SPACE_MEMORY||The address range is in memory space, not in I/O space.|
|VIDEO_MEMORY_SPACE_P6CACHE||The processor aggregates a sequence of write operations, sends them to a cache line, and later flushes the cache. This flag is meaningful only when VIDEO_MEMORY_SPACE_IO is not set. Designates the video memory as write-combined (WC). For information about WC caching, see the Write-Combining Memory in Video Miniport Drivers website article.|
If successful, VideoPortGetDeviceBase returns the base virtual address of the mapping. If the specified bus-relative range cannot be mapped, VideoPortGetDeviceBase returns NULL.
Before HwVidFindAdapter returns control, you should store both the mapped base address returned by VideoPortGetDeviceBase and the length of the mapped access range in the adapter's device extension (pointed to by HwDeviceExtension) for later use.
Access to the mapped address space must follow these rules:
- If InIoSpace is VIDEO_MEMORY_SPACE_IO, which indicates that the address is in I/O space, the virtual address that this function returns should be passed to the VideoPortReadPortXxx, VideoPortWritePortXxx, VideoPortReadPortBufferXxx, and VideoPortWritePortBufferXxx functions, where Xxx is Uchar, Ushort, or Ulong.
- If InIoSpace is VIDEO_MEMORY_SPACE_MEMORY, which indicates that the address is not in I/O space but in memory space, the virtual address that this function returns should be passed to the VideoPortReadRegisterXxx, VideoPortWriteRegisterXxx, VideoPortReadRegisterBufferXxx, and VideoPortWriteRegisterBufferXxx functions, where Xxx is Uchar, Ushort, or Ulong.
- The driver must not access addresses that are outside the range delimited by NumberOfUchars.
Every universal memory architecture (UMA) display device uses a frame buffer that is located in main memory rather than on a PCI bus. In this case, do not call VideoPortMapMemory to map the frame buffer. To map a UMA frame buffer into system space, call MmMapIoSpace.
If a miniport driver does not support an adapter that it has mapped a logical range for, it must perform two steps before it returns control to the DriverEntry function: call VideoPortFreeDeviceBase to unmap the previously mapped range from system space, and call VideoPortGetAccessRanges or VideoPortVerifyAccessRanges to release its claims on the range in the registry.
|Minimum supported client||Available in Windows 2000 and later versions of the Windows operating systems.|
|Header||video.h (include Video.h)|