Kernel32DiscardVirtualMemory(IntPtr, UInt32) Method

Discards the memory contents of a range of memory pages, without decommitting the memory.

The contents of discarded memory is undefined and must be rewritten by the application.

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 DiscardVirtualMemory(
	IntPtr address,
	uint size
)

Parameters

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

Return Value

Win32ErrorCode
Returns ERROR_SUCCESS if successful. Returns a System Error Code (Win32ErrorCode) otherwise.

Remarks

See Also