#include <vmm.h> ULONG EXTERNAL _PageCommit(ULONG page, ULONG npages, ULONG hpd, ULONG pagerdata, ULONG flags);
Commits physical pages to a range of linear addresses.
page and npages
Linear page number to commit the first physical page to, and the number of pages to commit. The entire range of linear addresses must have been previously reserved by a single call to the _PageReserve service.
hpd
Handle of a registered pager (returned by the _PagerRegister service) or one of these values:
PD_ZEROINIT | Swappable zero-initialized. |
PD_NOINIT | Swappable uninitialized. |
PD_FIXED | Fixed uninitialized (must also pass in PC_FIXED flag). |
PD_FIXEDZERO | Fixed zero-initialized (must also pass in PC_FIXED flag). |
pagerdata
A pager-defined 32-bit value to be stored with the page. Must be zero if the hpd parameter does not identify a registered pager.
flags
One or more of the following values:
PC_FIXED | The pages are permanently locked. If you know that the memory will remained locked throughout its lifetime, it is more efficient to use PC_FIXED than PC_LOCKED. |
PC_LOCKED | The pages are initially present and locked, but may be unlocked in the future. |
PC_LOCKEDIFDP | The pages are locked only if the virtual pageswap device uses MS-DOS or BIOS functions to write pages to the hardware. (Note that in such a case, the pages are locked and not fixed.) |
PC_STATIC | The pages are committed even if the linear addresses were reserved using the PR_STATIC flag. If the linear address had been reserved with PR_STATIC and the PC_STATIC flag is not passed to _PageCommit, the function will fail. |
PC_USER | The pages are accessible at ring 3. |
PC_WRITEABLE | The pages are writeable. |
PC_INCR | Increments the pager-defined 32-bit value associated with each page in the specified range. |
If the PC_LOCKED, PC_LOCKEDIFDP, or PC_FIXED flag is specified, none of the pages in the range of linear addresses specified by the page and npages parameters can already be committed. If none of these flags are specified, the range can include committed pages; however, recommitting already-committed pages is inefficient and should be avoided.
See also _PagerRegister, _PageReserve