Win32 API 日本語リファレンス
ホームSecurity.Cryptography.Certificates › CAINFO

CAINFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイトサイズ。
CATypeENUM_CATYPES4+4+4認証局(CA)の種別を示すENUM_CATYPES値。
cCASignatureCertsDWORD4+8+8CAの署名用証明書の数。
cCAExchangeCertsDWORD4+12+12CAの交換用証明書の数。
cExitModulesDWORD4+16+16登録された出口(Exit)モジュールの数。
lPropIdMaxINT4+20+20利用可能なプロパティIDの最大値。
lRoleSeparationEnabledINT4+24+24ロール分離が有効かを示す値。非0で有効。
cKRACertUsedCountDWORD4+28+28鍵回復で使用するKRA証明書の数。
cKRACertCountDWORD4+32+32登録されたKRA(鍵回復エージェント)証明書の総数。
fAdvancedServerDWORD4+36+36サーバーがEnterprise/Advanced版かを示す値。

各言語での定義

#include <windows.h>

// CAINFO  (x64 40 / x86 40 バイト)
typedef struct CAINFO {
    DWORD cbSize;
    ENUM_CATYPES CAType;
    DWORD cCASignatureCerts;
    DWORD cCAExchangeCerts;
    DWORD cExitModules;
    INT lPropIdMax;
    INT lRoleSeparationEnabled;
    DWORD cKRACertUsedCount;
    DWORD cKRACertCount;
    DWORD fAdvancedServer;
} CAINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CAINFO
{
    public uint cbSize;
    public int CAType;
    public uint cCASignatureCerts;
    public uint cCAExchangeCerts;
    public uint cExitModules;
    public int lPropIdMax;
    public int lRoleSeparationEnabled;
    public uint cKRACertUsedCount;
    public uint cKRACertCount;
    public uint fAdvancedServer;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CAINFO
    Public cbSize As UInteger
    Public CAType As Integer
    Public cCASignatureCerts As UInteger
    Public cCAExchangeCerts As UInteger
    Public cExitModules As UInteger
    Public lPropIdMax As Integer
    Public lRoleSeparationEnabled As Integer
    Public cKRACertUsedCount As UInteger
    Public cKRACertCount As UInteger
    Public fAdvancedServer As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CAINFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("CAType", ctypes.c_int),
        ("cCASignatureCerts", wintypes.DWORD),
        ("cCAExchangeCerts", wintypes.DWORD),
        ("cExitModules", wintypes.DWORD),
        ("lPropIdMax", ctypes.c_int),
        ("lRoleSeparationEnabled", ctypes.c_int),
        ("cKRACertUsedCount", wintypes.DWORD),
        ("cKRACertCount", wintypes.DWORD),
        ("fAdvancedServer", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CAINFO {
    pub cbSize: u32,
    pub CAType: i32,
    pub cCASignatureCerts: u32,
    pub cCAExchangeCerts: u32,
    pub cExitModules: u32,
    pub lPropIdMax: i32,
    pub lRoleSeparationEnabled: i32,
    pub cKRACertUsedCount: u32,
    pub cKRACertCount: u32,
    pub fAdvancedServer: u32,
}
import "golang.org/x/sys/windows"

type CAINFO struct {
	cbSize uint32
	CAType int32
	cCASignatureCerts uint32
	cCAExchangeCerts uint32
	cExitModules uint32
	lPropIdMax int32
	lRoleSeparationEnabled int32
	cKRACertUsedCount uint32
	cKRACertCount uint32
	fAdvancedServer uint32
}
type
  CAINFO = record
    cbSize: DWORD;
    CAType: Integer;
    cCASignatureCerts: DWORD;
    cCAExchangeCerts: DWORD;
    cExitModules: DWORD;
    lPropIdMax: Integer;
    lRoleSeparationEnabled: Integer;
    cKRACertUsedCount: DWORD;
    cKRACertCount: DWORD;
    fAdvancedServer: DWORD;
  end;
const CAINFO = extern struct {
    cbSize: u32,
    CAType: i32,
    cCASignatureCerts: u32,
    cCAExchangeCerts: u32,
    cExitModules: u32,
    lPropIdMax: i32,
    lRoleSeparationEnabled: i32,
    cKRACertUsedCount: u32,
    cKRACertCount: u32,
    fAdvancedServer: u32,
};
type
  CAINFO {.bycopy.} = object
    cbSize: uint32
    CAType: int32
    cCASignatureCerts: uint32
    cCAExchangeCerts: uint32
    cExitModules: uint32
    lPropIdMax: int32
    lRoleSeparationEnabled: int32
    cKRACertUsedCount: uint32
    cKRACertCount: uint32
    fAdvancedServer: uint32
struct CAINFO
{
    uint cbSize;
    int CAType;
    uint cCASignatureCerts;
    uint cCAExchangeCerts;
    uint cExitModules;
    int lPropIdMax;
    int lRoleSeparationEnabled;
    uint cKRACertUsedCount;
    uint cKRACertCount;
    uint fAdvancedServer;
}

HSP用 定義

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

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

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