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

SecPkgContext_ConnectionInfo

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

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

フィールド

フィールドサイズx64x86説明
dwProtocolDWORD4+0+0確立された接続のプロトコルを示すビット値(SP_PROT_*)。
aiCipherALG_ID4+4+4使用される対称暗号アルゴリズムのID(ALG_ID)。
dwCipherStrengthDWORD4+8+8対称暗号の強度をビット数で示す。
aiHashALG_ID4+12+12使用されるハッシュアルゴリズムのID(ALG_ID)。
dwHashStrengthDWORD4+16+16ハッシュの強度をビット数で示す。
aiExchALG_ID4+20+20鍵交換アルゴリズムのID(ALG_ID)。
dwExchStrengthDWORD4+24+24鍵交換の強度をビット数で示す。

各言語での定義

#include <windows.h>

// SecPkgContext_ConnectionInfo  (x64 28 / x86 28 バイト)
typedef struct SecPkgContext_ConnectionInfo {
    DWORD dwProtocol;
    ALG_ID aiCipher;
    DWORD dwCipherStrength;
    ALG_ID aiHash;
    DWORD dwHashStrength;
    ALG_ID aiExch;
    DWORD dwExchStrength;
} SecPkgContext_ConnectionInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgContext_ConnectionInfo
{
    public uint dwProtocol;
    public uint aiCipher;
    public uint dwCipherStrength;
    public uint aiHash;
    public uint dwHashStrength;
    public uint aiExch;
    public uint dwExchStrength;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgContext_ConnectionInfo
    Public dwProtocol As UInteger
    Public aiCipher As UInteger
    Public dwCipherStrength As UInteger
    Public aiHash As UInteger
    Public dwHashStrength As UInteger
    Public aiExch As UInteger
    Public dwExchStrength As UInteger
End Structure
import ctypes
from ctypes import wintypes

class SecPkgContext_ConnectionInfo(ctypes.Structure):
    _fields_ = [
        ("dwProtocol", wintypes.DWORD),
        ("aiCipher", wintypes.DWORD),
        ("dwCipherStrength", wintypes.DWORD),
        ("aiHash", wintypes.DWORD),
        ("dwHashStrength", wintypes.DWORD),
        ("aiExch", wintypes.DWORD),
        ("dwExchStrength", wintypes.DWORD),
    ]
#[repr(C)]
pub struct SecPkgContext_ConnectionInfo {
    pub dwProtocol: u32,
    pub aiCipher: u32,
    pub dwCipherStrength: u32,
    pub aiHash: u32,
    pub dwHashStrength: u32,
    pub aiExch: u32,
    pub dwExchStrength: u32,
}
import "golang.org/x/sys/windows"

type SecPkgContext_ConnectionInfo struct {
	dwProtocol uint32
	aiCipher uint32
	dwCipherStrength uint32
	aiHash uint32
	dwHashStrength uint32
	aiExch uint32
	dwExchStrength uint32
}
type
  SecPkgContext_ConnectionInfo = record
    dwProtocol: DWORD;
    aiCipher: DWORD;
    dwCipherStrength: DWORD;
    aiHash: DWORD;
    dwHashStrength: DWORD;
    aiExch: DWORD;
    dwExchStrength: DWORD;
  end;
const SecPkgContext_ConnectionInfo = extern struct {
    dwProtocol: u32,
    aiCipher: u32,
    dwCipherStrength: u32,
    aiHash: u32,
    dwHashStrength: u32,
    aiExch: u32,
    dwExchStrength: u32,
};
type
  SecPkgContext_ConnectionInfo {.bycopy.} = object
    dwProtocol: uint32
    aiCipher: uint32
    dwCipherStrength: uint32
    aiHash: uint32
    dwHashStrength: uint32
    aiExch: uint32
    dwExchStrength: uint32
struct SecPkgContext_ConnectionInfo
{
    uint dwProtocol;
    uint aiCipher;
    uint dwCipherStrength;
    uint aiHash;
    uint dwHashStrength;
    uint aiExch;
    uint dwExchStrength;
}

HSP用 定義

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

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

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