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

CMSG_SIGNED_ENCODE_INFO

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

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

フィールド

フィールドサイズx64x86説明
cbSizeDWORD4+0+0この構造体のサイズ(バイト単位)。
cSignersDWORD4+4+4rgSigners配列の要素数。
rgSignersCMSG_SIGNER_ENCODE_INFO*8/4+8+8署名者ごとのエンコード情報の配列へのポインタ。
cCertEncodedDWORD4+16+12rgCertEncoded配列の要素数。
rgCertEncodedCRYPT_INTEGER_BLOB*8/4+24+16メッセージに含めるエンコード済み証明書BLOBの配列へのポインタ。NULL可。
cCrlEncodedDWORD4+32+20rgCrlEncoded配列の要素数。
rgCrlEncodedCRYPT_INTEGER_BLOB*8/4+40+24メッセージに含めるエンコード済みCRL BLOBの配列へのポインタ。NULL可。

各言語での定義

#include <windows.h>

// CMSG_SIGNED_ENCODE_INFO  (x64 48 / x86 28 バイト)
typedef struct CMSG_SIGNED_ENCODE_INFO {
    DWORD cbSize;
    DWORD cSigners;
    CMSG_SIGNER_ENCODE_INFO* rgSigners;
    DWORD cCertEncoded;
    CRYPT_INTEGER_BLOB* rgCertEncoded;
    DWORD cCrlEncoded;
    CRYPT_INTEGER_BLOB* rgCrlEncoded;
} CMSG_SIGNED_ENCODE_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CMSG_SIGNED_ENCODE_INFO
{
    public uint cbSize;
    public uint cSigners;
    public IntPtr rgSigners;
    public uint cCertEncoded;
    public IntPtr rgCertEncoded;
    public uint cCrlEncoded;
    public IntPtr rgCrlEncoded;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CMSG_SIGNED_ENCODE_INFO
    Public cbSize As UInteger
    Public cSigners As UInteger
    Public rgSigners As IntPtr
    Public cCertEncoded As UInteger
    Public rgCertEncoded As IntPtr
    Public cCrlEncoded As UInteger
    Public rgCrlEncoded As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class CMSG_SIGNED_ENCODE_INFO(ctypes.Structure):
    _fields_ = [
        ("cbSize", wintypes.DWORD),
        ("cSigners", wintypes.DWORD),
        ("rgSigners", ctypes.c_void_p),
        ("cCertEncoded", wintypes.DWORD),
        ("rgCertEncoded", ctypes.c_void_p),
        ("cCrlEncoded", wintypes.DWORD),
        ("rgCrlEncoded", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct CMSG_SIGNED_ENCODE_INFO {
    pub cbSize: u32,
    pub cSigners: u32,
    pub rgSigners: *mut core::ffi::c_void,
    pub cCertEncoded: u32,
    pub rgCertEncoded: *mut core::ffi::c_void,
    pub cCrlEncoded: u32,
    pub rgCrlEncoded: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type CMSG_SIGNED_ENCODE_INFO struct {
	cbSize uint32
	cSigners uint32
	rgSigners uintptr
	cCertEncoded uint32
	rgCertEncoded uintptr
	cCrlEncoded uint32
	rgCrlEncoded uintptr
}
type
  CMSG_SIGNED_ENCODE_INFO = record
    cbSize: DWORD;
    cSigners: DWORD;
    rgSigners: Pointer;
    cCertEncoded: DWORD;
    rgCertEncoded: Pointer;
    cCrlEncoded: DWORD;
    rgCrlEncoded: Pointer;
  end;
const CMSG_SIGNED_ENCODE_INFO = extern struct {
    cbSize: u32,
    cSigners: u32,
    rgSigners: ?*anyopaque,
    cCertEncoded: u32,
    rgCertEncoded: ?*anyopaque,
    cCrlEncoded: u32,
    rgCrlEncoded: ?*anyopaque,
};
type
  CMSG_SIGNED_ENCODE_INFO {.bycopy.} = object
    cbSize: uint32
    cSigners: uint32
    rgSigners: pointer
    cCertEncoded: uint32
    rgCertEncoded: pointer
    cCrlEncoded: uint32
    rgCrlEncoded: pointer
struct CMSG_SIGNED_ENCODE_INFO
{
    uint cbSize;
    uint cSigners;
    void* rgSigners;
    uint cCertEncoded;
    void* rgCertEncoded;
    uint cCrlEncoded;
    void* rgCrlEncoded;
}

HSP用 定義

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

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

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