ホーム › Security.Cryptography › CMC_ADD_ATTRIBUTES_INFO
CMC_ADD_ATTRIBUTES_INFO
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwCmcDataReference | DWORD | 4 | +0 | +0 | 属性を追加する対象のCMCデータ参照ID(ボディパートID)。 |
| cCertReference | DWORD | 4 | +4 | +4 | rgdwCertReference配列の要素数。 |
| rgdwCertReference | DWORD* | 8/4 | +8 | +8 | 属性を適用する証明書要求の参照IDの配列へのポインタ。 |
| cAttribute | DWORD | 4 | +16 | +12 | rgAttribute配列の要素数。 |
| rgAttribute | CRYPT_ATTRIBUTE* | 8/4 | +24 | +16 | 追加する暗号属性(CRYPT_ATTRIBUTE)の配列へのポインタ。 |
各言語での定義
#include <windows.h>
// CMC_ADD_ATTRIBUTES_INFO (x64 32 / x86 20 バイト)
typedef struct CMC_ADD_ATTRIBUTES_INFO {
DWORD dwCmcDataReference;
DWORD cCertReference;
DWORD* rgdwCertReference;
DWORD cAttribute;
CRYPT_ATTRIBUTE* rgAttribute;
} CMC_ADD_ATTRIBUTES_INFO;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CMC_ADD_ATTRIBUTES_INFO
{
public uint dwCmcDataReference;
public uint cCertReference;
public IntPtr rgdwCertReference;
public uint cAttribute;
public IntPtr rgAttribute;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CMC_ADD_ATTRIBUTES_INFO
Public dwCmcDataReference As UInteger
Public cCertReference As UInteger
Public rgdwCertReference As IntPtr
Public cAttribute As UInteger
Public rgAttribute As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class CMC_ADD_ATTRIBUTES_INFO(ctypes.Structure):
_fields_ = [
("dwCmcDataReference", wintypes.DWORD),
("cCertReference", wintypes.DWORD),
("rgdwCertReference", ctypes.c_void_p),
("cAttribute", wintypes.DWORD),
("rgAttribute", ctypes.c_void_p),
]#[repr(C)]
pub struct CMC_ADD_ATTRIBUTES_INFO {
pub dwCmcDataReference: u32,
pub cCertReference: u32,
pub rgdwCertReference: *mut core::ffi::c_void,
pub cAttribute: u32,
pub rgAttribute: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type CMC_ADD_ATTRIBUTES_INFO struct {
dwCmcDataReference uint32
cCertReference uint32
rgdwCertReference uintptr
cAttribute uint32
rgAttribute uintptr
}type
CMC_ADD_ATTRIBUTES_INFO = record
dwCmcDataReference: DWORD;
cCertReference: DWORD;
rgdwCertReference: Pointer;
cAttribute: DWORD;
rgAttribute: Pointer;
end;const CMC_ADD_ATTRIBUTES_INFO = extern struct {
dwCmcDataReference: u32,
cCertReference: u32,
rgdwCertReference: ?*anyopaque,
cAttribute: u32,
rgAttribute: ?*anyopaque,
};type
CMC_ADD_ATTRIBUTES_INFO {.bycopy.} = object
dwCmcDataReference: uint32
cCertReference: uint32
rgdwCertReference: pointer
cAttribute: uint32
rgAttribute: pointerstruct CMC_ADD_ATTRIBUTES_INFO
{
uint dwCmcDataReference;
uint cCertReference;
void* rgdwCertReference;
uint cAttribute;
void* rgAttribute;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CMC_ADD_ATTRIBUTES_INFO サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; dwCmcDataReference : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cCertReference : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; rgdwCertReference : DWORD* (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; cAttribute : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; rgAttribute : CRYPT_ATTRIBUTE* (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CMC_ADD_ATTRIBUTES_INFO サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; dwCmcDataReference : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; cCertReference : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; rgdwCertReference : DWORD* (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cAttribute : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; rgAttribute : CRYPT_ATTRIBUTE* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CMC_ADD_ATTRIBUTES_INFO
#field int dwCmcDataReference
#field int cCertReference
#field intptr rgdwCertReference
#field int cAttribute
#field intptr rgAttribute
#endstruct
stdim st, CMC_ADD_ATTRIBUTES_INFO ; NSTRUCT 変数を確保
st->dwCmcDataReference = 100
mes "dwCmcDataReference=" + st->dwCmcDataReference