Win32 API 日本語リファレンス
ホームSecurity.Authentication.Identity › SEC_CHANNEL_BINDINGS_EX

SEC_CHANNEL_BINDINGS_EX

構造体
サイズx64: 48 バイト / x86: 48 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
magicNumberDWORD4+0+0拡張チャネルバインディング構造体を識別するマジック値。
flagsDWORD4+4+4チャネルバインディングの挙動を制御するビットフラグ。
cbHeaderLengthDWORD4+8+8構造体ヘッダー部の長さ(バイト数)。
cbStructureLengthDWORD4+12+12構造体全体の長さ(バイト数)。
dwInitiatorAddrTypeDWORD4+16+16イニシエーター側アドレスの種別を示す値。
cbInitiatorLengthDWORD4+20+20イニシエーターアドレスデータの長さ(バイト数)。
dwInitiatorOffsetDWORD4+24+24構造体先頭からイニシエーターアドレスまでのオフセット(バイト)。
dwAcceptorAddrTypeDWORD4+28+28アクセプター側アドレスの種別を示す値。
cbAcceptorLengthDWORD4+32+32アクセプターアドレスデータの長さ(バイト数)。
dwAcceptorOffsetDWORD4+36+36構造体先頭からアクセプターアドレスまでのオフセット(バイト)。
cbApplicationDataLengthDWORD4+40+40アプリケーション固有データの長さ(バイト数)。
dwApplicationDataOffsetDWORD4+44+44構造体先頭からアプリケーションデータまでのオフセット(バイト)。

各言語での定義

#include <windows.h>

// SEC_CHANNEL_BINDINGS_EX  (x64 48 / x86 48 バイト)
typedef struct SEC_CHANNEL_BINDINGS_EX {
    DWORD magicNumber;
    DWORD flags;
    DWORD cbHeaderLength;
    DWORD cbStructureLength;
    DWORD dwInitiatorAddrType;
    DWORD cbInitiatorLength;
    DWORD dwInitiatorOffset;
    DWORD dwAcceptorAddrType;
    DWORD cbAcceptorLength;
    DWORD dwAcceptorOffset;
    DWORD cbApplicationDataLength;
    DWORD dwApplicationDataOffset;
} SEC_CHANNEL_BINDINGS_EX;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SEC_CHANNEL_BINDINGS_EX
{
    public uint magicNumber;
    public uint flags;
    public uint cbHeaderLength;
    public uint cbStructureLength;
    public uint dwInitiatorAddrType;
    public uint cbInitiatorLength;
    public uint dwInitiatorOffset;
    public uint dwAcceptorAddrType;
    public uint cbAcceptorLength;
    public uint dwAcceptorOffset;
    public uint cbApplicationDataLength;
    public uint dwApplicationDataOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SEC_CHANNEL_BINDINGS_EX
    Public magicNumber As UInteger
    Public flags As UInteger
    Public cbHeaderLength As UInteger
    Public cbStructureLength As UInteger
    Public dwInitiatorAddrType As UInteger
    Public cbInitiatorLength As UInteger
    Public dwInitiatorOffset As UInteger
    Public dwAcceptorAddrType As UInteger
    Public cbAcceptorLength As UInteger
    Public dwAcceptorOffset As UInteger
    Public cbApplicationDataLength As UInteger
    Public dwApplicationDataOffset As UInteger
End Structure
import ctypes
from ctypes import wintypes

class SEC_CHANNEL_BINDINGS_EX(ctypes.Structure):
    _fields_ = [
        ("magicNumber", wintypes.DWORD),
        ("flags", wintypes.DWORD),
        ("cbHeaderLength", wintypes.DWORD),
        ("cbStructureLength", wintypes.DWORD),
        ("dwInitiatorAddrType", wintypes.DWORD),
        ("cbInitiatorLength", wintypes.DWORD),
        ("dwInitiatorOffset", wintypes.DWORD),
        ("dwAcceptorAddrType", wintypes.DWORD),
        ("cbAcceptorLength", wintypes.DWORD),
        ("dwAcceptorOffset", wintypes.DWORD),
        ("cbApplicationDataLength", wintypes.DWORD),
        ("dwApplicationDataOffset", wintypes.DWORD),
    ]
#[repr(C)]
pub struct SEC_CHANNEL_BINDINGS_EX {
    pub magicNumber: u32,
    pub flags: u32,
    pub cbHeaderLength: u32,
    pub cbStructureLength: u32,
    pub dwInitiatorAddrType: u32,
    pub cbInitiatorLength: u32,
    pub dwInitiatorOffset: u32,
    pub dwAcceptorAddrType: u32,
    pub cbAcceptorLength: u32,
    pub dwAcceptorOffset: u32,
    pub cbApplicationDataLength: u32,
    pub dwApplicationDataOffset: u32,
}
import "golang.org/x/sys/windows"

type SEC_CHANNEL_BINDINGS_EX struct {
	magicNumber uint32
	flags uint32
	cbHeaderLength uint32
	cbStructureLength uint32
	dwInitiatorAddrType uint32
	cbInitiatorLength uint32
	dwInitiatorOffset uint32
	dwAcceptorAddrType uint32
	cbAcceptorLength uint32
	dwAcceptorOffset uint32
	cbApplicationDataLength uint32
	dwApplicationDataOffset uint32
}
type
  SEC_CHANNEL_BINDINGS_EX = record
    magicNumber: DWORD;
    flags: DWORD;
    cbHeaderLength: DWORD;
    cbStructureLength: DWORD;
    dwInitiatorAddrType: DWORD;
    cbInitiatorLength: DWORD;
    dwInitiatorOffset: DWORD;
    dwAcceptorAddrType: DWORD;
    cbAcceptorLength: DWORD;
    dwAcceptorOffset: DWORD;
    cbApplicationDataLength: DWORD;
    dwApplicationDataOffset: DWORD;
  end;
const SEC_CHANNEL_BINDINGS_EX = extern struct {
    magicNumber: u32,
    flags: u32,
    cbHeaderLength: u32,
    cbStructureLength: u32,
    dwInitiatorAddrType: u32,
    cbInitiatorLength: u32,
    dwInitiatorOffset: u32,
    dwAcceptorAddrType: u32,
    cbAcceptorLength: u32,
    dwAcceptorOffset: u32,
    cbApplicationDataLength: u32,
    dwApplicationDataOffset: u32,
};
type
  SEC_CHANNEL_BINDINGS_EX {.bycopy.} = object
    magicNumber: uint32
    flags: uint32
    cbHeaderLength: uint32
    cbStructureLength: uint32
    dwInitiatorAddrType: uint32
    cbInitiatorLength: uint32
    dwInitiatorOffset: uint32
    dwAcceptorAddrType: uint32
    cbAcceptorLength: uint32
    dwAcceptorOffset: uint32
    cbApplicationDataLength: uint32
    dwApplicationDataOffset: uint32
struct SEC_CHANNEL_BINDINGS_EX
{
    uint magicNumber;
    uint flags;
    uint cbHeaderLength;
    uint cbStructureLength;
    uint dwInitiatorAddrType;
    uint cbInitiatorLength;
    uint dwInitiatorOffset;
    uint dwAcceptorAddrType;
    uint cbAcceptorLength;
    uint dwAcceptorOffset;
    uint cbApplicationDataLength;
    uint dwApplicationDataOffset;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SEC_CHANNEL_BINDINGS_EX サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; magicNumber : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; flags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cbHeaderLength : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cbStructureLength : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwInitiatorAddrType : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cbInitiatorLength : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwInitiatorOffset : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwAcceptorAddrType : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; cbAcceptorLength : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwAcceptorOffset : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; cbApplicationDataLength : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; dwApplicationDataOffset : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SEC_CHANNEL_BINDINGS_EX
    #field int magicNumber
    #field int flags
    #field int cbHeaderLength
    #field int cbStructureLength
    #field int dwInitiatorAddrType
    #field int cbInitiatorLength
    #field int dwInitiatorOffset
    #field int dwAcceptorAddrType
    #field int cbAcceptorLength
    #field int dwAcceptorOffset
    #field int cbApplicationDataLength
    #field int dwApplicationDataOffset
#endstruct

stdim st, SEC_CHANNEL_BINDINGS_EX        ; NSTRUCT 変数を確保
st->magicNumber = 100
mes "magicNumber=" + st->magicNumber