ホーム › System.WindowsProgramming › TDI_TL_IO_CONTROL_ENDPOINT
TDI_TL_IO_CONTROL_ENDPOINT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Type | TDI_TL_IO_CONTROL_TYPE | 4 | +0 | +0 | 実行する制御操作の種別を示す列挙値で、エンドポイントとフィルター操作のいずれかを指定する。 |
| Level | DWORD | 4 | +4 | +4 | 制御対象のプロトコルレベルを示す値で、設定/問い合わせ対象の層を識別する。 |
| Anonymous | _Anonymous_e__Union | 4 | +8 | +8 | 操作種別に応じて使い分ける情報を保持する無名共用体で、エンドポイントまたはフィルター用データを格納する。 |
| InputBuffer | void* | 8/4 | +16 | +12 | 制御操作への入力データを格納したバッファへのポインター。不要時はNULL可。 |
| InputBufferLength | DWORD | 4 | +24 | +16 | 入力バッファのバイト数を示す。InputBufferがNULLなら0を指定する。 |
| OutputBuffer | void* | 8/4 | +32 | +20 | 制御操作の結果を受け取る出力バッファへのポインター。不要時はNULL可。 |
| OutputBufferLength | DWORD | 4 | +40 | +24 | 出力バッファのバイト数を示す。OutputBufferがNULLなら0を指定する。 |
共用体: _Anonymous_e__Union x64 4B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| IoControlCode | DWORD | 4 | +0 | +0 |
| OptionName | DWORD | 4 | +0 | +0 |
各言語での定義
#include <windows.h>
// TDI_TL_IO_CONTROL_ENDPOINT (x64 48 / x86 28 バイト)
typedef struct TDI_TL_IO_CONTROL_ENDPOINT {
TDI_TL_IO_CONTROL_TYPE Type;
DWORD Level;
_Anonymous_e__Union Anonymous;
void* InputBuffer;
DWORD InputBufferLength;
void* OutputBuffer;
DWORD OutputBufferLength;
} TDI_TL_IO_CONTROL_ENDPOINT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TDI_TL_IO_CONTROL_ENDPOINT
{
public int Type;
public uint Level;
public _Anonymous_e__Union Anonymous;
public IntPtr InputBuffer;
public uint InputBufferLength;
public IntPtr OutputBuffer;
public uint OutputBufferLength;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TDI_TL_IO_CONTROL_ENDPOINT
Public Type As Integer
Public Level As UInteger
Public Anonymous As _Anonymous_e__Union
Public InputBuffer As IntPtr
Public InputBufferLength As UInteger
Public OutputBuffer As IntPtr
Public OutputBufferLength As UInteger
End Structureimport ctypes
from ctypes import wintypes
class TDI_TL_IO_CONTROL_ENDPOINT(ctypes.Structure):
_fields_ = [
("Type", ctypes.c_int),
("Level", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
("InputBuffer", ctypes.c_void_p),
("InputBufferLength", wintypes.DWORD),
("OutputBuffer", ctypes.c_void_p),
("OutputBufferLength", wintypes.DWORD),
]#[repr(C)]
pub struct TDI_TL_IO_CONTROL_ENDPOINT {
pub Type: i32,
pub Level: u32,
pub Anonymous: _Anonymous_e__Union,
pub InputBuffer: *mut core::ffi::c_void,
pub InputBufferLength: u32,
pub OutputBuffer: *mut core::ffi::c_void,
pub OutputBufferLength: u32,
}import "golang.org/x/sys/windows"
type TDI_TL_IO_CONTROL_ENDPOINT struct {
Type int32
Level uint32
Anonymous _Anonymous_e__Union
InputBuffer uintptr
InputBufferLength uint32
OutputBuffer uintptr
OutputBufferLength uint32
}type
TDI_TL_IO_CONTROL_ENDPOINT = record
Type: Integer;
Level: DWORD;
Anonymous: _Anonymous_e__Union;
InputBuffer: Pointer;
InputBufferLength: DWORD;
OutputBuffer: Pointer;
OutputBufferLength: DWORD;
end;const TDI_TL_IO_CONTROL_ENDPOINT = extern struct {
Type: i32,
Level: u32,
Anonymous: _Anonymous_e__Union,
InputBuffer: ?*anyopaque,
InputBufferLength: u32,
OutputBuffer: ?*anyopaque,
OutputBufferLength: u32,
};type
TDI_TL_IO_CONTROL_ENDPOINT {.bycopy.} = object
Type: int32
Level: uint32
Anonymous: _Anonymous_e__Union
InputBuffer: pointer
InputBufferLength: uint32
OutputBuffer: pointer
OutputBufferLength: uint32struct TDI_TL_IO_CONTROL_ENDPOINT
{
int Type;
uint Level;
_Anonymous_e__Union Anonymous;
void* InputBuffer;
uint InputBufferLength;
void* OutputBuffer;
uint OutputBufferLength;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TDI_TL_IO_CONTROL_ENDPOINT サイズ: 28 バイト(x86)
dim st, 7 ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Type : TDI_TL_IO_CONTROL_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Level : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; InputBuffer : void* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; InputBufferLength : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; OutputBuffer : void* (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; OutputBufferLength : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TDI_TL_IO_CONTROL_ENDPOINT サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; Type : TDI_TL_IO_CONTROL_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Level : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; InputBuffer : void* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; InputBufferLength : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; OutputBuffer : void* (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; OutputBufferLength : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TDI_TL_IO_CONTROL_ENDPOINT
#field int Type
#field int Level
#field byte Anonymous 4
#field intptr InputBuffer
#field int InputBufferLength
#field intptr OutputBuffer
#field int OutputBufferLength
#endstruct
stdim st, TDI_TL_IO_CONTROL_ENDPOINT ; NSTRUCT 変数を確保
st->Type = 100
mes "Type=" + st->Type
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。