IDkmVirtualMemoryAllocator.AllocateVirtualMemory 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(Microsoft::VisualStudio::Debugger::DkmProcess ^ process, System::UInt64 address, int size, int allocationType, int pageProtection);
public ulong AllocateVirtualMemory (Microsoft.VisualStudio.Debugger.DkmProcess process, ulong address, int size, int allocationType, int pageProtection);
abstract member AllocateVirtualMemory : Microsoft.VisualStudio.Debugger.DkmProcess * uint64 * int * int * int -> uint64
Public Function AllocateVirtualMemory (process As DkmProcess, address As ULong, size As Integer, allocationType As Integer, pageProtection As Integer) As ULong

Parameters

process
DkmProcess

[In] DkmProcess represents a target process which is being debugged. The debugger debugs processes, so this is the basic unit of debugging. A DkmProcess can represent a system process or a virtual process such as minidumps.

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