Win32 API 日本語リファレンス
ホームDevices.Display › VIDEO_PERFORMANCE_COUNTER

VIDEO_PERFORMANCE_COUNTER

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

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

フィールド

フィールドサイズx64x86説明
NbOfAllocationEvictedULONGLONG80+0+0退避(エビクト)されたアロケーション数。
NbOfAllocationMarkedULONGLONG80+80+80マークされたアロケーション数。
NbOfAllocationRestoredULONGLONG80+160+160復元されたアロケーション数。
KBytesEvictedULONGLONG80+240+240退避されたメモリ量(KB)。
KBytesMarkedULONGLONG80+320+320マークされたメモリ量(KB)。
KBytesRestoredULONGLONG80+400+400復元されたメモリ量(KB)。
NbProcessCommitedULONGLONG8+480+480コミットされたプロセス数。
NbAllocationCommitedULONGLONG8+488+488コミットされたアロケーション数。
NbAllocationMarkedULONGLONG8+496+496マークされたアロケーション数(累積)。
KBytesAllocatedULONGLONG8+504+504割り当てられたメモリ量(KB)。
KBytesAvailableULONGLONG8+512+512利用可能なメモリ量(KB)。
KBytesCurMarkedULONGLONG8+520+520現在マークされているメモリ量(KB)。
ReferenceULONGLONG8+528+528参照回数。
UnreferenceULONGLONG8+536+536参照解除回数。
TrueReferenceULONGLONG8+544+544実参照回数。
NbOfPageInULONGLONG8+552+552ページインの回数。
KBytesPageInULONGLONG8+560+560ページインしたメモリ量(KB)。
NbOfPageOutULONGLONG8+568+568ページアウトの回数。
KBytesPageOutULONGLONG8+576+576ページアウトしたメモリ量(KB)。
NbOfRotateOutULONGLONG8+584+584ローテーションアウトの回数。
KBytesRotateOutULONGLONG8+592+592ローテーションアウトしたメモリ量(KB)。

各言語での定義

#include <windows.h>

// VIDEO_PERFORMANCE_COUNTER  (x64 600 / x86 600 バイト)
typedef struct VIDEO_PERFORMANCE_COUNTER {
    ULONGLONG NbOfAllocationEvicted[10];
    ULONGLONG NbOfAllocationMarked[10];
    ULONGLONG NbOfAllocationRestored[10];
    ULONGLONG KBytesEvicted[10];
    ULONGLONG KBytesMarked[10];
    ULONGLONG KBytesRestored[10];
    ULONGLONG NbProcessCommited;
    ULONGLONG NbAllocationCommited;
    ULONGLONG NbAllocationMarked;
    ULONGLONG KBytesAllocated;
    ULONGLONG KBytesAvailable;
    ULONGLONG KBytesCurMarked;
    ULONGLONG Reference;
    ULONGLONG Unreference;
    ULONGLONG TrueReference;
    ULONGLONG NbOfPageIn;
    ULONGLONG KBytesPageIn;
    ULONGLONG NbOfPageOut;
    ULONGLONG KBytesPageOut;
    ULONGLONG NbOfRotateOut;
    ULONGLONG KBytesRotateOut;
} VIDEO_PERFORMANCE_COUNTER;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIDEO_PERFORMANCE_COUNTER
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public ulong[] NbOfAllocationEvicted;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public ulong[] NbOfAllocationMarked;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public ulong[] NbOfAllocationRestored;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public ulong[] KBytesEvicted;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public ulong[] KBytesMarked;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 10)] public ulong[] KBytesRestored;
    public ulong NbProcessCommited;
    public ulong NbAllocationCommited;
    public ulong NbAllocationMarked;
    public ulong KBytesAllocated;
    public ulong KBytesAvailable;
    public ulong KBytesCurMarked;
    public ulong Reference;
    public ulong Unreference;
    public ulong TrueReference;
    public ulong NbOfPageIn;
    public ulong KBytesPageIn;
    public ulong NbOfPageOut;
    public ulong KBytesPageOut;
    public ulong NbOfRotateOut;
    public ulong KBytesRotateOut;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIDEO_PERFORMANCE_COUNTER
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Public NbOfAllocationEvicted() As ULong
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Public NbOfAllocationMarked() As ULong
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Public NbOfAllocationRestored() As ULong
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Public KBytesEvicted() As ULong
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Public KBytesMarked() As ULong
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=10)> Public KBytesRestored() As ULong
    Public NbProcessCommited As ULong
    Public NbAllocationCommited As ULong
    Public NbAllocationMarked As ULong
    Public KBytesAllocated As ULong
    Public KBytesAvailable As ULong
    Public KBytesCurMarked As ULong
    Public Reference As ULong
    Public Unreference As ULong
    Public TrueReference As ULong
    Public NbOfPageIn As ULong
    Public KBytesPageIn As ULong
    Public NbOfPageOut As ULong
    Public KBytesPageOut As ULong
    Public NbOfRotateOut As ULong
    Public KBytesRotateOut As ULong
End Structure
import ctypes
from ctypes import wintypes

class VIDEO_PERFORMANCE_COUNTER(ctypes.Structure):
    _fields_ = [
        ("NbOfAllocationEvicted", ctypes.c_ulonglong * 10),
        ("NbOfAllocationMarked", ctypes.c_ulonglong * 10),
        ("NbOfAllocationRestored", ctypes.c_ulonglong * 10),
        ("KBytesEvicted", ctypes.c_ulonglong * 10),
        ("KBytesMarked", ctypes.c_ulonglong * 10),
        ("KBytesRestored", ctypes.c_ulonglong * 10),
        ("NbProcessCommited", ctypes.c_ulonglong),
        ("NbAllocationCommited", ctypes.c_ulonglong),
        ("NbAllocationMarked", ctypes.c_ulonglong),
        ("KBytesAllocated", ctypes.c_ulonglong),
        ("KBytesAvailable", ctypes.c_ulonglong),
        ("KBytesCurMarked", ctypes.c_ulonglong),
        ("Reference", ctypes.c_ulonglong),
        ("Unreference", ctypes.c_ulonglong),
        ("TrueReference", ctypes.c_ulonglong),
        ("NbOfPageIn", ctypes.c_ulonglong),
        ("KBytesPageIn", ctypes.c_ulonglong),
        ("NbOfPageOut", ctypes.c_ulonglong),
        ("KBytesPageOut", ctypes.c_ulonglong),
        ("NbOfRotateOut", ctypes.c_ulonglong),
        ("KBytesRotateOut", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct VIDEO_PERFORMANCE_COUNTER {
    pub NbOfAllocationEvicted: [u64; 10],
    pub NbOfAllocationMarked: [u64; 10],
    pub NbOfAllocationRestored: [u64; 10],
    pub KBytesEvicted: [u64; 10],
    pub KBytesMarked: [u64; 10],
    pub KBytesRestored: [u64; 10],
    pub NbProcessCommited: u64,
    pub NbAllocationCommited: u64,
    pub NbAllocationMarked: u64,
    pub KBytesAllocated: u64,
    pub KBytesAvailable: u64,
    pub KBytesCurMarked: u64,
    pub Reference: u64,
    pub Unreference: u64,
    pub TrueReference: u64,
    pub NbOfPageIn: u64,
    pub KBytesPageIn: u64,
    pub NbOfPageOut: u64,
    pub KBytesPageOut: u64,
    pub NbOfRotateOut: u64,
    pub KBytesRotateOut: u64,
}
import "golang.org/x/sys/windows"

type VIDEO_PERFORMANCE_COUNTER struct {
	NbOfAllocationEvicted [10]uint64
	NbOfAllocationMarked [10]uint64
	NbOfAllocationRestored [10]uint64
	KBytesEvicted [10]uint64
	KBytesMarked [10]uint64
	KBytesRestored [10]uint64
	NbProcessCommited uint64
	NbAllocationCommited uint64
	NbAllocationMarked uint64
	KBytesAllocated uint64
	KBytesAvailable uint64
	KBytesCurMarked uint64
	Reference uint64
	Unreference uint64
	TrueReference uint64
	NbOfPageIn uint64
	KBytesPageIn uint64
	NbOfPageOut uint64
	KBytesPageOut uint64
	NbOfRotateOut uint64
	KBytesRotateOut uint64
}
type
  VIDEO_PERFORMANCE_COUNTER = record
    NbOfAllocationEvicted: array[0..9] of UInt64;
    NbOfAllocationMarked: array[0..9] of UInt64;
    NbOfAllocationRestored: array[0..9] of UInt64;
    KBytesEvicted: array[0..9] of UInt64;
    KBytesMarked: array[0..9] of UInt64;
    KBytesRestored: array[0..9] of UInt64;
    NbProcessCommited: UInt64;
    NbAllocationCommited: UInt64;
    NbAllocationMarked: UInt64;
    KBytesAllocated: UInt64;
    KBytesAvailable: UInt64;
    KBytesCurMarked: UInt64;
    Reference: UInt64;
    Unreference: UInt64;
    TrueReference: UInt64;
    NbOfPageIn: UInt64;
    KBytesPageIn: UInt64;
    NbOfPageOut: UInt64;
    KBytesPageOut: UInt64;
    NbOfRotateOut: UInt64;
    KBytesRotateOut: UInt64;
  end;
const VIDEO_PERFORMANCE_COUNTER = extern struct {
    NbOfAllocationEvicted: [10]u64,
    NbOfAllocationMarked: [10]u64,
    NbOfAllocationRestored: [10]u64,
    KBytesEvicted: [10]u64,
    KBytesMarked: [10]u64,
    KBytesRestored: [10]u64,
    NbProcessCommited: u64,
    NbAllocationCommited: u64,
    NbAllocationMarked: u64,
    KBytesAllocated: u64,
    KBytesAvailable: u64,
    KBytesCurMarked: u64,
    Reference: u64,
    Unreference: u64,
    TrueReference: u64,
    NbOfPageIn: u64,
    KBytesPageIn: u64,
    NbOfPageOut: u64,
    KBytesPageOut: u64,
    NbOfRotateOut: u64,
    KBytesRotateOut: u64,
};
type
  VIDEO_PERFORMANCE_COUNTER {.bycopy.} = object
    NbOfAllocationEvicted: array[10, uint64]
    NbOfAllocationMarked: array[10, uint64]
    NbOfAllocationRestored: array[10, uint64]
    KBytesEvicted: array[10, uint64]
    KBytesMarked: array[10, uint64]
    KBytesRestored: array[10, uint64]
    NbProcessCommited: uint64
    NbAllocationCommited: uint64
    NbAllocationMarked: uint64
    KBytesAllocated: uint64
    KBytesAvailable: uint64
    KBytesCurMarked: uint64
    Reference: uint64
    Unreference: uint64
    TrueReference: uint64
    NbOfPageIn: uint64
    KBytesPageIn: uint64
    NbOfPageOut: uint64
    KBytesPageOut: uint64
    NbOfRotateOut: uint64
    KBytesRotateOut: uint64
struct VIDEO_PERFORMANCE_COUNTER
{
    ulong[10] NbOfAllocationEvicted;
    ulong[10] NbOfAllocationMarked;
    ulong[10] NbOfAllocationRestored;
    ulong[10] KBytesEvicted;
    ulong[10] KBytesMarked;
    ulong[10] KBytesRestored;
    ulong NbProcessCommited;
    ulong NbAllocationCommited;
    ulong NbAllocationMarked;
    ulong KBytesAllocated;
    ulong KBytesAvailable;
    ulong KBytesCurMarked;
    ulong Reference;
    ulong Unreference;
    ulong TrueReference;
    ulong NbOfPageIn;
    ulong KBytesPageIn;
    ulong NbOfPageOut;
    ulong KBytesPageOut;
    ulong NbOfRotateOut;
    ulong KBytesRotateOut;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VIDEO_PERFORMANCE_COUNTER サイズ: 600 バイト(x64)
dim st, 150    ; 4byte整数×150(構造体サイズ 600 / 4 切り上げ)
; NbOfAllocationEvicted : ULONGLONG (+0, 80byte)  varptr(st)+0 を基点に操作(80byte:入れ子/配列)
; NbOfAllocationMarked : ULONGLONG (+80, 80byte)  varptr(st)+80 を基点に操作(80byte:入れ子/配列)
; NbOfAllocationRestored : ULONGLONG (+160, 80byte)  varptr(st)+160 を基点に操作(80byte:入れ子/配列)
; KBytesEvicted : ULONGLONG (+240, 80byte)  varptr(st)+240 を基点に操作(80byte:入れ子/配列)
; KBytesMarked : ULONGLONG (+320, 80byte)  varptr(st)+320 を基点に操作(80byte:入れ子/配列)
; KBytesRestored : ULONGLONG (+400, 80byte)  varptr(st)+400 を基点に操作(80byte:入れ子/配列)
; NbProcessCommited : ULONGLONG (+480, 8byte)  qpoke st,480,値 / qpeek(st,480)  ※IronHSPのみ。3.7/3.8は lpoke st,480,下位 : lpoke st,484,上位
; NbAllocationCommited : ULONGLONG (+488, 8byte)  qpoke st,488,値 / qpeek(st,488)  ※IronHSPのみ。3.7/3.8は lpoke st,488,下位 : lpoke st,492,上位
; NbAllocationMarked : ULONGLONG (+496, 8byte)  qpoke st,496,値 / qpeek(st,496)  ※IronHSPのみ。3.7/3.8は lpoke st,496,下位 : lpoke st,500,上位
; KBytesAllocated : ULONGLONG (+504, 8byte)  qpoke st,504,値 / qpeek(st,504)  ※IronHSPのみ。3.7/3.8は lpoke st,504,下位 : lpoke st,508,上位
; KBytesAvailable : ULONGLONG (+512, 8byte)  qpoke st,512,値 / qpeek(st,512)  ※IronHSPのみ。3.7/3.8は lpoke st,512,下位 : lpoke st,516,上位
; KBytesCurMarked : ULONGLONG (+520, 8byte)  qpoke st,520,値 / qpeek(st,520)  ※IronHSPのみ。3.7/3.8は lpoke st,520,下位 : lpoke st,524,上位
; Reference : ULONGLONG (+528, 8byte)  qpoke st,528,値 / qpeek(st,528)  ※IronHSPのみ。3.7/3.8は lpoke st,528,下位 : lpoke st,532,上位
; Unreference : ULONGLONG (+536, 8byte)  qpoke st,536,値 / qpeek(st,536)  ※IronHSPのみ。3.7/3.8は lpoke st,536,下位 : lpoke st,540,上位
; TrueReference : ULONGLONG (+544, 8byte)  qpoke st,544,値 / qpeek(st,544)  ※IronHSPのみ。3.7/3.8は lpoke st,544,下位 : lpoke st,548,上位
; NbOfPageIn : ULONGLONG (+552, 8byte)  qpoke st,552,値 / qpeek(st,552)  ※IronHSPのみ。3.7/3.8は lpoke st,552,下位 : lpoke st,556,上位
; KBytesPageIn : ULONGLONG (+560, 8byte)  qpoke st,560,値 / qpeek(st,560)  ※IronHSPのみ。3.7/3.8は lpoke st,560,下位 : lpoke st,564,上位
; NbOfPageOut : ULONGLONG (+568, 8byte)  qpoke st,568,値 / qpeek(st,568)  ※IronHSPのみ。3.7/3.8は lpoke st,568,下位 : lpoke st,572,上位
; KBytesPageOut : ULONGLONG (+576, 8byte)  qpoke st,576,値 / qpeek(st,576)  ※IronHSPのみ。3.7/3.8は lpoke st,576,下位 : lpoke st,580,上位
; NbOfRotateOut : ULONGLONG (+584, 8byte)  qpoke st,584,値 / qpeek(st,584)  ※IronHSPのみ。3.7/3.8は lpoke st,584,下位 : lpoke st,588,上位
; KBytesRotateOut : ULONGLONG (+592, 8byte)  qpoke st,592,値 / qpeek(st,592)  ※IronHSPのみ。3.7/3.8は lpoke st,592,下位 : lpoke st,596,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VIDEO_PERFORMANCE_COUNTER
    #field int64 NbOfAllocationEvicted 10
    #field int64 NbOfAllocationMarked 10
    #field int64 NbOfAllocationRestored 10
    #field int64 KBytesEvicted 10
    #field int64 KBytesMarked 10
    #field int64 KBytesRestored 10
    #field int64 NbProcessCommited
    #field int64 NbAllocationCommited
    #field int64 NbAllocationMarked
    #field int64 KBytesAllocated
    #field int64 KBytesAvailable
    #field int64 KBytesCurMarked
    #field int64 Reference
    #field int64 Unreference
    #field int64 TrueReference
    #field int64 NbOfPageIn
    #field int64 KBytesPageIn
    #field int64 NbOfPageOut
    #field int64 KBytesPageOut
    #field int64 NbOfRotateOut
    #field int64 KBytesRotateOut
#endstruct

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