ホーム › Security.Authentication.Identity › TLS_PARAMETERS
TLS_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cAlpnIds | DWORD | 4 | +0 | +0 | rgstrAlpnIds配列のALPN識別子の個数を示す。 |
| rgstrAlpnIds | LSA_UNICODE_STRING* | 8/4 | +8 | +4 | このパラメータを適用するALPN識別子の配列へのポインタ。 |
| grbitDisabledProtocols | DWORD | 4 | +16 | +8 | 無効化するプロトコルを示すビットマスク。 |
| cDisabledCrypto | DWORD | 4 | +20 | +12 | pDisabledCrypto配列の要素数を示す。 |
| pDisabledCrypto | CRYPTO_SETTINGS* | 8/4 | +24 | +16 | 無効化する暗号設定(CRYPTO_SETTINGS)配列へのポインタ。 |
| dwFlags | DWORD | 4 | +32 | +20 | TLSパラメータの動作を制御するフラグ。 |
各言語での定義
#include <windows.h>
// TLS_PARAMETERS (x64 40 / x86 24 バイト)
typedef struct TLS_PARAMETERS {
DWORD cAlpnIds;
LSA_UNICODE_STRING* rgstrAlpnIds;
DWORD grbitDisabledProtocols;
DWORD cDisabledCrypto;
CRYPTO_SETTINGS* pDisabledCrypto;
DWORD dwFlags;
} TLS_PARAMETERS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TLS_PARAMETERS
{
public uint cAlpnIds;
public IntPtr rgstrAlpnIds;
public uint grbitDisabledProtocols;
public uint cDisabledCrypto;
public IntPtr pDisabledCrypto;
public uint dwFlags;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TLS_PARAMETERS
Public cAlpnIds As UInteger
Public rgstrAlpnIds As IntPtr
Public grbitDisabledProtocols As UInteger
Public cDisabledCrypto As UInteger
Public pDisabledCrypto As IntPtr
Public dwFlags As UInteger
End Structureimport ctypes
from ctypes import wintypes
class TLS_PARAMETERS(ctypes.Structure):
_fields_ = [
("cAlpnIds", wintypes.DWORD),
("rgstrAlpnIds", ctypes.c_void_p),
("grbitDisabledProtocols", wintypes.DWORD),
("cDisabledCrypto", wintypes.DWORD),
("pDisabledCrypto", ctypes.c_void_p),
("dwFlags", wintypes.DWORD),
]#[repr(C)]
pub struct TLS_PARAMETERS {
pub cAlpnIds: u32,
pub rgstrAlpnIds: *mut core::ffi::c_void,
pub grbitDisabledProtocols: u32,
pub cDisabledCrypto: u32,
pub pDisabledCrypto: *mut core::ffi::c_void,
pub dwFlags: u32,
}import "golang.org/x/sys/windows"
type TLS_PARAMETERS struct {
cAlpnIds uint32
rgstrAlpnIds uintptr
grbitDisabledProtocols uint32
cDisabledCrypto uint32
pDisabledCrypto uintptr
dwFlags uint32
}type
TLS_PARAMETERS = record
cAlpnIds: DWORD;
rgstrAlpnIds: Pointer;
grbitDisabledProtocols: DWORD;
cDisabledCrypto: DWORD;
pDisabledCrypto: Pointer;
dwFlags: DWORD;
end;const TLS_PARAMETERS = extern struct {
cAlpnIds: u32,
rgstrAlpnIds: ?*anyopaque,
grbitDisabledProtocols: u32,
cDisabledCrypto: u32,
pDisabledCrypto: ?*anyopaque,
dwFlags: u32,
};type
TLS_PARAMETERS {.bycopy.} = object
cAlpnIds: uint32
rgstrAlpnIds: pointer
grbitDisabledProtocols: uint32
cDisabledCrypto: uint32
pDisabledCrypto: pointer
dwFlags: uint32struct TLS_PARAMETERS
{
uint cAlpnIds;
void* rgstrAlpnIds;
uint grbitDisabledProtocols;
uint cDisabledCrypto;
void* pDisabledCrypto;
uint dwFlags;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; TLS_PARAMETERS サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cAlpnIds : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; rgstrAlpnIds : LSA_UNICODE_STRING* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; grbitDisabledProtocols : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cDisabledCrypto : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; pDisabledCrypto : CRYPTO_SETTINGS* (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; dwFlags : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TLS_PARAMETERS サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cAlpnIds : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; rgstrAlpnIds : LSA_UNICODE_STRING* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; grbitDisabledProtocols : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; cDisabledCrypto : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; pDisabledCrypto : CRYPTO_SETTINGS* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; dwFlags : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TLS_PARAMETERS
#field int cAlpnIds
#field intptr rgstrAlpnIds
#field int grbitDisabledProtocols
#field int cDisabledCrypto
#field intptr pDisabledCrypto
#field int dwFlags
#endstruct
stdim st, TLS_PARAMETERS ; NSTRUCT 変数を確保
st->cAlpnIds = 100
mes "cAlpnIds=" + st->cAlpnIds