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

WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO

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

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

フィールド

フィールドサイズx64x86説明
Anonymous_Anonymous_e__Union4+0+0構造体サイズ等を保持する共用体。
pChainContextCERT_CHAIN_CONTEXT*8/4+8+4署名者の証明書チェーンコンテキストへのポインタ。
dwSignerTypeDWORD4+16+8署名者の種別を表す。
pMsgSignerInfoCMSG_SIGNER_INFO*8/4+24+12CMSG署名者情報構造体へのポインタ。
dwErrorDWORD4+32+16署名者検証のエラーコードを表す。
cCounterSignerDWORD4+36+20rgpCounterSigner配列に含まれる副署名者数。
rgpCounterSignerWTD_GENERIC_CHAIN_POLICY_SIGNER_INFO**8/4+40+24副署名者情報へのポインタの配列。

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

フィールドサイズx64x86
cbStructDWORD4+0+0
cbSizeDWORD4+0+0

各言語での定義

#include <windows.h>

// WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO  (x64 48 / x86 28 バイト)
typedef struct WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO {
    _Anonymous_e__Union Anonymous;
    CERT_CHAIN_CONTEXT* pChainContext;
    DWORD dwSignerType;
    CMSG_SIGNER_INFO* pMsgSignerInfo;
    DWORD dwError;
    DWORD cCounterSigner;
    WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO** rgpCounterSigner;
} WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO
{
    public _Anonymous_e__Union Anonymous;
    public IntPtr pChainContext;
    public uint dwSignerType;
    public IntPtr pMsgSignerInfo;
    public uint dwError;
    public uint cCounterSigner;
    public IntPtr rgpCounterSigner;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO
    Public Anonymous As _Anonymous_e__Union
    Public pChainContext As IntPtr
    Public dwSignerType As UInteger
    Public pMsgSignerInfo As IntPtr
    Public dwError As UInteger
    Public cCounterSigner As UInteger
    Public rgpCounterSigner As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO(ctypes.Structure):
    _fields_ = [
        ("Anonymous", _Anonymous_e__Union),
        ("pChainContext", ctypes.c_void_p),
        ("dwSignerType", wintypes.DWORD),
        ("pMsgSignerInfo", ctypes.c_void_p),
        ("dwError", wintypes.DWORD),
        ("cCounterSigner", wintypes.DWORD),
        ("rgpCounterSigner", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO {
    pub Anonymous: _Anonymous_e__Union,
    pub pChainContext: *mut core::ffi::c_void,
    pub dwSignerType: u32,
    pub pMsgSignerInfo: *mut core::ffi::c_void,
    pub dwError: u32,
    pub cCounterSigner: u32,
    pub rgpCounterSigner: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO struct {
	Anonymous _Anonymous_e__Union
	pChainContext uintptr
	dwSignerType uint32
	pMsgSignerInfo uintptr
	dwError uint32
	cCounterSigner uint32
	rgpCounterSigner uintptr
}
type
  WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO = record
    Anonymous: _Anonymous_e__Union;
    pChainContext: Pointer;
    dwSignerType: DWORD;
    pMsgSignerInfo: Pointer;
    dwError: DWORD;
    cCounterSigner: DWORD;
    rgpCounterSigner: Pointer;
  end;
const WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO = extern struct {
    Anonymous: _Anonymous_e__Union,
    pChainContext: ?*anyopaque,
    dwSignerType: u32,
    pMsgSignerInfo: ?*anyopaque,
    dwError: u32,
    cCounterSigner: u32,
    rgpCounterSigner: ?*anyopaque,
};
type
  WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO {.bycopy.} = object
    Anonymous: _Anonymous_e__Union
    pChainContext: pointer
    dwSignerType: uint32
    pMsgSignerInfo: pointer
    dwError: uint32
    cCounterSigner: uint32
    rgpCounterSigner: pointer
struct WTD_GENERIC_CHAIN_POLICY_SIGNER_INFO
{
    _Anonymous_e__Union Anonymous;
    void* pChainContext;
    uint dwSignerType;
    void* pMsgSignerInfo;
    uint dwError;
    uint cCounterSigner;
    void* rgpCounterSigner;
}

HSP用 定義

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

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

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