Win32 API 日本語リファレンス
ホームSecurity.DiagnosticDataQuery › DIAGNOSTIC_DATA_GENERAL_STATS

DIAGNOSTIC_DATA_GENERAL_STATS

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

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

フィールド

フィールドサイズx64x86説明
optInLevelDWORD4+0+0診断データ収集のオプトインレベルを示す値。
transcriptSizeBytesULONGLONG8+8+8トランスクリプト(履歴)の総バイト数。
oldestEventTimestampULONGLONG8+16+16保持中の最も古いイベントの時刻。ファイル時刻形式。
totalEventCountLast24HoursDWORD4+24+24直近24時間に記録されたイベントの総件数。
averageDailyEventsFLOAT4+28+281日あたりの平均イベント件数。浮動小数点値。

各言語での定義

#include <windows.h>

// DIAGNOSTIC_DATA_GENERAL_STATS  (x64 32 / x86 32 バイト)
typedef struct DIAGNOSTIC_DATA_GENERAL_STATS {
    DWORD optInLevel;
    ULONGLONG transcriptSizeBytes;
    ULONGLONG oldestEventTimestamp;
    DWORD totalEventCountLast24Hours;
    FLOAT averageDailyEvents;
} DIAGNOSTIC_DATA_GENERAL_STATS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DIAGNOSTIC_DATA_GENERAL_STATS
{
    public uint optInLevel;
    public ulong transcriptSizeBytes;
    public ulong oldestEventTimestamp;
    public uint totalEventCountLast24Hours;
    public float averageDailyEvents;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DIAGNOSTIC_DATA_GENERAL_STATS
    Public optInLevel As UInteger
    Public transcriptSizeBytes As ULong
    Public oldestEventTimestamp As ULong
    Public totalEventCountLast24Hours As UInteger
    Public averageDailyEvents As Single
End Structure
import ctypes
from ctypes import wintypes

class DIAGNOSTIC_DATA_GENERAL_STATS(ctypes.Structure):
    _fields_ = [
        ("optInLevel", wintypes.DWORD),
        ("transcriptSizeBytes", ctypes.c_ulonglong),
        ("oldestEventTimestamp", ctypes.c_ulonglong),
        ("totalEventCountLast24Hours", wintypes.DWORD),
        ("averageDailyEvents", ctypes.c_float),
    ]
#[repr(C)]
pub struct DIAGNOSTIC_DATA_GENERAL_STATS {
    pub optInLevel: u32,
    pub transcriptSizeBytes: u64,
    pub oldestEventTimestamp: u64,
    pub totalEventCountLast24Hours: u32,
    pub averageDailyEvents: f32,
}
import "golang.org/x/sys/windows"

type DIAGNOSTIC_DATA_GENERAL_STATS struct {
	optInLevel uint32
	transcriptSizeBytes uint64
	oldestEventTimestamp uint64
	totalEventCountLast24Hours uint32
	averageDailyEvents float32
}
type
  DIAGNOSTIC_DATA_GENERAL_STATS = record
    optInLevel: DWORD;
    transcriptSizeBytes: UInt64;
    oldestEventTimestamp: UInt64;
    totalEventCountLast24Hours: DWORD;
    averageDailyEvents: Single;
  end;
const DIAGNOSTIC_DATA_GENERAL_STATS = extern struct {
    optInLevel: u32,
    transcriptSizeBytes: u64,
    oldestEventTimestamp: u64,
    totalEventCountLast24Hours: u32,
    averageDailyEvents: f32,
};
type
  DIAGNOSTIC_DATA_GENERAL_STATS {.bycopy.} = object
    optInLevel: uint32
    transcriptSizeBytes: uint64
    oldestEventTimestamp: uint64
    totalEventCountLast24Hours: uint32
    averageDailyEvents: float32
struct DIAGNOSTIC_DATA_GENERAL_STATS
{
    uint optInLevel;
    ulong transcriptSizeBytes;
    ulong oldestEventTimestamp;
    uint totalEventCountLast24Hours;
    float averageDailyEvents;
}

HSP用 定義

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

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

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