Win32 API 日本語リファレンス
ホームSystem.Diagnostics.Etw › EVENT_EXTENDED_ITEM_PMC_COUNTERS

EVENT_EXTENDED_ITEM_PMC_COUNTERS

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

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

フィールド

フィールドサイズx64x86説明
CounterULONGLONG8+0+0PMC(パフォーマンスモニタカウンタ)の値配列の先頭。可変長。

各言語での定義

#include <windows.h>

// EVENT_EXTENDED_ITEM_PMC_COUNTERS  (x64 8 / x86 8 バイト)
typedef struct EVENT_EXTENDED_ITEM_PMC_COUNTERS {
    ULONGLONG Counter[1];
} EVENT_EXTENDED_ITEM_PMC_COUNTERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct EVENT_EXTENDED_ITEM_PMC_COUNTERS
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public ulong[] Counter;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure EVENT_EXTENDED_ITEM_PMC_COUNTERS
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Counter() As ULong
End Structure
import ctypes
from ctypes import wintypes

class EVENT_EXTENDED_ITEM_PMC_COUNTERS(ctypes.Structure):
    _fields_ = [
        ("Counter", ctypes.c_ulonglong * 1),
    ]
#[repr(C)]
pub struct EVENT_EXTENDED_ITEM_PMC_COUNTERS {
    pub Counter: [u64; 1],
}
import "golang.org/x/sys/windows"

type EVENT_EXTENDED_ITEM_PMC_COUNTERS struct {
	Counter [1]uint64
}
type
  EVENT_EXTENDED_ITEM_PMC_COUNTERS = record
    Counter: array[0..0] of UInt64;
  end;
const EVENT_EXTENDED_ITEM_PMC_COUNTERS = extern struct {
    Counter: [1]u64,
};
type
  EVENT_EXTENDED_ITEM_PMC_COUNTERS {.bycopy.} = object
    Counter: array[1, uint64]
struct EVENT_EXTENDED_ITEM_PMC_COUNTERS
{
    ulong[1] Counter;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; EVENT_EXTENDED_ITEM_PMC_COUNTERS サイズ: 8 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; Counter : ULONGLONG (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global EVENT_EXTENDED_ITEM_PMC_COUNTERS
    #field int64 Counter 1
#endstruct

stdim st, EVENT_EXTENDED_ITEM_PMC_COUNTERS        ; NSTRUCT 変数を確保