Win32 API 日本語リファレンス
ホームSystem.Memory › GetMemoryNumaPerformanceInformation

GetMemoryNumaPerformanceInformation

関数
指定NUMAノードのメモリ性能情報を取得する。
DLLapi-ms-win-core-memory-l1-1-9.dll呼出規約winapi

シグネチャ

// api-ms-win-core-memory-l1-1-9.dll
#include <windows.h>

BOOL GetMemoryNumaPerformanceInformation(
    DWORD NodeNumber,
    BYTE DataType,
    WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** PerfInfo
);

パラメーター

名前方向
NodeNumberDWORDin
DataTypeBYTEin
PerfInfoWIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT**out

戻り値の型: BOOL

各言語での呼び出し定義

// api-ms-win-core-memory-l1-1-9.dll
#include <windows.h>

BOOL GetMemoryNumaPerformanceInformation(
    DWORD NodeNumber,
    BYTE DataType,
    WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** PerfInfo
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-memory-l1-1-9.dll", ExactSpelling = true)]
static extern bool GetMemoryNumaPerformanceInformation(
    uint NodeNumber,   // DWORD
    byte DataType,   // BYTE
    IntPtr PerfInfo   // WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
);
<DllImport("api-ms-win-core-memory-l1-1-9.dll", ExactSpelling:=True)>
Public Shared Function GetMemoryNumaPerformanceInformation(
    NodeNumber As UInteger,   ' DWORD
    DataType As Byte,   ' BYTE
    PerfInfo As IntPtr   ' WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
) As Boolean
End Function
' NodeNumber : DWORD
' DataType : BYTE
' PerfInfo : WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
Declare PtrSafe Function GetMemoryNumaPerformanceInformation Lib "api-ms-win-core-memory-l1-1-9" ( _
    ByVal NodeNumber As Long, _
    ByVal DataType As Byte, _
    ByVal PerfInfo As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

GetMemoryNumaPerformanceInformation = ctypes.windll.LoadLibrary("api-ms-win-core-memory-l1-1-9.dll").GetMemoryNumaPerformanceInformation
GetMemoryNumaPerformanceInformation.restype = wintypes.BOOL
GetMemoryNumaPerformanceInformation.argtypes = [
    wintypes.DWORD,  # NodeNumber : DWORD
    ctypes.c_ubyte,  # DataType : BYTE
    ctypes.c_void_p,  # PerfInfo : WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('api-ms-win-core-memory-l1-1-9.dll')
GetMemoryNumaPerformanceInformation = Fiddle::Function.new(
  lib['GetMemoryNumaPerformanceInformation'],
  [
    -Fiddle::TYPE_INT,  # NodeNumber : DWORD
    -Fiddle::TYPE_CHAR,  # DataType : BYTE
    Fiddle::TYPE_VOIDP,  # PerfInfo : WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
  ],
  Fiddle::TYPE_INT)
#[link(name = "api-ms-win-core-memory-l1-1-9")]
extern "system" {
    fn GetMemoryNumaPerformanceInformation(
        NodeNumber: u32,  // DWORD
        DataType: u8,  // BYTE
        PerfInfo: *mut *mut WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT  // WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("api-ms-win-core-memory-l1-1-9.dll")]
public static extern bool GetMemoryNumaPerformanceInformation(uint NodeNumber, byte DataType, IntPtr PerfInfo);
"@
$api = Add-Type -MemberDefinition $sig -Name 'api-ms-win-core-memory-l1-1-9_GetMemoryNumaPerformanceInformation' -Namespace Win32 -PassThru
# $api::GetMemoryNumaPerformanceInformation(NodeNumber, DataType, PerfInfo)
#uselib "api-ms-win-core-memory-l1-1-9.dll"
#func global GetMemoryNumaPerformanceInformation "GetMemoryNumaPerformanceInformation" sptr, sptr, sptr
; GetMemoryNumaPerformanceInformation NodeNumber, DataType, varptr(PerfInfo)   ; 戻り値は stat
; NodeNumber : DWORD -> "sptr"
; DataType : BYTE -> "sptr"
; PerfInfo : WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "api-ms-win-core-memory-l1-1-9.dll"
#cfunc global GetMemoryNumaPerformanceInformation "GetMemoryNumaPerformanceInformation" int, int, var
; res = GetMemoryNumaPerformanceInformation(NodeNumber, DataType, PerfInfo)
; NodeNumber : DWORD -> "int"
; DataType : BYTE -> "int"
; PerfInfo : WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; BOOL GetMemoryNumaPerformanceInformation(DWORD NodeNumber, BYTE DataType, WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** PerfInfo)
#uselib "api-ms-win-core-memory-l1-1-9.dll"
#cfunc global GetMemoryNumaPerformanceInformation "GetMemoryNumaPerformanceInformation" int, int, var
; res = GetMemoryNumaPerformanceInformation(NodeNumber, DataType, PerfInfo)
; NodeNumber : DWORD -> "int"
; DataType : BYTE -> "int"
; PerfInfo : WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	api_ms_win_core_memory_l1_1_9 = windows.NewLazySystemDLL("api-ms-win-core-memory-l1-1-9.dll")
	procGetMemoryNumaPerformanceInformation = api_ms_win_core_memory_l1_1_9.NewProc("GetMemoryNumaPerformanceInformation")
)

// NodeNumber (DWORD), DataType (BYTE), PerfInfo (WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out)
r1, _, err := procGetMemoryNumaPerformanceInformation.Call(
	uintptr(NodeNumber),
	uintptr(DataType),
	uintptr(PerfInfo),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // BOOL
function GetMemoryNumaPerformanceInformation(
  NodeNumber: DWORD;   // DWORD
  DataType: Byte;   // BYTE
  PerfInfo: Pointer   // WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
): BOOL; stdcall;
  external 'api-ms-win-core-memory-l1-1-9.dll' name 'GetMemoryNumaPerformanceInformation';
result := DllCall("api-ms-win-core-memory-l1-1-9\GetMemoryNumaPerformanceInformation"
    , "UInt", NodeNumber   ; DWORD
    , "UChar", DataType   ; BYTE
    , "Ptr", PerfInfo   ; WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out
    , "Int")   ; return: BOOL
●GetMemoryNumaPerformanceInformation(NodeNumber, DataType, PerfInfo) = DLL("api-ms-win-core-memory-l1-1-9.dll", "bool GetMemoryNumaPerformanceInformation(dword, byte, void*)")
# 呼び出し: GetMemoryNumaPerformanceInformation(NodeNumber, DataType, PerfInfo)
# NodeNumber : DWORD -> "dword"
# DataType : BYTE -> "byte"
# PerfInfo : WIN32_MEMORY_NUMA_PERFORMANCE_INFORMATION_OUTPUT** out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。