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

WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS

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

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

フィールド

フィールドサイズx64x86説明
SyntheticInterruptsCountULONGLONG8+0+0合成割り込みの累積発生回数を示すULONGLONGである。
LongSpinWaitHypercallsCountULONGLONG8+8+8長時間スピン待機ハイパーコールの累積回数を示すULONGLONGである。
OtherHypercallsCountULONGLONG8+16+16その他のハイパーコールの累積回数を示すULONGLONGである。
SyntheticInterruptHypercallsCountULONGLONG8+24+24合成割り込み関連ハイパーコールの累積回数を示すULONGLONGである。
VirtualInterruptHypercallsCountULONGLONG8+32+32仮想割り込み関連ハイパーコールの累積回数を示すULONGLONGである。
VirtualMmuHypercallsCountULONGLONG8+40+40仮想MMU関連ハイパーコールの累積回数を示すULONGLONGである。

各言語での定義

#include <windows.h>

// WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS  (x64 48 / x86 48 バイト)
typedef struct WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS {
    ULONGLONG SyntheticInterruptsCount;
    ULONGLONG LongSpinWaitHypercallsCount;
    ULONGLONG OtherHypercallsCount;
    ULONGLONG SyntheticInterruptHypercallsCount;
    ULONGLONG VirtualInterruptHypercallsCount;
    ULONGLONG VirtualMmuHypercallsCount;
} WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS
{
    public ulong SyntheticInterruptsCount;
    public ulong LongSpinWaitHypercallsCount;
    public ulong OtherHypercallsCount;
    public ulong SyntheticInterruptHypercallsCount;
    public ulong VirtualInterruptHypercallsCount;
    public ulong VirtualMmuHypercallsCount;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS
    Public SyntheticInterruptsCount As ULong
    Public LongSpinWaitHypercallsCount As ULong
    Public OtherHypercallsCount As ULong
    Public SyntheticInterruptHypercallsCount As ULong
    Public VirtualInterruptHypercallsCount As ULong
    Public VirtualMmuHypercallsCount As ULong
End Structure
import ctypes
from ctypes import wintypes

class WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS(ctypes.Structure):
    _fields_ = [
        ("SyntheticInterruptsCount", ctypes.c_ulonglong),
        ("LongSpinWaitHypercallsCount", ctypes.c_ulonglong),
        ("OtherHypercallsCount", ctypes.c_ulonglong),
        ("SyntheticInterruptHypercallsCount", ctypes.c_ulonglong),
        ("VirtualInterruptHypercallsCount", ctypes.c_ulonglong),
        ("VirtualMmuHypercallsCount", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS {
    pub SyntheticInterruptsCount: u64,
    pub LongSpinWaitHypercallsCount: u64,
    pub OtherHypercallsCount: u64,
    pub SyntheticInterruptHypercallsCount: u64,
    pub VirtualInterruptHypercallsCount: u64,
    pub VirtualMmuHypercallsCount: u64,
}
import "golang.org/x/sys/windows"

type WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS struct {
	SyntheticInterruptsCount uint64
	LongSpinWaitHypercallsCount uint64
	OtherHypercallsCount uint64
	SyntheticInterruptHypercallsCount uint64
	VirtualInterruptHypercallsCount uint64
	VirtualMmuHypercallsCount uint64
}
type
  WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS = record
    SyntheticInterruptsCount: UInt64;
    LongSpinWaitHypercallsCount: UInt64;
    OtherHypercallsCount: UInt64;
    SyntheticInterruptHypercallsCount: UInt64;
    VirtualInterruptHypercallsCount: UInt64;
    VirtualMmuHypercallsCount: UInt64;
  end;
const WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS = extern struct {
    SyntheticInterruptsCount: u64,
    LongSpinWaitHypercallsCount: u64,
    OtherHypercallsCount: u64,
    SyntheticInterruptHypercallsCount: u64,
    VirtualInterruptHypercallsCount: u64,
    VirtualMmuHypercallsCount: u64,
};
type
  WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS {.bycopy.} = object
    SyntheticInterruptsCount: uint64
    LongSpinWaitHypercallsCount: uint64
    OtherHypercallsCount: uint64
    SyntheticInterruptHypercallsCount: uint64
    VirtualInterruptHypercallsCount: uint64
    VirtualMmuHypercallsCount: uint64
struct WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS
{
    ulong SyntheticInterruptsCount;
    ulong LongSpinWaitHypercallsCount;
    ulong OtherHypercallsCount;
    ulong SyntheticInterruptHypercallsCount;
    ulong VirtualInterruptHypercallsCount;
    ulong VirtualMmuHypercallsCount;
}

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_SYNTHETIC_FEATURES_COUNTERS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; SyntheticInterruptsCount : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; LongSpinWaitHypercallsCount : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; OtherHypercallsCount : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; SyntheticInterruptHypercallsCount : ULONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; VirtualInterruptHypercallsCount : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; VirtualMmuHypercallsCount : ULONGLONG (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS
    #field int64 SyntheticInterruptsCount
    #field int64 LongSpinWaitHypercallsCount
    #field int64 OtherHypercallsCount
    #field int64 SyntheticInterruptHypercallsCount
    #field int64 VirtualInterruptHypercallsCount
    #field int64 VirtualMmuHypercallsCount
#endstruct

stdim st, WHV_PROCESSOR_SYNTHETIC_FEATURES_COUNTERS        ; NSTRUCT 変数を確保
st->SyntheticInterruptsCount = 100
mes "SyntheticInterruptsCount=" + st->SyntheticInterruptsCount