Win32 API 日本語リファレンス
ホームGraphics.DirectComposition › COMPOSITION_STATS

COMPOSITION_STATS

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

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

フィールド

フィールドサイズx64x86説明
presentCountDWORD4+0+0これまでにプレゼントされた回数の累計を示す。
refreshCountDWORD4+4+4実ディスプレイのリフレッシュ回数の累計を示す。
virtualRefreshCountDWORD4+8+8仮想的なリフレッシュ回数の累計を示す。
timeULONGLONG8+16+16統計値に対応する時刻をQPCティックで示す。

各言語での定義

#include <windows.h>

// COMPOSITION_STATS  (x64 24 / x86 24 バイト)
typedef struct COMPOSITION_STATS {
    DWORD presentCount;
    DWORD refreshCount;
    DWORD virtualRefreshCount;
    ULONGLONG time;
} COMPOSITION_STATS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct COMPOSITION_STATS
{
    public uint presentCount;
    public uint refreshCount;
    public uint virtualRefreshCount;
    public ulong time;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure COMPOSITION_STATS
    Public presentCount As UInteger
    Public refreshCount As UInteger
    Public virtualRefreshCount As UInteger
    Public time As ULong
End Structure
import ctypes
from ctypes import wintypes

class COMPOSITION_STATS(ctypes.Structure):
    _fields_ = [
        ("presentCount", wintypes.DWORD),
        ("refreshCount", wintypes.DWORD),
        ("virtualRefreshCount", wintypes.DWORD),
        ("time", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct COMPOSITION_STATS {
    pub presentCount: u32,
    pub refreshCount: u32,
    pub virtualRefreshCount: u32,
    pub time: u64,
}
import "golang.org/x/sys/windows"

type COMPOSITION_STATS struct {
	presentCount uint32
	refreshCount uint32
	virtualRefreshCount uint32
	time uint64
}
type
  COMPOSITION_STATS = record
    presentCount: DWORD;
    refreshCount: DWORD;
    virtualRefreshCount: DWORD;
    time: UInt64;
  end;
const COMPOSITION_STATS = extern struct {
    presentCount: u32,
    refreshCount: u32,
    virtualRefreshCount: u32,
    time: u64,
};
type
  COMPOSITION_STATS {.bycopy.} = object
    presentCount: uint32
    refreshCount: uint32
    virtualRefreshCount: uint32
    time: uint64
struct COMPOSITION_STATS
{
    uint presentCount;
    uint refreshCount;
    uint virtualRefreshCount;
    ulong time;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; COMPOSITION_STATS サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; presentCount : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; refreshCount : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; virtualRefreshCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; time : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global COMPOSITION_STATS
    #field int presentCount
    #field int refreshCount
    #field int virtualRefreshCount
    #field int64 time
#endstruct

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