Kernel32ReclaimVirtualMemory(IntPtr, IntPtr) Method

Reclaims a range of memory pages that were offered to the system with OfferVirtualMemory(IntPtr, IntPtr, OfferVirtualMemoryPriority) function.

If the offered memory has been discarded, the contents of the memory region is undefined and must be rewritten by the application.

If the offered memory has not been discarded, it is reclaimed intact.

Definition

Namespace: DevCase.Win32.NativeMethods
Assembly: DevCase.net48 (in DevCase.net48.dll) Version: 6.0.0.0 (6.0)
XMLNS for XAML: Not mapped to an xmlns.
[DllImportAttribute("Kernel32.dll", ExactSpelling = true, SetLastError = true)]
public static Win32ErrorCode ReclaimVirtualMemory(
	IntPtr address,
	IntPtr size
)

Parameters

address  IntPtr
Page-aligned starting address of the memory to reclaim.
size  IntPtr
Size, in bytes, of the memory region to reclaim. size must be an integer multiple of the system page size.

Return Value

Win32ErrorCode
Returns ERROR_SUCCESS if successful and the memory was reclaimed intact.

Returns ERROR_BUSY if successful but the memory was discarded and must be rewritten by the application. In this case, the contents of the memory region is undefined.

Returns a System Error Code (Win32ErrorCode) otherwise.

Remarks

See Also