ホーム › Security.Authentication.Identity › SecPkgInfoA
SecPkgInfoA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| fCapabilities | DWORD | 4 | +0 | +0 | セキュリティパッケージの機能を示すSECPKG_FLAGビットフラグ。 |
| wVersion | WORD | 2 | +4 | +4 | パッケージが実装するSSPIのバージョン番号。 |
| wRPCID | WORD | 2 | +6 | +6 | DCE RPCで用いるパッケージ識別子。未割当時はSECPKG_ID_NONE。 |
| cbMaxToken | DWORD | 4 | +8 | +8 | パッケージが扱う認証トークンの最大バイト数。 |
| Name | CHAR* | 8/4 | +16 | +12 | セキュリティパッケージ名を指すANSI文字列ポインタ。 |
| Comment | CHAR* | 8/4 | +24 | +16 | パッケージの説明文を指すANSI文字列ポインタ。 |
各言語での定義
#include <windows.h>
// SecPkgInfoA (x64 32 / x86 20 バイト)
typedef struct SecPkgInfoA {
DWORD fCapabilities;
WORD wVersion;
WORD wRPCID;
DWORD cbMaxToken;
CHAR* Name;
CHAR* Comment;
} SecPkgInfoA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgInfoA
{
public uint fCapabilities;
public ushort wVersion;
public ushort wRPCID;
public uint cbMaxToken;
public IntPtr Name;
public IntPtr Comment;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgInfoA
Public fCapabilities As UInteger
Public wVersion As UShort
Public wRPCID As UShort
Public cbMaxToken As UInteger
Public Name As IntPtr
Public Comment As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class SecPkgInfoA(ctypes.Structure):
_fields_ = [
("fCapabilities", wintypes.DWORD),
("wVersion", ctypes.c_ushort),
("wRPCID", ctypes.c_ushort),
("cbMaxToken", wintypes.DWORD),
("Name", ctypes.c_void_p),
("Comment", ctypes.c_void_p),
]#[repr(C)]
pub struct SecPkgInfoA {
pub fCapabilities: u32,
pub wVersion: u16,
pub wRPCID: u16,
pub cbMaxToken: u32,
pub Name: *mut core::ffi::c_void,
pub Comment: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type SecPkgInfoA struct {
fCapabilities uint32
wVersion uint16
wRPCID uint16
cbMaxToken uint32
Name uintptr
Comment uintptr
}type
SecPkgInfoA = record
fCapabilities: DWORD;
wVersion: Word;
wRPCID: Word;
cbMaxToken: DWORD;
Name: Pointer;
Comment: Pointer;
end;const SecPkgInfoA = extern struct {
fCapabilities: u32,
wVersion: u16,
wRPCID: u16,
cbMaxToken: u32,
Name: ?*anyopaque,
Comment: ?*anyopaque,
};type
SecPkgInfoA {.bycopy.} = object
fCapabilities: uint32
wVersion: uint16
wRPCID: uint16
cbMaxToken: uint32
Name: pointer
Comment: pointerstruct SecPkgInfoA
{
uint fCapabilities;
ushort wVersion;
ushort wRPCID;
uint cbMaxToken;
void* Name;
void* Comment;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SecPkgInfoA サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; fCapabilities : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; wVersion : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; wRPCID : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; cbMaxToken : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Name : CHAR* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; Comment : CHAR* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SecPkgInfoA サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; fCapabilities : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; wVersion : WORD (+4, 2byte) wpoke st,4,値 / 値 = wpeek(st,4)
; wRPCID : WORD (+6, 2byte) wpoke st,6,値 / 値 = wpeek(st,6)
; cbMaxToken : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Name : CHAR* (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Comment : CHAR* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SecPkgInfoA
#field int fCapabilities
#field short wVersion
#field short wRPCID
#field int cbMaxToken
#field intptr Name
#field intptr Comment
#endstruct
stdim st, SecPkgInfoA ; NSTRUCT 変数を確保
st->fCapabilities = 100
mes "fCapabilities=" + st->fCapabilities