PVOID VideoPortGetDeviceBase(
PVOID HwDeviceExtension, | |
PHYSICAL_ADDRESS IoAddress, | |
ULONG NumberOfUchars, | |
UCHAR InIoSpace | |
); |
VideoPortGetDeviceBase maps a range of bus-relative device memory or I/O addresses into the system (kernel) address space.
VideoPortGetDeviceBase returns a mapped logical base address suitable for use with the VideoPortReadXxx, VideoPortWriteXxx, and all VideoPort..Memory functions except VideoPortMapMemory and VideoPortUnmapMemory. If the given bus-relative range cannot be mapped, it returns NULL.
After VideoPortGetDeviceBase has performed the mapping, the miniport driver can communicate with its adapter by calling the VideoPortRead/WriteXxx functions, using the mapped logical addresses. A miniport driver also must use mapped logical addresses to call VideoPortCompareMemory, VideoPortMoveMemory, VideoPortZeroDeviceMemory, and VideoPortZeroMemory. VideoPortGetDeviceBase must be called from the miniport’s HwVidFindAdapter, HwVidQueryDeviceCallback, or HwVidQueryNamedValueCallback function.
The mapped base address returned by VideoPortGetDeviceBase and length of the mapped access range should be stored in the HwDeviceExtension for later use before HwVidFindAdapter returns control.
Access to the mapped address space must follow these rules:
If a miniport driver finds that it does not support an adapter for which it has mapped a logical range, it must call VideoPortFreeDeviceBase to unmap the previously mapped range from the system address space, and release its claims on the range in the registry with VideoPortGetAccessRanges or VideoPortVerifyAccessRanges, before it returns control to the DriverEntry function.
HwVidFindAdapter, HwVidQueryDeviceCallback, HwVidQueryNamedValueCallback, VideoPortCompareMemory, VideoPortFreeDeviceBase, VideoPortGetAccessRanges, VideoPortGetBusData, VideoPortGetDeviceData, VideoPortGetRegistryParameters, VideoPortMoveMemory, VideoPortReadXxx, VideoPortVerifyAccessRanges, VideoPortWriteXxx, VideoPortZeroDeviceMemory, VideoPortZeroMemory