ホーム › Security.Cryptography › CRYPT_XML_KEY_INFO_ITEM
CRYPT_XML_KEY_INFO_ITEM
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwType | CRYPT_XML_KEYINFO_TYPE | 4 | +0 | +0 | KeyInfo項目の種別を示す列挙値。 |
| Anonymous | _Anonymous_e__Union | 120/60 | +8 | +4 | 種別に応じた鍵情報を保持する無名共用体。 |
共用体: _Anonymous_e__Union x64 120B / x86 60B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| wszKeyName | LPWSTR | 8/4 | +0 | +0 |
| KeyValue | CRYPT_XML_KEY_VALUE | 120/60 | +0 | +0 |
| RetrievalMethod | CRYPT_XML_BLOB | 16/12 | +0 | +0 |
| X509Data | CRYPT_XML_X509DATA | 16/8 | +0 | +0 |
| Custom | CRYPT_XML_BLOB | 16/12 | +0 | +0 |
各言語での定義
#include <windows.h>
// CRYPT_XML_KEY_INFO_ITEM (x64 128 / x86 64 バイト)
typedef struct CRYPT_XML_KEY_INFO_ITEM {
CRYPT_XML_KEYINFO_TYPE dwType;
_Anonymous_e__Union Anonymous;
} CRYPT_XML_KEY_INFO_ITEM;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRYPT_XML_KEY_INFO_ITEM
{
public uint dwType;
public _Anonymous_e__Union Anonymous;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRYPT_XML_KEY_INFO_ITEM
Public dwType As UInteger
Public Anonymous As _Anonymous_e__Union
End Structureimport ctypes
from ctypes import wintypes
class CRYPT_XML_KEY_INFO_ITEM(ctypes.Structure):
_fields_ = [
("dwType", wintypes.DWORD),
("Anonymous", _Anonymous_e__Union),
]#[repr(C)]
pub struct CRYPT_XML_KEY_INFO_ITEM {
pub dwType: u32,
pub Anonymous: _Anonymous_e__Union,
}import "golang.org/x/sys/windows"
type CRYPT_XML_KEY_INFO_ITEM struct {
dwType uint32
Anonymous _Anonymous_e__Union
}type
CRYPT_XML_KEY_INFO_ITEM = record
dwType: DWORD;
Anonymous: _Anonymous_e__Union;
end;const CRYPT_XML_KEY_INFO_ITEM = extern struct {
dwType: u32,
Anonymous: _Anonymous_e__Union,
};type
CRYPT_XML_KEY_INFO_ITEM {.bycopy.} = object
dwType: uint32
Anonymous: _Anonymous_e__Unionstruct CRYPT_XML_KEY_INFO_ITEM
{
uint dwType;
_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 レイアウト)
; CRYPT_XML_KEY_INFO_ITEM サイズ: 64 バイト(x86)
dim st, 16 ; 4byte整数×16(構造体サイズ 64 / 4 切り上げ)
; dwType : CRYPT_XML_KEYINFO_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+4, 60byte) varptr(st)+4 を基点に操作(60byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CRYPT_XML_KEY_INFO_ITEM サイズ: 128 バイト(x64)
dim st, 32 ; 4byte整数×32(構造体サイズ 128 / 4 切り上げ)
; dwType : CRYPT_XML_KEYINFO_TYPE (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 120byte) varptr(st)+8 を基点に操作(120byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CRYPT_XML_KEY_INFO_ITEM
#field int dwType
#field byte Anonymous 120
#endstruct
stdim st, CRYPT_XML_KEY_INFO_ITEM ; NSTRUCT 変数を確保
st->dwType = 100
mes "dwType=" + st->dwType
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。