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