ホーム › System.Hypervisor › WHV_DOORBELL_MATCH_DATA
WHV_DOORBELL_MATCH_DATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| GuestAddress | ULONGLONG | 8 | +0 | +0 | 監視するゲスト物理アドレスを示すULONGLONGである。書き込みでドアベルが発火する。 |
| Value | ULONGLONG | 8 | +8 | +8 | 一致判定に用いる値を示すULONGLONGである。 |
| Length | DWORD | 4 | +16 | +16 | 監視するアクセス長(バイト)を示すDWORDである。 |
| _bitfield | DWORD | 4 | +20 | +20 | 値一致を要求するか等のマッチ条件フラグを格納するビットフィールドである。 |
各言語での定義
#include <windows.h>
// WHV_DOORBELL_MATCH_DATA (x64 24 / x86 24 バイト)
typedef struct WHV_DOORBELL_MATCH_DATA {
ULONGLONG GuestAddress;
ULONGLONG Value;
DWORD Length;
DWORD _bitfield;
} WHV_DOORBELL_MATCH_DATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WHV_DOORBELL_MATCH_DATA
{
public ulong GuestAddress;
public ulong Value;
public uint Length;
public uint _bitfield;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WHV_DOORBELL_MATCH_DATA
Public GuestAddress As ULong
Public Value As ULong
Public Length As UInteger
Public _bitfield As UInteger
End Structureimport ctypes
from ctypes import wintypes
class WHV_DOORBELL_MATCH_DATA(ctypes.Structure):
_fields_ = [
("GuestAddress", ctypes.c_ulonglong),
("Value", ctypes.c_ulonglong),
("Length", wintypes.DWORD),
("_bitfield", wintypes.DWORD),
]#[repr(C)]
pub struct WHV_DOORBELL_MATCH_DATA {
pub GuestAddress: u64,
pub Value: u64,
pub Length: u32,
pub _bitfield: u32,
}import "golang.org/x/sys/windows"
type WHV_DOORBELL_MATCH_DATA struct {
GuestAddress uint64
Value uint64
Length uint32
_bitfield uint32
}type
WHV_DOORBELL_MATCH_DATA = record
GuestAddress: UInt64;
Value: UInt64;
Length: DWORD;
_bitfield: DWORD;
end;const WHV_DOORBELL_MATCH_DATA = extern struct {
GuestAddress: u64,
Value: u64,
Length: u32,
_bitfield: u32,
};type
WHV_DOORBELL_MATCH_DATA {.bycopy.} = object
GuestAddress: uint64
Value: uint64
Length: uint32
_bitfield: uint32struct WHV_DOORBELL_MATCH_DATA
{
ulong GuestAddress;
ulong Value;
uint Length;
uint _bitfield;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WHV_DOORBELL_MATCH_DATA サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; GuestAddress : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; Value : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Length : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; _bitfield : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WHV_DOORBELL_MATCH_DATA
#field int64 GuestAddress
#field int64 Value
#field int Length
#field int _bitfield
#endstruct
stdim st, WHV_DOORBELL_MATCH_DATA ; NSTRUCT 変数を確保
st->GuestAddress = 100
mes "GuestAddress=" + st->GuestAddress