include vmm.inc VMMcall _AddFreePhysPage, <PhysPgNum, nPages, flags> mov [PagesAdded], eax ; 0 = none, 1 = some, 2 = all |
The _AddFreePhysPage service adds one or more physical pages to the free memory pool. Virtual devices use this service to add pages that the Windows loader could not find, but that the virtual device did find. For example, the V86MMGR device adds any unused physical pages it finds when using the Global EMM Import function of a 386 LIMulator.
This service is only available during initialization, and only in Windows version 3.1 and later.
PhysPgNum
Specifies the physical page number of the first page to add. The page number must be greater than or equal to 110h; only extended memory pages may be added to the pool. The specified pages must be read/write physical memory pages, and must be available for use at any time.
nPages
Specifies the number of physical pages to add.
flags
Specifies the operation flags. This parameter must be set to 0.
The EAX register contains one of the following values:
Value | Meaning |
0 | None of the specified physical pages were added to the free pool. |
1 | Some, but not all, of the specified physical pages were added. |
2 | All of the specified physical pages were added. |
A virtual device must not attempt to use pages once it has added them to the free pool, or attempt to add pages that are already available to the system.
This service returns an error if the number of pages to add exceeds the limit of the internal data structure the system uses to manage the free pool. The internal data structure is allocated during initialization and cannot be modified.
EAX