ホーム › Security.Cryptography › CMSG_CTRL_MAIL_LIST_DECRYPT_PARA
CMSG_CTRL_MAIL_LIST_DECRYPT_PARA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| cbSize | DWORD | 4 | +0 | +0 | この構造体のサイズ(バイト単位)。 |
| hCryptProv | UINT_PTR | 8/4 | +8 | +4 | 復号に使う暗号プロバイダハンドル(UINT_PTR)。 |
| pMailList | CMSG_MAIL_LIST_RECIPIENT_INFO* | 8/4 | +16 | +8 | 復号対象のメールリスト受信者情報へのポインタ。 |
| dwRecipientIndex | DWORD | 4 | +24 | +12 | 復号対象とする受信者のインデックス(0始まり)。 |
| dwKeyChoice | DWORD | 4 | +28 | +16 | 鍵の指定方法を示す選択子。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +32 | +20 | 選択子に応じた鍵ハンドルなどを保持する共用体。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| hKeyEncryptionKey | UINT_PTR | 8/4 | +0 | +0 |
| pvKeyEncryptionKey | void* | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// CMSG_CTRL_MAIL_LIST_DECRYPT_PARA (x64 40 / x86 24 バイト)
typedef struct CMSG_CTRL_MAIL_LIST_DECRYPT_PARA {
DWORD cbSize;
UINT_PTR hCryptProv;
CMSG_MAIL_LIST_RECIPIENT_INFO* pMailList;
DWORD dwRecipientIndex;
DWORD dwKeyChoice;
_Anonymous_e__Union Anonymous;
} CMSG_CTRL_MAIL_LIST_DECRYPT_PARA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CMSG_CTRL_MAIL_LIST_DECRYPT_PARA
{
public uint cbSize;
public UIntPtr hCryptProv;
public IntPtr pMailList;
public uint dwRecipientIndex;
public uint dwKeyChoice;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CMSG_CTRL_MAIL_LIST_DECRYPT_PARA
Public cbSize As UInteger
Public hCryptProv As UIntPtr
Public pMailList As IntPtr
Public dwRecipientIndex As UInteger
Public dwKeyChoice As UInteger
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class CMSG_CTRL_MAIL_LIST_DECRYPT_PARA(ctypes.Structure):
_fields_ = [
("cbSize", wintypes.DWORD),
("hCryptProv", ctypes.c_size_t),
("pMailList", ctypes.c_void_p),
("dwRecipientIndex", wintypes.DWORD),
("dwKeyChoice", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct CMSG_CTRL_MAIL_LIST_DECRYPT_PARA {
pub cbSize: u32,
pub hCryptProv: usize,
pub pMailList: *mut core::ffi::c_void,
pub dwRecipientIndex: u32,
pub dwKeyChoice: u32,
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type CMSG_CTRL_MAIL_LIST_DECRYPT_PARA struct {
cbSize uint32
hCryptProv uintptr
pMailList uintptr
dwRecipientIndex uint32
dwKeyChoice uint32
Anonymous _Anonymous_e__Union
}type
CMSG_CTRL_MAIL_LIST_DECRYPT_PARA = record
cbSize: DWORD;
hCryptProv: NativeUInt;
pMailList: Pointer;
dwRecipientIndex: DWORD;
dwKeyChoice: DWORD;
Anonymous: _Anonymous_e__Union;
end;const CMSG_CTRL_MAIL_LIST_DECRYPT_PARA = extern struct {
cbSize: u32,
hCryptProv: usize,
pMailList: ?*anyopaque,
dwRecipientIndex: u32,
dwKeyChoice: u32,
Anonymous: _Anonymous_e__Union,
};type
CMSG_CTRL_MAIL_LIST_DECRYPT_PARA {.bycopy.} = object
cbSize: uint32
hCryptProv: uint
pMailList: pointer
dwRecipientIndex: uint32
dwKeyChoice: uint32
Anonymous: _Anonymous_e__Unionstruct CMSG_CTRL_MAIL_LIST_DECRYPT_PARA
{
uint cbSize;
size_t hCryptProv;
void* pMailList;
uint dwRecipientIndex;
uint dwKeyChoice;
_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 レイアウト)
; CMSG_CTRL_MAIL_LIST_DECRYPT_PARA サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hCryptProv : UINT_PTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; pMailList : CMSG_MAIL_LIST_RECIPIENT_INFO* (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; dwRecipientIndex : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; dwKeyChoice : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CMSG_CTRL_MAIL_LIST_DECRYPT_PARA サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; cbSize : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; hCryptProv : UINT_PTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; pMailList : CMSG_MAIL_LIST_RECIPIENT_INFO* (+16, 8byte) varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; dwRecipientIndex : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwKeyChoice : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CMSG_CTRL_MAIL_LIST_DECRYPT_PARA
#field int cbSize
#field intptr hCryptProv
#field intptr pMailList
#field int dwRecipientIndex
#field int dwKeyChoice
#field byte Anonymous 8
#endstruct
stdim st, CMSG_CTRL_MAIL_LIST_DECRYPT_PARA ; NSTRUCT 変数を確保
st->cbSize = 100
mes "cbSize=" + st->cbSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。