ホーム › Security.Authentication.Identity › SecPkgContext_SessionInfo
SecPkgContext_SessionInfo
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||
|---|---|---|---|---|---|---|---|---|---|
| dwFlags | DWORD | 4 | +0 | +0 | セッションの種類を指定するビットフラグです。次の値が定義されています。
| ||||
| cbSessionId | DWORD | 4 | +4 | +4 | rgbSessionId 配列のサイズ (バイト単位) です。 | ||||
| rgbSessionId | BYTE | 32 | +8 | +8 | セッションを識別する最大 32 バイトの配列です。 |
公式ドキュメント
セッションが再接続かどうかを指定し、セッションを識別する値を取得します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// SecPkgContext_SessionInfo (x64 40 / x86 40 バイト)
typedef struct SecPkgContext_SessionInfo {
DWORD dwFlags;
DWORD cbSessionId;
BYTE rgbSessionId[32];
} SecPkgContext_SessionInfo;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgContext_SessionInfo
{
public uint dwFlags;
public uint cbSessionId;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] rgbSessionId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgContext_SessionInfo
Public dwFlags As UInteger
Public cbSessionId As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public rgbSessionId() As Byte
End Structureimport ctypes
from ctypes import wintypes
class SecPkgContext_SessionInfo(ctypes.Structure):
_fields_ = [
("dwFlags", wintypes.DWORD),
("cbSessionId", wintypes.DWORD),
("rgbSessionId", ctypes.c_ubyte * 32),
]#[repr(C)]
pub struct SecPkgContext_SessionInfo {
pub dwFlags: u32,
pub cbSessionId: u32,
pub rgbSessionId: [u8; 32],
}import "golang.org/x/sys/windows"
type SecPkgContext_SessionInfo struct {
dwFlags uint32
cbSessionId uint32
rgbSessionId [32]byte
}type
SecPkgContext_SessionInfo = record
dwFlags: DWORD;
cbSessionId: DWORD;
rgbSessionId: array[0..31] of Byte;
end;const SecPkgContext_SessionInfo = extern struct {
dwFlags: u32,
cbSessionId: u32,
rgbSessionId: [32]u8,
};type
SecPkgContext_SessionInfo {.bycopy.} = object
dwFlags: uint32
cbSessionId: uint32
rgbSessionId: array[32, uint8]struct SecPkgContext_SessionInfo
{
uint dwFlags;
uint cbSessionId;
ubyte[32] rgbSessionId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SecPkgContext_SessionInfo サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwFlags : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cbSessionId : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; rgbSessionId : BYTE (+8, 32byte) varptr(st)+8 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SecPkgContext_SessionInfo
#field int dwFlags
#field int cbSessionId
#field byte rgbSessionId 32
#endstruct
stdim st, SecPkgContext_SessionInfo ; NSTRUCT 変数を確保
st->dwFlags = 100
mes "dwFlags=" + st->dwFlags