ホーム › System.RemoteDesktop › WTS_PROTOCOL_COUNTERS
WTS_PROTOCOL_COUNTERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| WdBytes | DWORD | 4 | +0 | +0 | 送受信されたバイト数です。 |
| WdFrames | DWORD | 4 | +4 | +4 | 送受信されたフレーム数です。 |
| WaitForOutBuf | DWORD | 4 | +8 | +8 | 出力バッファーが利用可能になるまでプロトコルが待機した回数です。 |
| Frames | DWORD | 4 | +12 | +12 | トランスポートドライバーが送受信したフレーム数です。 |
| Bytes | DWORD | 4 | +16 | +16 | トランスポートドライバーが送受信したバイト数です。 |
| CompressedBytes | DWORD | 4 | +20 | +20 | 圧縮されたバイト数です。 |
| CompressFlushes | DWORD | 4 | +24 | +24 | 圧縮フラッシュの回数です。圧縮フラッシュは、パケットの圧縮が失敗し、元の非圧縮パケットで置き換えられたときに発生します。 |
| Errors | DWORD | 4 | +28 | +28 | セッション中にエラーとなったパケット数です。 |
| Timeouts | DWORD | 4 | +32 | +32 | セッション中に発生したタイムアウトの回数です。 |
| AsyncFramingError | DWORD | 4 | +36 | +36 | セッション中に発生した非同期フレーミングエラーの回数です。 |
| AsyncOverrunError | DWORD | 4 | +40 | +40 | セッション中に発生した非同期オーバーランエラーの回数です。 |
| AsyncOverflowError | DWORD | 4 | +44 | +44 | セッション中に発生した非同期オーバーフローエラーの回数です。 |
| AsyncParityError | DWORD | 4 | +48 | +48 | セッション中に発生した非同期パリティエラーの回数です。 |
| TdErrors | DWORD | 4 | +52 | +52 | セッション中に発生したトランスポートプロトコルエラーの回数です。 |
| ProtocolType | WORD | 2 | +56 | +56 | プロトコルの種類です。 |
| Length | WORD | 2 | +58 | +58 | Reserved フィールド内のデータの長さです。 |
| Specific | WORD | 2 | +60 | +60 | クエリ可能なカウンターの種類を指定します。これは TShareCounters または Reserved になります。 |
| Reserved | DWORD | 400 | +64 | +64 | プロトコル固有のデータの配列です。最大長は、WTS_MAX_RESERVED に unsigned long 整数のサイズを掛けた値になります。 |
公式ドキュメント
プロトコルのパフォーマンスカウンターを格納します。
解説(Remarks)
この構造体は WTS_PROTOCOL_STATUS 構造体で使用されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#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 Structureimport 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