ホーム › NetworkManagement.QoS › RSVP_FILTERSPEC_V4_GPI
RSVP_FILTERSPEC_V4_GPI
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Address | IN_ADDR_IPV4 | 4 | +0 | +0 | IPv4アドレスを示すIN_ADDR_IPV4。 |
| GeneralPortId | DWORD | 4 | +4 | +4 | 汎用ポート識別子(GPI)を示す値。 |
各言語での定義
#include <windows.h>
// IN_ADDR_IPV4 (x64 4 / x86 4 バイト)
typedef struct IN_ADDR_IPV4 {
DWORD Addr;
BYTE AddrBytes[4];
} IN_ADDR_IPV4;
// RSVP_FILTERSPEC_V4_GPI (x64 8 / x86 8 バイト)
typedef struct RSVP_FILTERSPEC_V4_GPI {
IN_ADDR_IPV4 Address;
DWORD GeneralPortId;
} RSVP_FILTERSPEC_V4_GPI;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct IN_ADDR_IPV4
{
public uint Addr;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] AddrBytes;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct RSVP_FILTERSPEC_V4_GPI
{
public IN_ADDR_IPV4 Address;
public uint GeneralPortId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure IN_ADDR_IPV4
Public Addr As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public AddrBytes() As Byte
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure RSVP_FILTERSPEC_V4_GPI
Public Address As IN_ADDR_IPV4
Public GeneralPortId As UInteger
End Structureimport ctypes
from ctypes import wintypes
class IN_ADDR_IPV4(ctypes.Structure):
_fields_ = [
("Addr", wintypes.DWORD),
("AddrBytes", ctypes.c_ubyte * 4),
]
class RSVP_FILTERSPEC_V4_GPI(ctypes.Structure):
_fields_ = [
("Address", IN_ADDR_IPV4),
("GeneralPortId", wintypes.DWORD),
]#[repr(C)]
pub struct IN_ADDR_IPV4 {
pub Addr: u32,
pub AddrBytes: [u8; 4],
}
#[repr(C)]
pub struct RSVP_FILTERSPEC_V4_GPI {
pub Address: IN_ADDR_IPV4,
pub GeneralPortId: u32,
}import "golang.org/x/sys/windows"
type IN_ADDR_IPV4 struct {
Addr uint32
AddrBytes [4]byte
}
type RSVP_FILTERSPEC_V4_GPI struct {
Address IN_ADDR_IPV4
GeneralPortId uint32
}type
IN_ADDR_IPV4 = record
Addr: DWORD;
AddrBytes: array[0..3] of Byte;
end;
RSVP_FILTERSPEC_V4_GPI = record
Address: IN_ADDR_IPV4;
GeneralPortId: DWORD;
end;const IN_ADDR_IPV4 = extern struct {
Addr: u32,
AddrBytes: [4]u8,
};
const RSVP_FILTERSPEC_V4_GPI = extern struct {
Address: IN_ADDR_IPV4,
GeneralPortId: u32,
};type
IN_ADDR_IPV4 {.bycopy.} = object
Addr: uint32
AddrBytes: array[4, uint8]
RSVP_FILTERSPEC_V4_GPI {.bycopy.} = object
Address: IN_ADDR_IPV4
GeneralPortId: uint32struct IN_ADDR_IPV4
{
uint Addr;
ubyte[4] AddrBytes;
}
struct RSVP_FILTERSPEC_V4_GPI
{
IN_ADDR_IPV4 Address;
uint GeneralPortId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; RSVP_FILTERSPEC_V4_GPI サイズ: 8 バイト(x64)
dim st, 2 ; 4byte整数×2(構造体サイズ 8 / 4 切り上げ)
; Address : IN_ADDR_IPV4 (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; GeneralPortId : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global RSVP_FILTERSPEC_V4_GPI
#field byte Address 4
#field int GeneralPortId
#endstruct
stdim st, RSVP_FILTERSPEC_V4_GPI ; NSTRUCT 変数を確保
st->GeneralPortId = 100
mes "GeneralPortId=" + st->GeneralPortId
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。