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

CRYPT_INTERFACE_REG

構造体
サイズx64: 24 バイト / x86: 16 バイト

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

フィールド

フィールドサイズx64x86説明
dwInterfaceBCRYPT_INTERFACE4+0+0登録対象のCNGインターフェイス識別子。暗号化や署名などの機能種別を示す。
dwFlagsBCRYPT_TABLE4+4+4インターフェイス登録テーブルの種別を示すフラグ(CRYPT_DOMAIN/CRYPT_LOCAL等)。
cFunctionsDWORD4+8+8登録される関数(アルゴリズム)名の個数。rgpszFunctionsの要素数。
rgpszFunctionsLPWSTR*8/4+16+12登録する関数名文字列の配列へのポインタ。各要素がアルゴリズム名を表す。

各言語での定義

#include <windows.h>

// CRYPT_INTERFACE_REG  (x64 24 / x86 16 バイト)
typedef struct CRYPT_INTERFACE_REG {
    BCRYPT_INTERFACE dwInterface;
    BCRYPT_TABLE dwFlags;
    DWORD cFunctions;
    LPWSTR* rgpszFunctions;
} CRYPT_INTERFACE_REG;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CRYPT_INTERFACE_REG
{
    public uint dwInterface;
    public uint dwFlags;
    public uint cFunctions;
    public IntPtr rgpszFunctions;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CRYPT_INTERFACE_REG
    Public dwInterface As UInteger
    Public dwFlags As UInteger
    Public cFunctions As UInteger
    Public rgpszFunctions As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class CRYPT_INTERFACE_REG(ctypes.Structure):
    _fields_ = [
        ("dwInterface", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("cFunctions", wintypes.DWORD),
        ("rgpszFunctions", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct CRYPT_INTERFACE_REG {
    pub dwInterface: u32,
    pub dwFlags: u32,
    pub cFunctions: u32,
    pub rgpszFunctions: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type CRYPT_INTERFACE_REG struct {
	dwInterface uint32
	dwFlags uint32
	cFunctions uint32
	rgpszFunctions uintptr
}
type
  CRYPT_INTERFACE_REG = record
    dwInterface: DWORD;
    dwFlags: DWORD;
    cFunctions: DWORD;
    rgpszFunctions: Pointer;
  end;
const CRYPT_INTERFACE_REG = extern struct {
    dwInterface: u32,
    dwFlags: u32,
    cFunctions: u32,
    rgpszFunctions: ?*anyopaque,
};
type
  CRYPT_INTERFACE_REG {.bycopy.} = object
    dwInterface: uint32
    dwFlags: uint32
    cFunctions: uint32
    rgpszFunctions: pointer
struct CRYPT_INTERFACE_REG
{
    uint dwInterface;
    uint dwFlags;
    uint cFunctions;
    void* rgpszFunctions;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CRYPT_INTERFACE_REG サイズ: 16 バイト(x86)
dim st, 4    ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; dwInterface : BCRYPT_INTERFACE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : BCRYPT_TABLE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cFunctions : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; rgpszFunctions : LPWSTR* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CRYPT_INTERFACE_REG サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwInterface : BCRYPT_INTERFACE (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : BCRYPT_TABLE (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; cFunctions : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; rgpszFunctions : LPWSTR* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CRYPT_INTERFACE_REG
    #field int dwInterface
    #field int dwFlags
    #field int cFunctions
    #field intptr rgpszFunctions
#endstruct

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