include vmm.inc
VMMCall _PageLock, <hMem, nPages, PageOff, flags>
or eax, eax ; nonzero if locked, zero if error
jz not_locked
Locks one or more pages in the specified memory block. Uses EAX, ECX, EDX, and Flags.
If the PAGELOCKEDIFDP value is specified, pages are locked only if the virtual swap device uses MS-DOS or BIOS functions to write pages to the hardware. The PAGELOCKEDIFDP value cannot be used until after the Init_Complete message has been processed.
The _LinPageLock service is the preferred method of locking pages.
This service returns an error if the sum of the PageOff and nPages parameters is greater than the number of pages in the memory block.
This service has no effect on memory blocks allocated using the PAGEFIXED value; such memory is always locked.
Virtual devices must not assume that the requested number of pages can always be locked.
Each page in a memory block has an individual lock count. This service increments the lock count each time the page is locked, and decrements the count each time the page is unlocked. The lock count must be zero for the page to be unlocked. This means that if the handle is locked 5 times, it has to be unlocked 5 times. Virtual devices must not leave handles locked when not needed.
_PageAllocate, _PageUnLock