_PageGetSizeAddr

include vmm.inc

VMMcall _PageGetSizeAddr, <hMem, flags>

mov ecx, eax ; zero in eax and edx if error

or ecx, edx

jz error

mov [Pages], eax ; number of pages in memory block

mov [Address], edx ; ring-0 linear address of memory block


The _PageGetSizeAddr service returns the size and linear address of an existing block of memory.

Parameters

hMem

Specifies a handle identifying the memory block for which to return information. This handle must have been previously created using the _PageAllocate or _PageReAllocate service.

flags

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

Return Value

The EAX register contains the number of pages in the memory block, and EDX register contains the ring-0 linear address of the memory block. The EAX and EDX registers both contain zero to indicate an error, such as an invalid memory handle.

Comments

The returned number of pages specifies the total size of the block, not just the number of pages currently present.

Uses

EAX, EDX

See Also

_PageAllocate, _PageReAllocate