Microsoft KB Archive/819637

= Accelerated Graphics Port (AGP) memory allocation =

Article ID: 819637

Article Last Modified on 12/30/2003

-

APPLIES TO


 * Microsoft Win32 Device Driver Kit for Windows 2000
 * Microsoft Windows 2000 Professional Edition
 * Microsoft Windows 2000 Advanced Server
 * Microsoft Windows 2000 Datacenter Server

-



SUMMARY
In Microsoft Windows 2000, video miniport drivers are expected to allocate Accelerated Graphics Port (AGP) buffers at a granularity of 64 kilobytes (KB). However, if the size of the buffer is not a multiple of 64 KB, the OS may return an incorrect virtual address.



MORE INFORMATION
The following AGP functions are involved in this situation:
 * AgpCommitPhysical
 * AgpCommitVirtual
 * AgpReservePhysical
 * AgpReserveVirtual

These functions are documented in the Microsoft Windows DDK and are declared in the Videoagp.h file.

All of the functions except AgpReserveVirtual receive a number of pages as an argument. If that number of pages is not a multiple of 16 (that is, 64-KB granularity), the video port driver might return an incorrect virtual address from either AgpReserveVirtual or from AgpCommitVirtual.

To guarantee that the correct virtual address is returned, allocate buffer sizes in multiples of 16 pages.

