_ModifyPageBits


include vmm.inc

VMMcall _ModifyPageBits, <VM, VMLinPgNum, nPages, bitAND, bitOR, pType, flags>

or      eax, eax            ; nonzero if modified, zero if error
jz      not_modified

Modifies the page attribute bits for pages in the V86 address space of a virtual machine. Virtual devices use this service to modify page permissions, or to mark a hooked page as not present. Uses EAX, ECX, EDX, and Flags.

VM

Handle of the virtual machine owning the pages to modify.

VMLinPgNum

Linear page number of the first page to modify. All pages must be in the 1 megabyte V86 address space. Page numbers below the first page of the specified virtual machine or above 10Fh cause an error.

nPages

Number of pages to modify.

bitAND

AND mask for the page attribute bits. All bits except P_PRES, P_WRITE, and P_USER must be one. The P_PRES, P_WRITE, and P_USER bits can be zero or one to clear or preserve the corresponding page attributes.

bitOR

OR mask for the page attribute bits. All bits except P_PRES and P_WRITE must be zero. The P_PRES and P_WRITE bits can be 0 or 1 to preserve or set the corresponding page attributes.

pType

Page type. This parameter can be be either PG_IGNORE or PG_HOOKED, but must be PG_HOOKED if the P_PRES bit of the bitAND parameter is zero. This parameter has no real effect.

flags

Operation flags. Must be zero.

This service always clears the P_DIRTY and P_ACC bits regardless of the AND and OR mask values.

This service can be used to mark a range of pages as not present (clear the P_PRES bit). In this case, fault handlers must have been previously installed for the specified pages using the Hook_V86_Page service, and the pType parameter must be PG_HOOKED.

This service cannot be used to set the P_PRES bit. Use the _MapIntoV86 or _PhysIntoV86 service to make pages present.

If using the P_WRITE bit to simulate ROM in a virtual machine, a virtual device should map the pages using the _PhysIntoV86 service and immediately call the _ModifyPageBits service to clear the P_WRITE bit.

See also Hook_V86_Page, _MapIntoV86, _PhysIntoV86