_PageResetHandlePAddr

include vmm.inc

VMMcall _PageResetHandlePAddr, <hMem, PgOff, nPages, PhysPgNum, flags>

or eax, eax ; nonzero if substituted, zero if error

jz not_substituted


The _PageResetHandlePAddr service substitutes one or more pages in a memory block with physical pages not previously available to the system. This service is similar to the _AddFreePhysPage service, but allows memory to be used in a slightly different way.

This service is only available for Windows version 3.1 and later.

Parameters

hMem

Specifies a handle identifying a memory block. This handle must have been previously created using the _PageAllocate or _PageReAllocate service.

PgOff

Specifies the offset in pages from the start of the memory block to the first page to be substituted.

nPages

Specifies the number of pages to substitute.

PhysPgNum

Specifies the number of the first physical page to substitute into the memory block. The page number must be greater than or equal to 110h; only extended memory pages may be added to the block. The specified pages must be read/write physical memory pages, and must be available for use at any time.

flags

Specifies the operation flags. This parameter must be set to 0.

Return Value

The EAX register contains a nonzero if the service is successful. Otherwise, EAX contains zero to indicate an error, such as an invalid memory handle, an invalid range of pages, or an invalid physical page number.

Comments

This service returns an error if the sum of the PgOff and nPages parameters is greater than the size of the memory block.

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 the manage the free pool. The internal data structure is allocated during initialization and cannot be modified.

This service converts pages that are substituted into the block to fixed pages. These pages are always locked, and cannot be unlocked.

This service maps a new physical page in at the specified locations and puts the existing physical memory in the free list. The contents of the freed pages are not preserved.

Uses

EAX

See Also

_AddFreePhysPage