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

WTS_PROTOCOL_COUNTERS

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

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

フィールド

フィールドサイズx64x86説明
WdBytesDWORD4+0+0WinStationドライバーが処理したバイト数。
WdFramesDWORD4+4+4WinStationドライバーが処理したフレーム数。
WaitForOutBufDWORD4+8+8出力バッファ待ちが発生した回数。
FramesDWORD4+12+12送受信したフレーム総数。
BytesDWORD4+16+16送受信したバイト総数。
CompressedBytesDWORD4+20+20圧縮後のバイト数。
CompressFlushesDWORD4+24+24圧縮フラッシュが発生した回数。
ErrorsDWORD4+28+28発生したエラーの総数。
TimeoutsDWORD4+32+32発生したタイムアウトの回数。
AsyncFramingErrorDWORD4+36+36非同期通信のフレーミングエラー回数。
AsyncOverrunErrorDWORD4+40+40非同期通信のオーバーランエラー回数。
AsyncOverflowErrorDWORD4+44+44非同期通信のオーバーフローエラー回数。
AsyncParityErrorDWORD4+48+48非同期通信のパリティエラー回数。
TdErrorsDWORD4+52+52トランスポートドライバーのエラー回数。
ProtocolTypeWORD2+56+56対象プロトコルの種別を示す数値。
LengthWORD2+58+58この構造体の長さをバイト単位で表す。
SpecificWORD2+60+60プロトコル固有のカウンター値。
ReservedDWORD400+64+64予約済みフィールド。将来の拡張用。

各言語での定義

#include <windows.h>

// WTS_PROTOCOL_COUNTERS  (x64 464 / x86 464 バイト)
typedef struct WTS_PROTOCOL_COUNTERS {
    DWORD WdBytes;
    DWORD WdFrames;
    DWORD WaitForOutBuf;
    DWORD Frames;
    DWORD Bytes;
    DWORD CompressedBytes;
    DWORD CompressFlushes;
    DWORD Errors;
    DWORD Timeouts;
    DWORD AsyncFramingError;
    DWORD AsyncOverrunError;
    DWORD AsyncOverflowError;
    DWORD AsyncParityError;
    DWORD TdErrors;
    WORD ProtocolType;
    WORD Length;
    WORD Specific;
    DWORD Reserved[100];
} WTS_PROTOCOL_COUNTERS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTS_PROTOCOL_COUNTERS
{
    public uint WdBytes;
    public uint WdFrames;
    public uint WaitForOutBuf;
    public uint Frames;
    public uint Bytes;
    public uint CompressedBytes;
    public uint CompressFlushes;
    public uint Errors;
    public uint Timeouts;
    public uint AsyncFramingError;
    public uint AsyncOverrunError;
    public uint AsyncOverflowError;
    public uint AsyncParityError;
    public uint TdErrors;
    public ushort ProtocolType;
    public ushort Length;
    public ushort Specific;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 100)] public uint[] Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTS_PROTOCOL_COUNTERS
    Public WdBytes As UInteger
    Public WdFrames As UInteger
    Public WaitForOutBuf As UInteger
    Public Frames As UInteger
    Public Bytes As UInteger
    Public CompressedBytes As UInteger
    Public CompressFlushes As UInteger
    Public Errors As UInteger
    Public Timeouts As UInteger
    Public AsyncFramingError As UInteger
    Public AsyncOverrunError As UInteger
    Public AsyncOverflowError As UInteger
    Public AsyncParityError As UInteger
    Public TdErrors As UInteger
    Public ProtocolType As UShort
    Public Length As UShort
    Public Specific As UShort
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=100)> Public Reserved() As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WTS_PROTOCOL_COUNTERS(ctypes.Structure):
    _fields_ = [
        ("WdBytes", wintypes.DWORD),
        ("WdFrames", wintypes.DWORD),
        ("WaitForOutBuf", wintypes.DWORD),
        ("Frames", wintypes.DWORD),
        ("Bytes", wintypes.DWORD),
        ("CompressedBytes", wintypes.DWORD),
        ("CompressFlushes", wintypes.DWORD),
        ("Errors", wintypes.DWORD),
        ("Timeouts", wintypes.DWORD),
        ("AsyncFramingError", wintypes.DWORD),
        ("AsyncOverrunError", wintypes.DWORD),
        ("AsyncOverflowError", wintypes.DWORD),
        ("AsyncParityError", wintypes.DWORD),
        ("TdErrors", wintypes.DWORD),
        ("ProtocolType", ctypes.c_ushort),
        ("Length", ctypes.c_ushort),
        ("Specific", ctypes.c_ushort),
        ("Reserved", wintypes.DWORD * 100),
    ]
#[repr(C)]
pub struct WTS_PROTOCOL_COUNTERS {
    pub WdBytes: u32,
    pub WdFrames: u32,
    pub WaitForOutBuf: u32,
    pub Frames: u32,
    pub Bytes: u32,
    pub CompressedBytes: u32,
    pub CompressFlushes: u32,
    pub Errors: u32,
    pub Timeouts: u32,
    pub AsyncFramingError: u32,
    pub AsyncOverrunError: u32,
    pub AsyncOverflowError: u32,
    pub AsyncParityError: u32,
    pub TdErrors: u32,
    pub ProtocolType: u16,
    pub Length: u16,
    pub Specific: u16,
    pub Reserved: [u32; 100],
}
import "golang.org/x/sys/windows"

type WTS_PROTOCOL_COUNTERS struct {
	WdBytes uint32
	WdFrames uint32
	WaitForOutBuf uint32
	Frames uint32
	Bytes uint32
	CompressedBytes uint32
	CompressFlushes uint32
	Errors uint32
	Timeouts uint32
	AsyncFramingError uint32
	AsyncOverrunError uint32
	AsyncOverflowError uint32
	AsyncParityError uint32
	TdErrors uint32
	ProtocolType uint16
	Length uint16
	Specific uint16
	Reserved [100]uint32
}
type
  WTS_PROTOCOL_COUNTERS = record
    WdBytes: DWORD;
    WdFrames: DWORD;
    WaitForOutBuf: DWORD;
    Frames: DWORD;
    Bytes: DWORD;
    CompressedBytes: DWORD;
    CompressFlushes: DWORD;
    Errors: DWORD;
    Timeouts: DWORD;
    AsyncFramingError: DWORD;
    AsyncOverrunError: DWORD;
    AsyncOverflowError: DWORD;
    AsyncParityError: DWORD;
    TdErrors: DWORD;
    ProtocolType: Word;
    Length: Word;
    Specific: Word;
    Reserved: array[0..99] of DWORD;
  end;
const WTS_PROTOCOL_COUNTERS = extern struct {
    WdBytes: u32,
    WdFrames: u32,
    WaitForOutBuf: u32,
    Frames: u32,
    Bytes: u32,
    CompressedBytes: u32,
    CompressFlushes: u32,
    Errors: u32,
    Timeouts: u32,
    AsyncFramingError: u32,
    AsyncOverrunError: u32,
    AsyncOverflowError: u32,
    AsyncParityError: u32,
    TdErrors: u32,
    ProtocolType: u16,
    Length: u16,
    Specific: u16,
    Reserved: [100]u32,
};
type
  WTS_PROTOCOL_COUNTERS {.bycopy.} = object
    WdBytes: uint32
    WdFrames: uint32
    WaitForOutBuf: uint32
    Frames: uint32
    Bytes: uint32
    CompressedBytes: uint32
    CompressFlushes: uint32
    Errors: uint32
    Timeouts: uint32
    AsyncFramingError: uint32
    AsyncOverrunError: uint32
    AsyncOverflowError: uint32
    AsyncParityError: uint32
    TdErrors: uint32
    ProtocolType: uint16
    Length: uint16
    Specific: uint16
    Reserved: array[100, uint32]
struct WTS_PROTOCOL_COUNTERS
{
    uint WdBytes;
    uint WdFrames;
    uint WaitForOutBuf;
    uint Frames;
    uint Bytes;
    uint CompressedBytes;
    uint CompressFlushes;
    uint Errors;
    uint Timeouts;
    uint AsyncFramingError;
    uint AsyncOverrunError;
    uint AsyncOverflowError;
    uint AsyncParityError;
    uint TdErrors;
    ushort ProtocolType;
    ushort Length;
    ushort Specific;
    uint[100] Reserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WTS_PROTOCOL_COUNTERS サイズ: 464 バイト(x64)
dim st, 116    ; 4byte整数×116(構造体サイズ 464 / 4 切り上げ)
; WdBytes : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; WdFrames : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; WaitForOutBuf : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Frames : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Bytes : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; CompressedBytes : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; CompressFlushes : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Errors : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; Timeouts : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; AsyncFramingError : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; AsyncOverrunError : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; AsyncOverflowError : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; AsyncParityError : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; TdErrors : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; ProtocolType : WORD (+56, 2byte)  wpoke st,56,値  /  値 = wpeek(st,56)
; Length : WORD (+58, 2byte)  wpoke st,58,値  /  値 = wpeek(st,58)
; Specific : WORD (+60, 2byte)  wpoke st,60,値  /  値 = wpeek(st,60)
; Reserved : DWORD (+64, 400byte)  varptr(st)+64 を基点に操作(400byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WTS_PROTOCOL_COUNTERS
    #field int WdBytes
    #field int WdFrames
    #field int WaitForOutBuf
    #field int Frames
    #field int Bytes
    #field int CompressedBytes
    #field int CompressFlushes
    #field int Errors
    #field int Timeouts
    #field int AsyncFramingError
    #field int AsyncOverrunError
    #field int AsyncOverflowError
    #field int AsyncParityError
    #field int TdErrors
    #field short ProtocolType
    #field short Length
    #field short Specific
    #field int Reserved 100
#endstruct

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