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