C# Class Platform.WindowsAPI.Kernel32

Datei anzeigen Open project: Konard/LinksPlatform

Public Methods

Method Description
CopyMemory ( void destination, void source, ulong size ) : void

Copies data of a memory block with a given size from source address to destination address. The source and destination blocks are permitted to overlap.

GetProcessHeapOrFail ( ) : IntPtr
HeapAlloc ( ulong size ) : void*

Allocates a memory block of given size. The allocated memory is automatically initialized to zero.

HeapFree ( void block ) : void

Frees a memory block.

HeapReAlloc ( void block, ulong size ) : void*

Re-allocates a memory block. If the reallocation request is for a larger size, the additional region of memory is automatically initialized to zero.

HeapSize ( void block ) : ulong

Returns the size of a memory block.

MoveMemory ( void destination, void source, ulong size ) : void

Moves a block of memory from one location to another.

VirtualAlloc ( ulong sizeInBytes, MemoryAllocationType allocationType, MemoryProtection protection ) : void*

Reserves, commits, or changes the state of a region of pages in the virtual address space of the calling process. Memory allocated by this function is automatically initialized to zero.

VirtualFree ( void block, ulong sizeInBytes, MemoryFreeType freeType ) : void

Releases, decommits, or releases and decommits a region of pages within the virtual address space of the calling process.

Private Methods

Method Description
CopyMemory ( IntPtr destinationAddress, IntPtr sourceAddress, UIntPtr sizeInBytes ) : void
GetProcessHeap ( ) : IntPtr
HeapAlloc ( IntPtr heapHandle, HeapFlags flags, UIntPtr sizeInBytes ) : IntPtr
HeapFree ( IntPtr heapHandle, HeapFlags flags, IntPtr blockAddress ) : bool
HeapReAlloc ( IntPtr heapHandle, HeapFlags flags, IntPtr blockAddress, UIntPtr sizeInBytes ) : IntPtr
HeapSize ( IntPtr heapHandle, HeapFlags flags, IntPtr blockAddress ) : UIntPtr
MoveMemory ( IntPtr destinationAddress, IntPtr sourceAddress, UIntPtr sizeInBytes ) : void
VirtualAlloc ( IntPtr blockAddress, UIntPtr sizeInBytes, MemoryAllocationType allocationType, MemoryProtection protection ) : IntPtr
VirtualFree ( IntPtr blockAddress, UIntPtr sizeInBytes, MemoryFreeType freeType ) : bool

Method Details

CopyMemory() public static method

Copies data of a memory block with a given size from source address to destination address. The source and destination blocks are permitted to overlap.
public static CopyMemory ( void destination, void source, ulong size ) : void
destination void The pointer to destination where a memory block will be copied.
source void The pointer to a source memory block.
size ulong The size of a memory block.
return void

GetProcessHeapOrFail() public static method

public static GetProcessHeapOrFail ( ) : IntPtr
return System.IntPtr

HeapAlloc() public static method

Allocates a memory block of given size. The allocated memory is automatically initialized to zero.
public static HeapAlloc ( ulong size ) : void*
size ulong The size of a memory block.
return void*

HeapFree() public static method

Frees a memory block.
public static HeapFree ( void block ) : void
block void The pointer to a memory block to be freed.
return void

HeapReAlloc() public static method

Re-allocates a memory block. If the reallocation request is for a larger size, the additional region of memory is automatically initialized to zero.
public static HeapReAlloc ( void block, ulong size ) : void*
block void The pointer to a memory block.
size ulong The size (bytes) of a memory block.
return void*

HeapSize() public static method

Returns the size of a memory block.
public static HeapSize ( void block ) : ulong
block void The pointer to a memory block.
return ulong

MoveMemory() public static method

Moves a block of memory from one location to another.
public static MoveMemory ( void destination, void source, ulong size ) : void
destination void The pointer to destination where a memory block will be moved.
source void The pointer to a source memory block.
size ulong The size of a memory block.
return void

VirtualAlloc() public static method

Reserves, commits, or changes the state of a region of pages in the virtual address space of the calling process. Memory allocated by this function is automatically initialized to zero.
public static VirtualAlloc ( ulong sizeInBytes, MemoryAllocationType allocationType, MemoryProtection protection ) : void*
sizeInBytes ulong The size of the region, in bytes
allocationType MemoryAllocationType The type of memory allocation.
protection MemoryProtection The memory protection for the region of pages to be allocated.
return void*

VirtualFree() public static method

Releases, decommits, or releases and decommits a region of pages within the virtual address space of the calling process.
public static VirtualFree ( void block, ulong sizeInBytes, MemoryFreeType freeType ) : void
block void A pointer to the base address of the region of pages to be freed.
sizeInBytes ulong The size of the region of memory to be freed, in bytes.
freeType MemoryFreeType The type of free operation.
return void