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