Win32 API 日本語リファレンス
ホームDevices.BiometricFramework › WINBIO_ENCRYPTED_CAPTURE_PARAMS

WINBIO_ENCRYPTED_CAPTURE_PARAMS

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

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

フィールド

フィールドサイズx64x86説明
PayloadSizeDWORD4+0+0この暗号化キャプチャパラメータ構造体のバイト単位サイズを示す。
PurposeBYTE1+4+4キャプチャの目的を示すフラグ。識別・検証・登録など用途を表す。
FormatWINBIO_REGISTERED_FORMAT4+6+6サンプルの標準データフォーマットを指定するWINBIO_REGISTERED_FORMAT。
VendorFormatGUID16+12+12ベンダー定義フォーマットを識別するGUID。標準フォーマット未使用時に用いる。
FlagsBYTE1+28+28キャプチャ動作を制御するフラグ。暗号化要求などのビットを含む。
NonceSizeDWORD4+32+32暗号化に用いるノンス(使い捨て乱数)のバイト単位サイズを示す。

各言語での定義

#include <windows.h>

// WINBIO_REGISTERED_FORMAT  (x64 4 / x86 4 バイト)
typedef struct WINBIO_REGISTERED_FORMAT {
    WORD Owner;
    WORD Type;
} WINBIO_REGISTERED_FORMAT;

// WINBIO_ENCRYPTED_CAPTURE_PARAMS  (x64 36 / x86 36 バイト)
typedef struct WINBIO_ENCRYPTED_CAPTURE_PARAMS {
    DWORD PayloadSize;
    BYTE Purpose;
    WINBIO_REGISTERED_FORMAT Format;
    GUID VendorFormat;
    BYTE Flags;
    DWORD NonceSize;
} WINBIO_ENCRYPTED_CAPTURE_PARAMS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WINBIO_REGISTERED_FORMAT
{
    public ushort Owner;
    public ushort Type;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WINBIO_ENCRYPTED_CAPTURE_PARAMS
{
    public uint PayloadSize;
    public byte Purpose;
    public WINBIO_REGISTERED_FORMAT Format;
    public Guid VendorFormat;
    public byte Flags;
    public uint NonceSize;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WINBIO_REGISTERED_FORMAT
    Public Owner As UShort
    Public Type As UShort
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WINBIO_ENCRYPTED_CAPTURE_PARAMS
    Public PayloadSize As UInteger
    Public Purpose As Byte
    Public Format As WINBIO_REGISTERED_FORMAT
    Public VendorFormat As Guid
    Public Flags As Byte
    Public NonceSize As UInteger
End Structure
import ctypes
from ctypes import wintypes

class WINBIO_REGISTERED_FORMAT(ctypes.Structure):
    _fields_ = [
        ("Owner", ctypes.c_ushort),
        ("Type", ctypes.c_ushort),
    ]

class WINBIO_ENCRYPTED_CAPTURE_PARAMS(ctypes.Structure):
    _fields_ = [
        ("PayloadSize", wintypes.DWORD),
        ("Purpose", ctypes.c_ubyte),
        ("Format", WINBIO_REGISTERED_FORMAT),
        ("VendorFormat", GUID),
        ("Flags", ctypes.c_ubyte),
        ("NonceSize", wintypes.DWORD),
    ]
#[repr(C)]
pub struct WINBIO_REGISTERED_FORMAT {
    pub Owner: u16,
    pub Type: u16,
}

#[repr(C)]
pub struct WINBIO_ENCRYPTED_CAPTURE_PARAMS {
    pub PayloadSize: u32,
    pub Purpose: u8,
    pub Format: WINBIO_REGISTERED_FORMAT,
    pub VendorFormat: GUID,
    pub Flags: u8,
    pub NonceSize: u32,
}
import "golang.org/x/sys/windows"

type WINBIO_REGISTERED_FORMAT struct {
	Owner uint16
	Type uint16
}

type WINBIO_ENCRYPTED_CAPTURE_PARAMS struct {
	PayloadSize uint32
	Purpose byte
	Format WINBIO_REGISTERED_FORMAT
	VendorFormat windows.GUID
	Flags byte
	NonceSize uint32
}
type
  WINBIO_REGISTERED_FORMAT = record
    Owner: Word;
    Type: Word;
  end;

  WINBIO_ENCRYPTED_CAPTURE_PARAMS = record
    PayloadSize: DWORD;
    Purpose: Byte;
    Format: WINBIO_REGISTERED_FORMAT;
    VendorFormat: TGUID;
    Flags: Byte;
    NonceSize: DWORD;
  end;
const WINBIO_REGISTERED_FORMAT = extern struct {
    Owner: u16,
    Type: u16,
};

const WINBIO_ENCRYPTED_CAPTURE_PARAMS = extern struct {
    PayloadSize: u32,
    Purpose: u8,
    Format: WINBIO_REGISTERED_FORMAT,
    VendorFormat: GUID,
    Flags: u8,
    NonceSize: u32,
};
type
  WINBIO_REGISTERED_FORMAT {.bycopy.} = object
    Owner: uint16
    Type: uint16

  WINBIO_ENCRYPTED_CAPTURE_PARAMS {.bycopy.} = object
    PayloadSize: uint32
    Purpose: uint8
    Format: WINBIO_REGISTERED_FORMAT
    VendorFormat: GUID
    Flags: uint8
    NonceSize: uint32
struct WINBIO_REGISTERED_FORMAT
{
    ushort Owner;
    ushort Type;
}

struct WINBIO_ENCRYPTED_CAPTURE_PARAMS
{
    uint PayloadSize;
    ubyte Purpose;
    WINBIO_REGISTERED_FORMAT Format;
    GUID VendorFormat;
    ubyte Flags;
    uint NonceSize;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WINBIO_ENCRYPTED_CAPTURE_PARAMS サイズ: 36 バイト(x64)
dim st, 9    ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; PayloadSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Purpose : BYTE (+4, 1byte)  poke st,4,値  /  値 = peek(st,4)
; Format : WINBIO_REGISTERED_FORMAT (+6, 4byte)  varptr(st)+6 を基点に操作(4byte:入れ子/配列)
; VendorFormat : GUID (+12, 16byte)  varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; Flags : BYTE (+28, 1byte)  poke st,28,値  /  値 = peek(st,28)
; NonceSize : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WINBIO_REGISTERED_FORMAT
    #field short Owner
    #field short Type
#endstruct

#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global WINBIO_ENCRYPTED_CAPTURE_PARAMS
    #field int PayloadSize
    #field byte Purpose
    #field WINBIO_REGISTERED_FORMAT Format
    #field GUID VendorFormat
    #field byte Flags
    #field int NonceSize
#endstruct

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