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

SecPkgContext_RemoteCredentialInfo

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

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

フィールド

フィールドサイズx64x86説明
cbCertificateChainDWORD4+0+0リモート証明書チェーンのバイト数を示す。
pbCertificateChainBYTE*8/4+8+4リモート証明書チェーンのデータへのポインタ。
cCertificatesDWORD4+16+8チェーン内の証明書の個数を示す。
fFlagsDWORD4+20+12リモート資格情報に関するフラグを示す。
dwBitsDWORD4+24+16リモート公開鍵のビット長を示す。

各言語での定義

#include <windows.h>

// SecPkgContext_RemoteCredentialInfo  (x64 32 / x86 20 バイト)
typedef struct SecPkgContext_RemoteCredentialInfo {
    DWORD cbCertificateChain;
    BYTE* pbCertificateChain;
    DWORD cCertificates;
    DWORD fFlags;
    DWORD dwBits;
} SecPkgContext_RemoteCredentialInfo;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SecPkgContext_RemoteCredentialInfo
{
    public uint cbCertificateChain;
    public IntPtr pbCertificateChain;
    public uint cCertificates;
    public uint fFlags;
    public uint dwBits;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SecPkgContext_RemoteCredentialInfo
    Public cbCertificateChain As UInteger
    Public pbCertificateChain As IntPtr
    Public cCertificates As UInteger
    Public fFlags As UInteger
    Public dwBits As UInteger
End Structure
import ctypes
from ctypes import wintypes

class SecPkgContext_RemoteCredentialInfo(ctypes.Structure):
    _fields_ = [
        ("cbCertificateChain", wintypes.DWORD),
        ("pbCertificateChain", ctypes.c_void_p),
        ("cCertificates", wintypes.DWORD),
        ("fFlags", wintypes.DWORD),
        ("dwBits", wintypes.DWORD),
    ]
#[repr(C)]
pub struct SecPkgContext_RemoteCredentialInfo {
    pub cbCertificateChain: u32,
    pub pbCertificateChain: *mut core::ffi::c_void,
    pub cCertificates: u32,
    pub fFlags: u32,
    pub dwBits: u32,
}
import "golang.org/x/sys/windows"

type SecPkgContext_RemoteCredentialInfo struct {
	cbCertificateChain uint32
	pbCertificateChain uintptr
	cCertificates uint32
	fFlags uint32
	dwBits uint32
}
type
  SecPkgContext_RemoteCredentialInfo = record
    cbCertificateChain: DWORD;
    pbCertificateChain: Pointer;
    cCertificates: DWORD;
    fFlags: DWORD;
    dwBits: DWORD;
  end;
const SecPkgContext_RemoteCredentialInfo = extern struct {
    cbCertificateChain: u32,
    pbCertificateChain: ?*anyopaque,
    cCertificates: u32,
    fFlags: u32,
    dwBits: u32,
};
type
  SecPkgContext_RemoteCredentialInfo {.bycopy.} = object
    cbCertificateChain: uint32
    pbCertificateChain: pointer
    cCertificates: uint32
    fFlags: uint32
    dwBits: uint32
struct SecPkgContext_RemoteCredentialInfo
{
    uint cbCertificateChain;
    void* pbCertificateChain;
    uint cCertificates;
    uint fFlags;
    uint dwBits;
}

HSP用 定義

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

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

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