The VideoPortMapBankedMemory function is obsolete, and is supported only for Windows NT 4.0 and previous drivers. Windows 2000 and later drivers must use VideoPortMapMemory.
VideoPortMapBankedMemory remaps a bus-relative physical range of video memory into the corresponding display driver's virtual address space in response to a VRP with the IoControlCode member set to IOCTL_VIDEO_SHARE_VIDEO_MEMORY or IOCTL_VIDEO_MAP_VIDEO_MEMORY.
VP_STATUS VideoPortMapBankedMemory( PVOID HwDeviceExtension, PHYSICAL_ADDRESS PhysicalAddress, PULONG Length, PULONG InIoSpace, PVOID *VirtualAddress, ULONG BankLength, UCHAR ReadWriteBank, PBANKED_SECTION_ROUTINE BankRoutine, PVOID Context );
Pointer to the miniport driver's device extension.
Specifies the bus-relative base address of the range to be mapped.
Pointer to a variable specifying the total number of bytes of device memory to be mapped (regardless of bank size). VideoPortMapBankedMemory returns the actual size of the memory mapped, which can be rounded to a system-determined alignment boundary, in this parameter. However, the miniport and display drivers cannot access memory outside the range delimited by the input value at Length.
Indicates the location of the range. This parameter can be one of the following values:
The range is in system I/O space rather than in memory space.
The range is in memory space rather than in system I/O space.
The processor aggregates a sequence of write operations and sends them to a given cache line. The processor then flushes the cache. This flag is meaningful only when VIDEO_MEMORY_SPACE_IO is not set.
Indicates that the address range specified should be mapped into user mode rather than kernel mode. This flag is meaningful only when VIDEO_MEMORY_SPACE_IO is not set.
Is a handle to the process into which the memory must be mapped, or NULL. NULL specifies that the port driver should map the logical memory range at any location in the address space of the current process. Otherwise, this handle can be a value passed in a VRP by the miniport driver's corresponding display driver. On return from a successful call, VideoPortMapBankedMemory resets the variable to the base virtual address to which it has mapped the given PhysicalAddress.
Specifies the size of a bank, in bytes.
If set to TRUE the bank is Read\Write; if set to FALSE there are two independent read and write banks.
Pointer to a driver-supplied HwVidBankedMemoryCallback function to be called by the Memory Manager when a new bank is accessed by the display driver.
Pointer to a miniport driver-supplied context that is passed back to the driver when the BankRoutine is called.
VideoPortMapBankedMemory returns NO_ERROR if the given logical range was successfully mapped to a user-space virtual range. Otherwise, it can return ERROR_INVALID_PARAMETER.
VideoPortMapBankedMemory runs in kernel mode within the same context as the user-mode thread that initiated the call.
VideoPortMapBankedMemory is called by miniport drivers to efficiently manage x86 type devices that are limited to mapping a frame buffer in banks. When this routine returns to the caller, the frame buffer managed by the miniport driver is mapped as a linear frame buffer into the address space of the requesting process (see VirtualAddress parameter). When an access is made to an address in that mapped space, the Memory Manager calls the miniport driver to update the Bank Index Register to point to a new bank that contains the currently referenced address. The Bank Index Register is maintained by the miniport driver in BankRoutine. The correct Bank Index is calculated by the Memory Manager transparently to a display driver and passed to the miniport driver in the callback to BankRoutine.
|Available in Windows 2000 and later versions of the Windows operating systems.|
Build date: 11/16/2013