Share via


DkmProcess.AllocateVirtualMemory(UInt64, Int32, Int32, Int32) Method

Definition

Reserves and/or commits a region of memory within the virtual address space of the target process. The function initializes the memory it allocates to zero, unless MEM_RESET is used. For additional information, see the VirtualAlloc Win32 API in MSDN.

public:
 System::UInt64 AllocateVirtualMemory(System::UInt64 Address, int Size, int AllocationType, int PageProtection);
public:
 unsigned long long AllocateVirtualMemory(unsigned long long Address, int Size, int AllocationType, int PageProtection);
unsigned long AllocateVirtualMemory(unsigned long Address, int Size, int AllocationType, int PageProtection);
public ulong AllocateVirtualMemory (ulong Address, int Size, int AllocationType, int PageProtection);
member this.AllocateVirtualMemory : uint64 * int * int * int -> uint64
Public Function AllocateVirtualMemory (Address As ULong, Size As Integer, AllocationType As Integer, PageProtection As Integer) As ULong

Parameters

Address
UInt64

[In] Address within the target process where the memory should be committed or reserved. This value is typically zero, in which case the system chooses an address.

Size
Int32

[In] The size of the region of memory to allocate, in bytes. The system will automatically round up to the next page boundary.

AllocationType
Int32

[In] Indicates the type of allocation to perform. This is typically MEM_COMMIT | MEM_RESERVE (0x3000) which reserves and commits an allocation in one step.

PageProtection
Int32

[In] The memory protection for the region of pages to be allocated. If the pages are being committed, you can specify any one of the memory protection constants (ex: PAGE_READWRITE, PAGE_EXECUTE).

Returns

[Out] Base address of the allocated region of pages.

Applies to