ホーム › NetworkManagement.IpHelper › TCP_ESTATS_BANDWIDTH_ROD_v0
TCP_ESTATS_BANDWIDTH_ROD_v0
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| OutboundBandwidth | ULONGLONG | 8 | +0 | +0 | 送信方向の推定帯域(ビット毎秒)である。 |
| InboundBandwidth | ULONGLONG | 8 | +8 | +8 | 受信方向の推定帯域(ビット毎秒)である。 |
| OutboundInstability | ULONGLONG | 8 | +16 | +16 | 送信帯域推定の不安定度(ばらつき)を示す値である。 |
| InboundInstability | ULONGLONG | 8 | +24 | +24 | 受信帯域推定の不安定度(ばらつき)を示す値である。 |
| OutboundBandwidthPeaked | BOOLEAN | 1 | +32 | +32 | 送信帯域がピークに達したかどうかを示すブール値である。 |
| InboundBandwidthPeaked | BOOLEAN | 1 | +33 | +33 | 受信帯域がピークに達したかどうかを示すブール値である。 |
各言語での定義
#include <windows.h>
// TCP_ESTATS_BANDWIDTH_ROD_v0 (x64 40 / x86 40 バイト)
typedef struct TCP_ESTATS_BANDWIDTH_ROD_v0 {
ULONGLONG OutboundBandwidth;
ULONGLONG InboundBandwidth;
ULONGLONG OutboundInstability;
ULONGLONG InboundInstability;
BOOLEAN OutboundBandwidthPeaked;
BOOLEAN InboundBandwidthPeaked;
} TCP_ESTATS_BANDWIDTH_ROD_v0;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TCP_ESTATS_BANDWIDTH_ROD_v0
{
public ulong OutboundBandwidth;
public ulong InboundBandwidth;
public ulong OutboundInstability;
public ulong InboundInstability;
[MarshalAs(UnmanagedType.U1)] public bool OutboundBandwidthPeaked;
[MarshalAs(UnmanagedType.U1)] public bool InboundBandwidthPeaked;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TCP_ESTATS_BANDWIDTH_ROD_v0
Public OutboundBandwidth As ULong
Public InboundBandwidth As ULong
Public OutboundInstability As ULong
Public InboundInstability As ULong
<MarshalAs(UnmanagedType.U1)> Public OutboundBandwidthPeaked As Boolean
<MarshalAs(UnmanagedType.U1)> Public InboundBandwidthPeaked As Boolean
End Structureimport ctypes
from ctypes import wintypes
class TCP_ESTATS_BANDWIDTH_ROD_v0(ctypes.Structure):
_fields_ = [
("OutboundBandwidth", ctypes.c_ulonglong),
("InboundBandwidth", ctypes.c_ulonglong),
("OutboundInstability", ctypes.c_ulonglong),
("InboundInstability", ctypes.c_ulonglong),
("OutboundBandwidthPeaked", ctypes.c_byte),
("InboundBandwidthPeaked", ctypes.c_byte),
]#[repr(C)]
pub struct TCP_ESTATS_BANDWIDTH_ROD_v0 {
pub OutboundBandwidth: u64,
pub InboundBandwidth: u64,
pub OutboundInstability: u64,
pub InboundInstability: u64,
pub OutboundBandwidthPeaked: u8,
pub InboundBandwidthPeaked: u8,
}import "golang.org/x/sys/windows"
type TCP_ESTATS_BANDWIDTH_ROD_v0 struct {
OutboundBandwidth uint64
InboundBandwidth uint64
OutboundInstability uint64
InboundInstability uint64
OutboundBandwidthPeaked byte
InboundBandwidthPeaked byte
}type
TCP_ESTATS_BANDWIDTH_ROD_v0 = record
OutboundBandwidth: UInt64;
InboundBandwidth: UInt64;
OutboundInstability: UInt64;
InboundInstability: UInt64;
OutboundBandwidthPeaked: ByteBool;
InboundBandwidthPeaked: ByteBool;
end;const TCP_ESTATS_BANDWIDTH_ROD_v0 = extern struct {
OutboundBandwidth: u64,
InboundBandwidth: u64,
OutboundInstability: u64,
InboundInstability: u64,
OutboundBandwidthPeaked: u8,
InboundBandwidthPeaked: u8,
};type
TCP_ESTATS_BANDWIDTH_ROD_v0 {.bycopy.} = object
OutboundBandwidth: uint64
InboundBandwidth: uint64
OutboundInstability: uint64
InboundInstability: uint64
OutboundBandwidthPeaked: uint8
InboundBandwidthPeaked: uint8struct TCP_ESTATS_BANDWIDTH_ROD_v0
{
ulong OutboundBandwidth;
ulong InboundBandwidth;
ulong OutboundInstability;
ulong InboundInstability;
ubyte OutboundBandwidthPeaked;
ubyte InboundBandwidthPeaked;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TCP_ESTATS_BANDWIDTH_ROD_v0 サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; OutboundBandwidth : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; InboundBandwidth : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; OutboundInstability : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; InboundInstability : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; OutboundBandwidthPeaked : BOOLEAN (+32, 1byte) poke st,32,値 / 値 = peek(st,32)
; InboundBandwidthPeaked : BOOLEAN (+33, 1byte) poke st,33,値 / 値 = peek(st,33)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TCP_ESTATS_BANDWIDTH_ROD_v0
#field int64 OutboundBandwidth
#field int64 InboundBandwidth
#field int64 OutboundInstability
#field int64 InboundInstability
#field bool1 OutboundBandwidthPeaked
#field bool1 InboundBandwidthPeaked
#endstruct
stdim st, TCP_ESTATS_BANDWIDTH_ROD_v0 ; NSTRUCT 変数を確保
st->OutboundBandwidth = 100
mes "OutboundBandwidth=" + st->OutboundBandwidth