VirtualAllocExNuma
関数シグネチャ
// KERNEL32.dll
#include <windows.h>
void* VirtualAllocExNuma(
HANDLE hProcess,
void* lpAddress, // optional
UINT_PTR dwSize,
VIRTUAL_ALLOCATION_TYPE flAllocationType,
DWORD flProtect,
DWORD nndPreferred
);パラメーター
| 名前 | 型 | 方向 | 説明 | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| hProcess | HANDLE | in | プロセスのハンドル。関数はこのプロセスの仮想アドレス空間内にメモリを割り当てます。 ハンドルには PROCESS_VM_OPERATION アクセス権が必要です。詳細については、 | ||||||||||||||||||
| lpAddress | void* | inoptional | 割り当てたいページ領域の希望する開始アドレスを指定するポインター。 メモリを予約する場合、関数はこのアドレスを割り当て単位の最も近い倍数まで切り下げます。 既に予約済みのメモリをコミットする場合、関数はこのアドレスを最も近いページ境界まで切り下げます。ホストコンピューター上のページサイズと割り当て単位を取得するには、 GetSystemInfo 関数を使用します。 lpAddress が NULL の場合、関数が領域を割り当てる場所を決定します。 | ||||||||||||||||||
| dwSize | UINT_PTR | in | 割り当てるメモリ領域のサイズ(バイト単位)。 lpAddress が NULL の場合、関数は dwSize を次のページ境界まで切り上げます。 lpAddress が NULL でない場合、関数は
lpAddress から
| ||||||||||||||||||
| flAllocationType | VIRTUAL_ALLOCATION_TYPE | in | メモリ割り当ての種類。このパラメーターには次のいずれかの値を含める必要があります。
このパラメーターには、次の値を指定することもできます。
| ||||||||||||||||||
| flProtect | DWORD | in | 割り当てるページ領域のメモリ保護。ページをコミットする場合は、 メモリ保護定数のいずれかを指定できます。 ページを保護する際に指定する保護属性は、ページを割り当てる際に指定したものと矛盾してはなりません。 | ||||||||||||||||||
| nndPreferred | DWORD | in | 物理メモリを配置すべき NUMA ノード。 新しい VA 領域を割り当てる場合(コミット済みまたは予約済みのいずれか)にのみ使用されます。それ以外の場合、API を使用して既存の領域内のページをコミットするときには、このパラメーターは無視されます。 |
戻り値の型: void*
公式ドキュメント
指定したプロセスの仮想アドレス空間内にあるメモリ領域を予約、コミット、または状態変更し、物理メモリの NUMA ノードを指定します。
戻り値
関数が成功した場合、戻り値は割り当てられたページ領域の基底アドレスです。
関数が失敗した場合、戻り値は NULL です。拡張エラー情報を取得するには、GetLastError を呼び出します。
解説(Remarks)
各ページには ページ状態が関連付けられています。 VirtualAllocExNuma 関数は次の操作を実行できます。
- 予約済みページの領域をコミットする
- 空きページの領域を予約する
- 空きページの領域の予約とコミットを同時に行う
VirtualAllocExNuma は、予約済みページを予約することはできません。既にコミット済みのページをコミットすることはできます。つまり、ページが既にコミットされているかどうかにかかわらずページ範囲をコミットでき、関数は失敗しません。
VirtualAllocExNuma を使用してページブロックを予約し、その後 VirtualAllocExNuma を追加で呼び出して予約済みブロックから個々のページをコミットできます。これにより、プロセスは必要になるまで物理ストレージを消費することなく仮想アドレス空間の範囲を予約できます。
lpAddress パラメーターが NULL でない場合、関数は lpAddress と dwSize パラメーターを使用して割り当てるページ領域を計算します。ページ範囲全体の現在の状態は、flAllocationType パラメーターで指定された割り当ての種類と互換性がなければなりません。そうでない場合、関数は失敗し、いずれのページも割り当てられません。この互換性要件は、既にコミット済みのページをコミットすることを妨げるものではありません。前述のリストを参照してください。
VirtualAllocExNuma は物理ページを一切割り当てないため、ページが当該ノードまたはシステム内の他の場所で利用可能であるかどうかにかかわらず成功します。物理ページはオンデマンドで割り当てられます。優先ノードのページが枯渇した場合、メモリマネージャーは他のノードのページを使用します。メモリがページアウトされた場合、再びページインされるときにも同じ処理が行われます。
動的に生成されたコードを実行するには、 VirtualAllocExNuma を使用してメモリを割り当て、 VirtualProtectEx 関数を使用して PAGE_EXECUTE アクセスを付与します。
VirtualAllocExNuma 関数を使用すると、指定したプロセスの仮想アドレス空間内に Address Windowing Extensions(AWE)メモリ領域を予約できます。このメモリ領域は、アプリケーションの必要に応じて物理ページを仮想メモリへマップしたりマップ解除したりするために使用できます。AllocationType パラメーターには MEM_PHYSICAL と MEM_RESERVE の値を設定する必要があります。MEM_COMMIT 値は設定してはなりません。ページ保護は PAGE_READWRITE に設定する必要があります。
VirtualFreeEx 関数は、コミット済みページをデコミットしてそのページのストレージを解放したり、コミット済みページのデコミットと解放を同時に行ったりできます。また、予約済みページを解放して空きページにすることもできます。
この関数を使用するアプリケーションをコンパイルするには、_WIN32_WINNT を 0x0600 以降として定義します。
例
例については、 Allocating Memory from a NUMA Node を参照してください。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での呼び出し定義
// KERNEL32.dll
#include <windows.h>
void* VirtualAllocExNuma(
HANDLE hProcess,
void* lpAddress, // optional
UINT_PTR dwSize,
VIRTUAL_ALLOCATION_TYPE flAllocationType,
DWORD flProtect,
DWORD nndPreferred
);[DllImport("KERNEL32.dll", SetLastError = true, ExactSpelling = true)]
static extern IntPtr VirtualAllocExNuma(
IntPtr hProcess, // HANDLE
IntPtr lpAddress, // void* optional
UIntPtr dwSize, // UINT_PTR
uint flAllocationType, // VIRTUAL_ALLOCATION_TYPE
uint flProtect, // DWORD
uint nndPreferred // DWORD
);<DllImport("KERNEL32.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function VirtualAllocExNuma(
hProcess As IntPtr, ' HANDLE
lpAddress As IntPtr, ' void* optional
dwSize As UIntPtr, ' UINT_PTR
flAllocationType As UInteger, ' VIRTUAL_ALLOCATION_TYPE
flProtect As UInteger, ' DWORD
nndPreferred As UInteger ' DWORD
) As IntPtr
End Function' hProcess : HANDLE
' lpAddress : void* optional
' dwSize : UINT_PTR
' flAllocationType : VIRTUAL_ALLOCATION_TYPE
' flProtect : DWORD
' nndPreferred : DWORD
Declare PtrSafe Function VirtualAllocExNuma Lib "kernel32" ( _
ByVal hProcess As LongPtr, _
ByVal lpAddress As LongPtr, _
ByVal dwSize As LongPtr, _
ByVal flAllocationType As Long, _
ByVal flProtect As Long, _
ByVal nndPreferred As Long) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
VirtualAllocExNuma = ctypes.windll.kernel32.VirtualAllocExNuma
VirtualAllocExNuma.restype = ctypes.c_void_p
VirtualAllocExNuma.argtypes = [
wintypes.HANDLE, # hProcess : HANDLE
ctypes.POINTER(None), # lpAddress : void* optional
ctypes.c_size_t, # dwSize : UINT_PTR
wintypes.DWORD, # flAllocationType : VIRTUAL_ALLOCATION_TYPE
wintypes.DWORD, # flProtect : DWORD
wintypes.DWORD, # nndPreferred : DWORD
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('KERNEL32.dll')
VirtualAllocExNuma = Fiddle::Function.new(
lib['VirtualAllocExNuma'],
[
Fiddle::TYPE_VOIDP, # hProcess : HANDLE
Fiddle::TYPE_VOIDP, # lpAddress : void* optional
Fiddle::TYPE_UINTPTR_T, # dwSize : UINT_PTR
-Fiddle::TYPE_INT, # flAllocationType : VIRTUAL_ALLOCATION_TYPE
-Fiddle::TYPE_INT, # flProtect : DWORD
-Fiddle::TYPE_INT, # nndPreferred : DWORD
],
Fiddle::TYPE_VOIDP)#[link(name = "kernel32")]
extern "system" {
fn VirtualAllocExNuma(
hProcess: *mut core::ffi::c_void, // HANDLE
lpAddress: *mut (), // void* optional
dwSize: usize, // UINT_PTR
flAllocationType: u32, // VIRTUAL_ALLOCATION_TYPE
flProtect: u32, // DWORD
nndPreferred: u32 // DWORD
) -> *mut ();
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("KERNEL32.dll", SetLastError = true)]
public static extern IntPtr VirtualAllocExNuma(IntPtr hProcess, IntPtr lpAddress, UIntPtr dwSize, uint flAllocationType, uint flProtect, uint nndPreferred);
"@
$api = Add-Type -MemberDefinition $sig -Name 'KERNEL32_VirtualAllocExNuma' -Namespace Win32 -PassThru
# $api::VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)#uselib "KERNEL32.dll"
#func global VirtualAllocExNuma "VirtualAllocExNuma" sptr, sptr, sptr, sptr, sptr, sptr
; VirtualAllocExNuma hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred ; 戻り値は stat
; hProcess : HANDLE -> "sptr"
; lpAddress : void* optional -> "sptr"
; dwSize : UINT_PTR -> "sptr"
; flAllocationType : VIRTUAL_ALLOCATION_TYPE -> "sptr"
; flProtect : DWORD -> "sptr"
; nndPreferred : DWORD -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "KERNEL32.dll"
#cfunc global VirtualAllocExNuma "VirtualAllocExNuma" sptr, sptr, sptr, int, int, int
; res = VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)
; hProcess : HANDLE -> "sptr"
; lpAddress : void* optional -> "sptr"
; dwSize : UINT_PTR -> "sptr"
; flAllocationType : VIRTUAL_ALLOCATION_TYPE -> "int"
; flProtect : DWORD -> "int"
; nndPreferred : DWORD -> "int"; void* VirtualAllocExNuma(HANDLE hProcess, void* lpAddress, UINT_PTR dwSize, VIRTUAL_ALLOCATION_TYPE flAllocationType, DWORD flProtect, DWORD nndPreferred)
#uselib "KERNEL32.dll"
#cfunc global VirtualAllocExNuma "VirtualAllocExNuma" intptr, intptr, intptr, int, int, int
; res = VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)
; hProcess : HANDLE -> "intptr"
; lpAddress : void* optional -> "intptr"
; dwSize : UINT_PTR -> "intptr"
; flAllocationType : VIRTUAL_ALLOCATION_TYPE -> "int"
; flProtect : DWORD -> "int"
; nndPreferred : DWORD -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
kernel32 = windows.NewLazySystemDLL("KERNEL32.dll")
procVirtualAllocExNuma = kernel32.NewProc("VirtualAllocExNuma")
)
// hProcess (HANDLE), lpAddress (void* optional), dwSize (UINT_PTR), flAllocationType (VIRTUAL_ALLOCATION_TYPE), flProtect (DWORD), nndPreferred (DWORD)
r1, _, err := procVirtualAllocExNuma.Call(
uintptr(hProcess),
uintptr(lpAddress),
uintptr(dwSize),
uintptr(flAllocationType),
uintptr(flProtect),
uintptr(nndPreferred),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // void*function VirtualAllocExNuma(
hProcess: THandle; // HANDLE
lpAddress: Pointer; // void* optional
dwSize: NativeUInt; // UINT_PTR
flAllocationType: DWORD; // VIRTUAL_ALLOCATION_TYPE
flProtect: DWORD; // DWORD
nndPreferred: DWORD // DWORD
): Pointer; stdcall;
external 'KERNEL32.dll' name 'VirtualAllocExNuma';result := DllCall("KERNEL32\VirtualAllocExNuma"
, "Ptr", hProcess ; HANDLE
, "Ptr", lpAddress ; void* optional
, "UPtr", dwSize ; UINT_PTR
, "UInt", flAllocationType ; VIRTUAL_ALLOCATION_TYPE
, "UInt", flProtect ; DWORD
, "UInt", nndPreferred ; DWORD
, "Ptr") ; return: void*●VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred) = DLL("KERNEL32.dll", "void* VirtualAllocExNuma(void*, void*, int, dword, dword, dword)")
# 呼び出し: VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)
# hProcess : HANDLE -> "void*"
# lpAddress : void* optional -> "void*"
# dwSize : UINT_PTR -> "int"
# flAllocationType : VIRTUAL_ALLOCATION_TYPE -> "dword"
# flProtect : DWORD -> "dword"
# nndPreferred : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "kernel32" fn VirtualAllocExNuma(
hProcess: ?*anyopaque, // HANDLE
lpAddress: ?*anyopaque, // void* optional
dwSize: usize, // UINT_PTR
flAllocationType: u32, // VIRTUAL_ALLOCATION_TYPE
flProtect: u32, // DWORD
nndPreferred: u32 // DWORD
) callconv(std.os.windows.WINAPI) ?*anyopaque;proc VirtualAllocExNuma(
hProcess: pointer, # HANDLE
lpAddress: pointer, # void* optional
dwSize: uint, # UINT_PTR
flAllocationType: uint32, # VIRTUAL_ALLOCATION_TYPE
flProtect: uint32, # DWORD
nndPreferred: uint32 # DWORD
): pointer {.importc: "VirtualAllocExNuma", stdcall, dynlib: "KERNEL32.dll".}pragma(lib, "kernel32");
extern(Windows)
void* VirtualAllocExNuma(
void* hProcess, // HANDLE
void* lpAddress, // void* optional
size_t dwSize, // UINT_PTR
uint flAllocationType, // VIRTUAL_ALLOCATION_TYPE
uint flProtect, // DWORD
uint nndPreferred // DWORD
);ccall((:VirtualAllocExNuma, "KERNEL32.dll"), stdcall, Ptr{Cvoid},
(Ptr{Cvoid}, Ptr{Cvoid}, Csize_t, UInt32, UInt32, UInt32),
hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)
# hProcess : HANDLE -> Ptr{Cvoid}
# lpAddress : void* optional -> Ptr{Cvoid}
# dwSize : UINT_PTR -> Csize_t
# flAllocationType : VIRTUAL_ALLOCATION_TYPE -> UInt32
# flProtect : DWORD -> UInt32
# nndPreferred : DWORD -> UInt32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
void* VirtualAllocExNuma(
void* hProcess,
void* lpAddress,
uintptr_t dwSize,
uint32_t flAllocationType,
uint32_t flProtect,
uint32_t nndPreferred);
]]
local kernel32 = ffi.load("kernel32")
-- kernel32.VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)
-- hProcess : HANDLE
-- lpAddress : void* optional
-- dwSize : UINT_PTR
-- flAllocationType : VIRTUAL_ALLOCATION_TYPE
-- flProtect : DWORD
-- nndPreferred : DWORD
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('KERNEL32.dll');
const VirtualAllocExNuma = lib.func('__stdcall', 'VirtualAllocExNuma', 'void *', ['void *', 'void *', 'uintptr_t', 'uint32_t', 'uint32_t', 'uint32_t']);
// VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)
// hProcess : HANDLE -> 'void *'
// lpAddress : void* optional -> 'void *'
// dwSize : UINT_PTR -> 'uintptr_t'
// flAllocationType : VIRTUAL_ALLOCATION_TYPE -> 'uint32_t'
// flProtect : DWORD -> 'uint32_t'
// nndPreferred : DWORD -> 'uint32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("KERNEL32.dll", {
VirtualAllocExNuma: { parameters: ["pointer", "pointer", "usize", "u32", "u32", "u32"], result: "pointer" },
});
// lib.symbols.VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred)
// hProcess : HANDLE -> "pointer"
// lpAddress : void* optional -> "pointer"
// dwSize : UINT_PTR -> "usize"
// flAllocationType : VIRTUAL_ALLOCATION_TYPE -> "u32"
// flProtect : DWORD -> "u32"
// nndPreferred : DWORD -> "u32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void* VirtualAllocExNuma(
void* hProcess,
void* lpAddress,
size_t dwSize,
uint32_t flAllocationType,
uint32_t flProtect,
uint32_t nndPreferred);
C, "KERNEL32.dll");
// $ffi->VirtualAllocExNuma(hProcess, lpAddress, dwSize, flAllocationType, flProtect, nndPreferred);
// hProcess : HANDLE
// lpAddress : void* optional
// dwSize : UINT_PTR
// flAllocationType : VIRTUAL_ALLOCATION_TYPE
// flProtect : DWORD
// nndPreferred : DWORD
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Kernel32 extends StdCallLibrary {
Kernel32 INSTANCE = Native.load("kernel32", Kernel32.class);
Pointer VirtualAllocExNuma(
Pointer hProcess, // HANDLE
Pointer lpAddress, // void* optional
long dwSize, // UINT_PTR
int flAllocationType, // VIRTUAL_ALLOCATION_TYPE
int flProtect, // DWORD
int nndPreferred // DWORD
);
}@[Link("kernel32")]
lib LibKERNEL32
fun VirtualAllocExNuma = VirtualAllocExNuma(
hProcess : Void*, # HANDLE
lpAddress : Void*, # void* optional
dwSize : LibC::SizeT, # UINT_PTR
flAllocationType : UInt32, # VIRTUAL_ALLOCATION_TYPE
flProtect : UInt32, # DWORD
nndPreferred : UInt32 # DWORD
) : Void*
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef VirtualAllocExNumaNative = Pointer<Void> Function(Pointer<Void>, Pointer<Void>, UintPtr, Uint32, Uint32, Uint32);
typedef VirtualAllocExNumaDart = Pointer<Void> Function(Pointer<Void>, Pointer<Void>, int, int, int, int);
final VirtualAllocExNuma = DynamicLibrary.open('KERNEL32.dll')
.lookupFunction<VirtualAllocExNumaNative, VirtualAllocExNumaDart>('VirtualAllocExNuma');
// hProcess : HANDLE -> Pointer<Void>
// lpAddress : void* optional -> Pointer<Void>
// dwSize : UINT_PTR -> UintPtr
// flAllocationType : VIRTUAL_ALLOCATION_TYPE -> Uint32
// flProtect : DWORD -> Uint32
// nndPreferred : DWORD -> Uint32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function VirtualAllocExNuma(
hProcess: THandle; // HANDLE
lpAddress: Pointer; // void* optional
dwSize: NativeUInt; // UINT_PTR
flAllocationType: DWORD; // VIRTUAL_ALLOCATION_TYPE
flProtect: DWORD; // DWORD
nndPreferred: DWORD // DWORD
): Pointer; stdcall;
external 'KERNEL32.dll' name 'VirtualAllocExNuma';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "VirtualAllocExNuma"
c_VirtualAllocExNuma :: Ptr () -> Ptr () -> CUIntPtr -> Word32 -> Word32 -> Word32 -> IO (Ptr ())
-- hProcess : HANDLE -> Ptr ()
-- lpAddress : void* optional -> Ptr ()
-- dwSize : UINT_PTR -> CUIntPtr
-- flAllocationType : VIRTUAL_ALLOCATION_TYPE -> Word32
-- flProtect : DWORD -> Word32
-- nndPreferred : DWORD -> Word32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let virtualallocexnuma =
foreign "VirtualAllocExNuma"
((ptr void) @-> (ptr void) @-> size_t @-> uint32_t @-> uint32_t @-> uint32_t @-> returning (ptr void))
(* hProcess : HANDLE -> (ptr void) *)
(* lpAddress : void* optional -> (ptr void) *)
(* dwSize : UINT_PTR -> size_t *)
(* flAllocationType : VIRTUAL_ALLOCATION_TYPE -> uint32_t *)
(* flProtect : DWORD -> uint32_t *)
(* nndPreferred : DWORD -> uint32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library kernel32 (t "KERNEL32.dll"))
(cffi:use-foreign-library kernel32)
(cffi:defcfun ("VirtualAllocExNuma" virtual-alloc-ex-numa :convention :stdcall) :pointer
(h-process :pointer) ; HANDLE
(lp-address :pointer) ; void* optional
(dw-size :uint64) ; UINT_PTR
(fl-allocation-type :uint32) ; VIRTUAL_ALLOCATION_TYPE
(fl-protect :uint32) ; DWORD
(nnd-preferred :uint32)) ; DWORD
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $VirtualAllocExNuma = Win32::API::More->new('KERNEL32',
'LPVOID VirtualAllocExNuma(HANDLE hProcess, LPVOID lpAddress, WPARAM dwSize, DWORD flAllocationType, DWORD flProtect, DWORD nndPreferred)');
# my $ret = $VirtualAllocExNuma->Call($hProcess, $lpAddress, $dwSize, $flAllocationType, $flProtect, $nndPreferred);
# hProcess : HANDLE -> HANDLE
# lpAddress : void* optional -> LPVOID
# dwSize : UINT_PTR -> WPARAM
# flAllocationType : VIRTUAL_ALLOCATION_TYPE -> DWORD
# flProtect : DWORD -> DWORD
# nndPreferred : DWORD -> DWORD
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
- f VirtualAllocEx — 指定プロセスの仮想アドレス空間にメモリ領域を予約またはコミットする。
- f VirtualFreeEx — 指定プロセスの仮想メモリ領域を解放または解放予約する。
- f VirtualLock — 指定範囲のメモリを物理メモリにロックしページングを防ぐ。
- f VirtualProtect — 仮想メモリ領域のアクセス保護属性を変更する。
- f VirtualQuery — 仮想アドレス空間のメモリ領域情報を取得する。