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

WHV_PROCESSOR_INTERCEPT_COUNTERS

構造体
サイズx64: 224 バイト / x86: 224 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
PageInvalidationsWHV_PROCESSOR_INTERCEPT_COUNTER16+0+0ページ無効化インターセプトの回数と時間を示すカウンタである。
ControlRegisterAccessesWHV_PROCESSOR_INTERCEPT_COUNTER16+16+16制御レジスタアクセスインターセプトのカウンタである。
IoInstructionsWHV_PROCESSOR_INTERCEPT_COUNTER16+32+32I/O命令インターセプトのカウンタである。
HaltInstructionsWHV_PROCESSOR_INTERCEPT_COUNTER16+48+48HLT命令インターセプトのカウンタである。
CpuidInstructionsWHV_PROCESSOR_INTERCEPT_COUNTER16+64+64CPUID命令インターセプトのカウンタである。
MsrAccessesWHV_PROCESSOR_INTERCEPT_COUNTER16+80+80MSRアクセスインターセプトのカウンタである。
OtherInterceptsWHV_PROCESSOR_INTERCEPT_COUNTER16+96+96その他の分類されないインターセプトのカウンタである。
PendingInterruptsWHV_PROCESSOR_INTERCEPT_COUNTER16+112+112保留中割り込み関連インターセプトのカウンタである。
EmulatedInstructionsWHV_PROCESSOR_INTERCEPT_COUNTER16+128+128エミュレートされた命令のカウンタである。
DebugRegisterAccessesWHV_PROCESSOR_INTERCEPT_COUNTER16+144+144デバッグレジスタアクセスインターセプトのカウンタである。
PageFaultInterceptsWHV_PROCESSOR_INTERCEPT_COUNTER16+160+160ページフォルトインターセプトのカウンタである。
NestedPageFaultInterceptsWHV_PROCESSOR_INTERCEPT_COUNTER16+176+176ネステッドページフォルトインターセプトのカウンタである。
HypercallsWHV_PROCESSOR_INTERCEPT_COUNTER16+192+192ハイパーコールインターセプトのカウンタである。
RdpmcInstructionsWHV_PROCESSOR_INTERCEPT_COUNTER16+208+208RDPMC命令インターセプトのカウンタである。

各言語での定義

#include <windows.h>

// WHV_PROCESSOR_INTERCEPT_COUNTER  (x64 16 / x86 16 バイト)
typedef struct WHV_PROCESSOR_INTERCEPT_COUNTER {
    ULONGLONG Count;
    ULONGLONG Time100ns;
} WHV_PROCESSOR_INTERCEPT_COUNTER;

// WHV_PROCESSOR_INTERCEPT_COUNTERS  (x64 224 / x86 224 バイト)
typedef struct WHV_PROCESSOR_INTERCEPT_COUNTERS {
    WHV_PROCESSOR_INTERCEPT_COUNTER PageInvalidations;
    WHV_PROCESSOR_INTERCEPT_COUNTER ControlRegisterAccesses;
    WHV_PROCESSOR_INTERCEPT_COUNTER IoInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER HaltInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER CpuidInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER MsrAccesses;
    WHV_PROCESSOR_INTERCEPT_COUNTER OtherIntercepts;
    WHV_PROCESSOR_INTERCEPT_COUNTER PendingInterrupts;
    WHV_PROCESSOR_INTERCEPT_COUNTER EmulatedInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER DebugRegisterAccesses;
    WHV_PROCESSOR_INTERCEPT_COUNTER PageFaultIntercepts;
    WHV_PROCESSOR_INTERCEPT_COUNTER NestedPageFaultIntercepts;
    WHV_PROCESSOR_INTERCEPT_COUNTER Hypercalls;
    WHV_PROCESSOR_INTERCEPT_COUNTER RdpmcInstructions;
} WHV_PROCESSOR_INTERCEPT_COUNTERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WHV_PROCESSOR_INTERCEPT_COUNTER
{
    public ulong Count;
    public ulong Time100ns;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WHV_PROCESSOR_INTERCEPT_COUNTERS
{
    public WHV_PROCESSOR_INTERCEPT_COUNTER PageInvalidations;
    public WHV_PROCESSOR_INTERCEPT_COUNTER ControlRegisterAccesses;
    public WHV_PROCESSOR_INTERCEPT_COUNTER IoInstructions;
    public WHV_PROCESSOR_INTERCEPT_COUNTER HaltInstructions;
    public WHV_PROCESSOR_INTERCEPT_COUNTER CpuidInstructions;
    public WHV_PROCESSOR_INTERCEPT_COUNTER MsrAccesses;
    public WHV_PROCESSOR_INTERCEPT_COUNTER OtherIntercepts;
    public WHV_PROCESSOR_INTERCEPT_COUNTER PendingInterrupts;
    public WHV_PROCESSOR_INTERCEPT_COUNTER EmulatedInstructions;
    public WHV_PROCESSOR_INTERCEPT_COUNTER DebugRegisterAccesses;
    public WHV_PROCESSOR_INTERCEPT_COUNTER PageFaultIntercepts;
    public WHV_PROCESSOR_INTERCEPT_COUNTER NestedPageFaultIntercepts;
    public WHV_PROCESSOR_INTERCEPT_COUNTER Hypercalls;
    public WHV_PROCESSOR_INTERCEPT_COUNTER RdpmcInstructions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WHV_PROCESSOR_INTERCEPT_COUNTER
    Public Count As ULong
    Public Time100ns As ULong
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WHV_PROCESSOR_INTERCEPT_COUNTERS
    Public PageInvalidations As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public ControlRegisterAccesses As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public IoInstructions As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public HaltInstructions As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public CpuidInstructions As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public MsrAccesses As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public OtherIntercepts As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public PendingInterrupts As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public EmulatedInstructions As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public DebugRegisterAccesses As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public PageFaultIntercepts As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public NestedPageFaultIntercepts As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public Hypercalls As WHV_PROCESSOR_INTERCEPT_COUNTER
    Public RdpmcInstructions As WHV_PROCESSOR_INTERCEPT_COUNTER
End Structure
import ctypes
from ctypes import wintypes

class WHV_PROCESSOR_INTERCEPT_COUNTER(ctypes.Structure):
    _fields_ = [
        ("Count", ctypes.c_ulonglong),
        ("Time100ns", ctypes.c_ulonglong),
    ]

class WHV_PROCESSOR_INTERCEPT_COUNTERS(ctypes.Structure):
    _fields_ = [
        ("PageInvalidations", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("ControlRegisterAccesses", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("IoInstructions", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("HaltInstructions", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("CpuidInstructions", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("MsrAccesses", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("OtherIntercepts", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("PendingInterrupts", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("EmulatedInstructions", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("DebugRegisterAccesses", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("PageFaultIntercepts", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("NestedPageFaultIntercepts", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("Hypercalls", WHV_PROCESSOR_INTERCEPT_COUNTER),
        ("RdpmcInstructions", WHV_PROCESSOR_INTERCEPT_COUNTER),
    ]
#[repr(C)]
pub struct WHV_PROCESSOR_INTERCEPT_COUNTER {
    pub Count: u64,
    pub Time100ns: u64,
}

#[repr(C)]
pub struct WHV_PROCESSOR_INTERCEPT_COUNTERS {
    pub PageInvalidations: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub ControlRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub IoInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub HaltInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub CpuidInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub MsrAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub OtherIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub PendingInterrupts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub EmulatedInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub DebugRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub PageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub NestedPageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub Hypercalls: WHV_PROCESSOR_INTERCEPT_COUNTER,
    pub RdpmcInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
}
import "golang.org/x/sys/windows"

type WHV_PROCESSOR_INTERCEPT_COUNTER struct {
	Count uint64
	Time100ns uint64
}

type WHV_PROCESSOR_INTERCEPT_COUNTERS struct {
	PageInvalidations WHV_PROCESSOR_INTERCEPT_COUNTER
	ControlRegisterAccesses WHV_PROCESSOR_INTERCEPT_COUNTER
	IoInstructions WHV_PROCESSOR_INTERCEPT_COUNTER
	HaltInstructions WHV_PROCESSOR_INTERCEPT_COUNTER
	CpuidInstructions WHV_PROCESSOR_INTERCEPT_COUNTER
	MsrAccesses WHV_PROCESSOR_INTERCEPT_COUNTER
	OtherIntercepts WHV_PROCESSOR_INTERCEPT_COUNTER
	PendingInterrupts WHV_PROCESSOR_INTERCEPT_COUNTER
	EmulatedInstructions WHV_PROCESSOR_INTERCEPT_COUNTER
	DebugRegisterAccesses WHV_PROCESSOR_INTERCEPT_COUNTER
	PageFaultIntercepts WHV_PROCESSOR_INTERCEPT_COUNTER
	NestedPageFaultIntercepts WHV_PROCESSOR_INTERCEPT_COUNTER
	Hypercalls WHV_PROCESSOR_INTERCEPT_COUNTER
	RdpmcInstructions WHV_PROCESSOR_INTERCEPT_COUNTER
}
type
  WHV_PROCESSOR_INTERCEPT_COUNTER = record
    Count: UInt64;
    Time100ns: UInt64;
  end;

  WHV_PROCESSOR_INTERCEPT_COUNTERS = record
    PageInvalidations: WHV_PROCESSOR_INTERCEPT_COUNTER;
    ControlRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER;
    IoInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER;
    HaltInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER;
    CpuidInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER;
    MsrAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER;
    OtherIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER;
    PendingInterrupts: WHV_PROCESSOR_INTERCEPT_COUNTER;
    EmulatedInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER;
    DebugRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER;
    PageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER;
    NestedPageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER;
    Hypercalls: WHV_PROCESSOR_INTERCEPT_COUNTER;
    RdpmcInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER;
  end;
const WHV_PROCESSOR_INTERCEPT_COUNTER = extern struct {
    Count: u64,
    Time100ns: u64,
};

const WHV_PROCESSOR_INTERCEPT_COUNTERS = extern struct {
    PageInvalidations: WHV_PROCESSOR_INTERCEPT_COUNTER,
    ControlRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER,
    IoInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    HaltInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    CpuidInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    MsrAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER,
    OtherIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    PendingInterrupts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    EmulatedInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
    DebugRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER,
    PageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    NestedPageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER,
    Hypercalls: WHV_PROCESSOR_INTERCEPT_COUNTER,
    RdpmcInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER,
};
type
  WHV_PROCESSOR_INTERCEPT_COUNTER {.bycopy.} = object
    Count: uint64
    Time100ns: uint64

  WHV_PROCESSOR_INTERCEPT_COUNTERS {.bycopy.} = object
    PageInvalidations: WHV_PROCESSOR_INTERCEPT_COUNTER
    ControlRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER
    IoInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER
    HaltInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER
    CpuidInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER
    MsrAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER
    OtherIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER
    PendingInterrupts: WHV_PROCESSOR_INTERCEPT_COUNTER
    EmulatedInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER
    DebugRegisterAccesses: WHV_PROCESSOR_INTERCEPT_COUNTER
    PageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER
    NestedPageFaultIntercepts: WHV_PROCESSOR_INTERCEPT_COUNTER
    Hypercalls: WHV_PROCESSOR_INTERCEPT_COUNTER
    RdpmcInstructions: WHV_PROCESSOR_INTERCEPT_COUNTER
struct WHV_PROCESSOR_INTERCEPT_COUNTER
{
    ulong Count;
    ulong Time100ns;
}

struct WHV_PROCESSOR_INTERCEPT_COUNTERS
{
    WHV_PROCESSOR_INTERCEPT_COUNTER PageInvalidations;
    WHV_PROCESSOR_INTERCEPT_COUNTER ControlRegisterAccesses;
    WHV_PROCESSOR_INTERCEPT_COUNTER IoInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER HaltInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER CpuidInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER MsrAccesses;
    WHV_PROCESSOR_INTERCEPT_COUNTER OtherIntercepts;
    WHV_PROCESSOR_INTERCEPT_COUNTER PendingInterrupts;
    WHV_PROCESSOR_INTERCEPT_COUNTER EmulatedInstructions;
    WHV_PROCESSOR_INTERCEPT_COUNTER DebugRegisterAccesses;
    WHV_PROCESSOR_INTERCEPT_COUNTER PageFaultIntercepts;
    WHV_PROCESSOR_INTERCEPT_COUNTER NestedPageFaultIntercepts;
    WHV_PROCESSOR_INTERCEPT_COUNTER Hypercalls;
    WHV_PROCESSOR_INTERCEPT_COUNTER RdpmcInstructions;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WHV_PROCESSOR_INTERCEPT_COUNTERS サイズ: 224 バイト(x64)
dim st, 56    ; 4byte整数×56(構造体サイズ 224 / 4 切り上げ)
; PageInvalidations : WHV_PROCESSOR_INTERCEPT_COUNTER (+0, 16byte)  varptr(st)+0 を基点に操作(16byte:入れ子/配列)
; ControlRegisterAccesses : WHV_PROCESSOR_INTERCEPT_COUNTER (+16, 16byte)  varptr(st)+16 を基点に操作(16byte:入れ子/配列)
; IoInstructions : WHV_PROCESSOR_INTERCEPT_COUNTER (+32, 16byte)  varptr(st)+32 を基点に操作(16byte:入れ子/配列)
; HaltInstructions : WHV_PROCESSOR_INTERCEPT_COUNTER (+48, 16byte)  varptr(st)+48 を基点に操作(16byte:入れ子/配列)
; CpuidInstructions : WHV_PROCESSOR_INTERCEPT_COUNTER (+64, 16byte)  varptr(st)+64 を基点に操作(16byte:入れ子/配列)
; MsrAccesses : WHV_PROCESSOR_INTERCEPT_COUNTER (+80, 16byte)  varptr(st)+80 を基点に操作(16byte:入れ子/配列)
; OtherIntercepts : WHV_PROCESSOR_INTERCEPT_COUNTER (+96, 16byte)  varptr(st)+96 を基点に操作(16byte:入れ子/配列)
; PendingInterrupts : WHV_PROCESSOR_INTERCEPT_COUNTER (+112, 16byte)  varptr(st)+112 を基点に操作(16byte:入れ子/配列)
; EmulatedInstructions : WHV_PROCESSOR_INTERCEPT_COUNTER (+128, 16byte)  varptr(st)+128 を基点に操作(16byte:入れ子/配列)
; DebugRegisterAccesses : WHV_PROCESSOR_INTERCEPT_COUNTER (+144, 16byte)  varptr(st)+144 を基点に操作(16byte:入れ子/配列)
; PageFaultIntercepts : WHV_PROCESSOR_INTERCEPT_COUNTER (+160, 16byte)  varptr(st)+160 を基点に操作(16byte:入れ子/配列)
; NestedPageFaultIntercepts : WHV_PROCESSOR_INTERCEPT_COUNTER (+176, 16byte)  varptr(st)+176 を基点に操作(16byte:入れ子/配列)
; Hypercalls : WHV_PROCESSOR_INTERCEPT_COUNTER (+192, 16byte)  varptr(st)+192 を基点に操作(16byte:入れ子/配列)
; RdpmcInstructions : WHV_PROCESSOR_INTERCEPT_COUNTER (+208, 16byte)  varptr(st)+208 を基点に操作(16byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WHV_PROCESSOR_INTERCEPT_COUNTER
    #field int64 Count
    #field int64 Time100ns
#endstruct

#defstruct global WHV_PROCESSOR_INTERCEPT_COUNTERS
    #field WHV_PROCESSOR_INTERCEPT_COUNTER PageInvalidations
    #field WHV_PROCESSOR_INTERCEPT_COUNTER ControlRegisterAccesses
    #field WHV_PROCESSOR_INTERCEPT_COUNTER IoInstructions
    #field WHV_PROCESSOR_INTERCEPT_COUNTER HaltInstructions
    #field WHV_PROCESSOR_INTERCEPT_COUNTER CpuidInstructions
    #field WHV_PROCESSOR_INTERCEPT_COUNTER MsrAccesses
    #field WHV_PROCESSOR_INTERCEPT_COUNTER OtherIntercepts
    #field WHV_PROCESSOR_INTERCEPT_COUNTER PendingInterrupts
    #field WHV_PROCESSOR_INTERCEPT_COUNTER EmulatedInstructions
    #field WHV_PROCESSOR_INTERCEPT_COUNTER DebugRegisterAccesses
    #field WHV_PROCESSOR_INTERCEPT_COUNTER PageFaultIntercepts
    #field WHV_PROCESSOR_INTERCEPT_COUNTER NestedPageFaultIntercepts
    #field WHV_PROCESSOR_INTERCEPT_COUNTER Hypercalls
    #field WHV_PROCESSOR_INTERCEPT_COUNTER RdpmcInstructions
#endstruct

stdim st, WHV_PROCESSOR_INTERCEPT_COUNTERS        ; NSTRUCT 変数を確保