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

SIGNER_SUBJECT_INFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のバイト単位サイズ。呼び出し前に設定する。
pdwIndexDWORD*8/4+8+4処理対象の主体インデックスを示すDWORDへのポインタ。
dwSubjectChoiceSIGNER_SUBJECT_CHOICE4+16+8署名対象の種別(ファイル/BLOB)を示す列挙値。
Anonymous_Anonymous_e__Union8/4+24+12選択方式に応じた対象情報を保持する無名共用体。

共用体: _Anonymous_e__Union x64 8B / x86 4B

フィールドサイズx64x86
pSignerFileInfoSIGNER_FILE_INFO*8/4+0+0
pSignerBlobInfoSIGNER_BLOB_INFO*8/4+0+0

各言語での定義

#include <windows.h>

// SIGNER_SUBJECT_INFO  (x64 32 / x86 16 バイト)
typedef struct SIGNER_SUBJECT_INFO {
    DWORD cbSize;
    DWORD* pdwIndex;
    SIGNER_SUBJECT_CHOICE dwSubjectChoice;
    _Anonymous_e__Union Anonymous;
} SIGNER_SUBJECT_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SIGNER_SUBJECT_INFO
{
    public uint cbSize;
    public IntPtr pdwIndex;
    public uint dwSubjectChoice;
    public _Anonymous_e__Union Anonymous;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SIGNER_SUBJECT_INFO
    Public cbSize As UInteger
    Public pdwIndex As IntPtr
    Public dwSubjectChoice As UInteger
    Public Anonymous As _Anonymous_e__Union
End Structure
import ctypes
from ctypes import wintypes

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

type SIGNER_SUBJECT_INFO struct {
	cbSize uint32
	pdwIndex uintptr
	dwSubjectChoice uint32
	Anonymous _Anonymous_e__Union
}
type
  SIGNER_SUBJECT_INFO = record
    cbSize: DWORD;
    pdwIndex: Pointer;
    dwSubjectChoice: DWORD;
    Anonymous: _Anonymous_e__Union;
  end;
const SIGNER_SUBJECT_INFO = extern struct {
    cbSize: u32,
    pdwIndex: ?*anyopaque,
    dwSubjectChoice: u32,
    Anonymous: _Anonymous_e__Union,
};
type
  SIGNER_SUBJECT_INFO {.bycopy.} = object
    cbSize: uint32
    pdwIndex: pointer
    dwSubjectChoice: uint32
    Anonymous: _Anonymous_e__Union
struct SIGNER_SUBJECT_INFO
{
    uint cbSize;
    void* pdwIndex;
    uint dwSubjectChoice;
    _Anonymous_e__Union Anonymous;
}

HSP用 定義

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

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

stdim st, SIGNER_SUBJECT_INFO        ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。