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

SIGNER_SPC_CHAIN_INFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイト単位サイズ。呼び出し前に設定する。
pwszSpcFileLPWSTR8/4+8+4SPC証明書ファイルのパスを示すワイド文字列。
dwCertPolicyDWORD4+16+8証明書チェーンの埋め込みポリシーを示すフラグ。
hCertStoreHCERTSTORE8/4+24+12証明書を含むストアのハンドル。NULL可。

各言語での定義

#include <windows.h>

// SIGNER_SPC_CHAIN_INFO  (x64 32 / x86 16 バイト)
typedef struct SIGNER_SPC_CHAIN_INFO {
    DWORD cbSize;
    LPWSTR pwszSpcFile;
    DWORD dwCertPolicy;
    HCERTSTORE hCertStore;
} SIGNER_SPC_CHAIN_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIGNER_SPC_CHAIN_INFO
{
    public uint cbSize;
    public IntPtr pwszSpcFile;
    public uint dwCertPolicy;
    public IntPtr hCertStore;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SIGNER_SPC_CHAIN_INFO
    Public cbSize As UInteger
    Public pwszSpcFile As IntPtr
    Public dwCertPolicy As UInteger
    Public hCertStore As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class SIGNER_SPC_CHAIN_INFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("pwszSpcFile", ctypes.c_void_p),
        ("dwCertPolicy", wintypes.DWORD),
        ("hCertStore", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct SIGNER_SPC_CHAIN_INFO {
    pub cbSize: u32,
    pub pwszSpcFile: *mut core::ffi::c_void,
    pub dwCertPolicy: u32,
    pub hCertStore: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type SIGNER_SPC_CHAIN_INFO struct {
	cbSize uint32
	pwszSpcFile uintptr
	dwCertPolicy uint32
	hCertStore uintptr
}
type
  SIGNER_SPC_CHAIN_INFO = record
    cbSize: DWORD;
    pwszSpcFile: Pointer;
    dwCertPolicy: DWORD;
    hCertStore: Pointer;
  end;
const SIGNER_SPC_CHAIN_INFO = extern struct {
    cbSize: u32,
    pwszSpcFile: ?*anyopaque,
    dwCertPolicy: u32,
    hCertStore: ?*anyopaque,
};
type
  SIGNER_SPC_CHAIN_INFO {.bycopy.} = object
    cbSize: uint32
    pwszSpcFile: pointer
    dwCertPolicy: uint32
    hCertStore: pointer
struct SIGNER_SPC_CHAIN_INFO
{
    uint cbSize;
    void* pwszSpcFile;
    uint dwCertPolicy;
    void* hCertStore;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; SIGNER_SPC_CHAIN_INFO サイズ: 16 バイト(x86)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pwszSpcFile : LPWSTR (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwCertPolicy : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; hCertStore : HCERTSTORE (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SIGNER_SPC_CHAIN_INFO サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; pwszSpcFile : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwCertPolicy : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; hCertStore : HCERTSTORE (+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 SIGNER_SPC_CHAIN_INFO
    #field int cbSize
    #field intptr pwszSpcFile
    #field int dwCertPolicy
    #field intptr hCertStore
#endstruct

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