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