ホーム › System.Hypervisor › GetPagingMode
GetPagingMode
関数仮想プロセッサのページングモードを取得する。
シグネチャ
// VmSavedStateDumpProvider.dll
#include <windows.h>
HRESULT GetPagingMode(
void* vmSavedStateDumpHandle,
DWORD vpId,
PAGING_MODE* pagingMode
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| vmSavedStateDumpHandle | void* | inout |
| vpId | DWORD | in |
| pagingMode | PAGING_MODE* | out |
戻り値の型: HRESULT
各言語での呼び出し定義
// VmSavedStateDumpProvider.dll
#include <windows.h>
HRESULT GetPagingMode(
void* vmSavedStateDumpHandle,
DWORD vpId,
PAGING_MODE* pagingMode
);[DllImport("VmSavedStateDumpProvider.dll", ExactSpelling = true)]
static extern int GetPagingMode(
IntPtr vmSavedStateDumpHandle, // void* in/out
uint vpId, // DWORD
out int pagingMode // PAGING_MODE* out
);<DllImport("VmSavedStateDumpProvider.dll", ExactSpelling:=True)>
Public Shared Function GetPagingMode(
vmSavedStateDumpHandle As IntPtr, ' void* in/out
vpId As UInteger, ' DWORD
<Out> ByRef pagingMode As Integer ' PAGING_MODE* out
) As Integer
End Function' vmSavedStateDumpHandle : void* in/out
' vpId : DWORD
' pagingMode : PAGING_MODE* out
Declare PtrSafe Function GetPagingMode Lib "vmsavedstatedumpprovider" ( _
ByVal vmSavedStateDumpHandle As LongPtr, _
ByVal vpId As Long, _
ByRef pagingMode As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
GetPagingMode = ctypes.windll.vmsavedstatedumpprovider.GetPagingMode
GetPagingMode.restype = ctypes.c_int
GetPagingMode.argtypes = [
ctypes.POINTER(None), # vmSavedStateDumpHandle : void* in/out
wintypes.DWORD, # vpId : DWORD
ctypes.c_void_p, # pagingMode : PAGING_MODE* out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('VmSavedStateDumpProvider.dll')
GetPagingMode = Fiddle::Function.new(
lib['GetPagingMode'],
[
Fiddle::TYPE_VOIDP, # vmSavedStateDumpHandle : void* in/out
-Fiddle::TYPE_INT, # vpId : DWORD
Fiddle::TYPE_VOIDP, # pagingMode : PAGING_MODE* out
],
Fiddle::TYPE_INT)#[link(name = "vmsavedstatedumpprovider")]
extern "system" {
fn GetPagingMode(
vmSavedStateDumpHandle: *mut (), // void* in/out
vpId: u32, // DWORD
pagingMode: *mut i32 // PAGING_MODE* out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("VmSavedStateDumpProvider.dll")]
public static extern int GetPagingMode(IntPtr vmSavedStateDumpHandle, uint vpId, out int pagingMode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'VmSavedStateDumpProvider_GetPagingMode' -Namespace Win32 -PassThru
# $api::GetPagingMode(vmSavedStateDumpHandle, vpId, pagingMode)#uselib "VmSavedStateDumpProvider.dll"
#func global GetPagingMode "GetPagingMode" sptr, sptr, sptr
; GetPagingMode vmSavedStateDumpHandle, vpId, pagingMode ; 戻り値は stat
; vmSavedStateDumpHandle : void* in/out -> "sptr"
; vpId : DWORD -> "sptr"
; pagingMode : PAGING_MODE* out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "VmSavedStateDumpProvider.dll"
#cfunc global GetPagingMode "GetPagingMode" sptr, int, int
; res = GetPagingMode(vmSavedStateDumpHandle, vpId, pagingMode)
; vmSavedStateDumpHandle : void* in/out -> "sptr"
; vpId : DWORD -> "int"
; pagingMode : PAGING_MODE* out -> "int"; HRESULT GetPagingMode(void* vmSavedStateDumpHandle, DWORD vpId, PAGING_MODE* pagingMode)
#uselib "VmSavedStateDumpProvider.dll"
#cfunc global GetPagingMode "GetPagingMode" intptr, int, int
; res = GetPagingMode(vmSavedStateDumpHandle, vpId, pagingMode)
; vmSavedStateDumpHandle : void* in/out -> "intptr"
; vpId : DWORD -> "int"
; pagingMode : PAGING_MODE* out -> "int"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
vmsavedstatedumpprovider = windows.NewLazySystemDLL("VmSavedStateDumpProvider.dll")
procGetPagingMode = vmsavedstatedumpprovider.NewProc("GetPagingMode")
)
// vmSavedStateDumpHandle (void* in/out), vpId (DWORD), pagingMode (PAGING_MODE* out)
r1, _, err := procGetPagingMode.Call(
uintptr(vmSavedStateDumpHandle),
uintptr(vpId),
uintptr(pagingMode),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction GetPagingMode(
vmSavedStateDumpHandle: Pointer; // void* in/out
vpId: DWORD; // DWORD
pagingMode: Pointer // PAGING_MODE* out
): Integer; stdcall;
external 'VmSavedStateDumpProvider.dll' name 'GetPagingMode';result := DllCall("VmSavedStateDumpProvider\GetPagingMode"
, "Ptr", vmSavedStateDumpHandle ; void* in/out
, "UInt", vpId ; DWORD
, "Ptr", pagingMode ; PAGING_MODE* out
, "Int") ; return: HRESULT●GetPagingMode(vmSavedStateDumpHandle, vpId, pagingMode) = DLL("VmSavedStateDumpProvider.dll", "int GetPagingMode(void*, dword, void*)")
# 呼び出し: GetPagingMode(vmSavedStateDumpHandle, vpId, pagingMode)
# vmSavedStateDumpHandle : void* in/out -> "void*"
# vpId : DWORD -> "dword"
# pagingMode : PAGING_MODE* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。