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

WINBIO_SENSOR_ATTRIBUTES

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

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

フィールド

フィールドサイズx64x86説明
PayloadSizeDWORD4+0+0この構造体に続くペイロード全体のバイト数。
WinBioHresultHRESULT4+4+4属性取得処理の結果を示すHRESULT。
WinBioVersionWINBIO_VERSION8+8+8Windows生体認証フレームワークのバージョン。
SensorTypeDWORD4+16+16センサの種別(指紋・顔等)を示す値。
SensorSubTypeDWORD4+20+20センサのサブタイプを示す値。
CapabilitiesDWORD4+24+24センサの能力を示すビットフラグ。
ManufacturerNameWORD512+28+28製造元名を格納する固定長ワイド文字配列。
ModelNameWORD512+540+540モデル名を格納する固定長ワイド文字配列。
SerialNumberWORD512+1052+1052シリアル番号を格納する固定長ワイド文字配列。
FirmwareVersionWINBIO_VERSION8+1564+1564ファームウェアのバージョン(WINBIO_VERSION)。
SupportedFormatEntriesDWORD4+1572+1572対応する生体データ形式の数。
SupportedFormatWINBIO_REGISTERED_FORMAT4+1576+1576対応形式の配列の先頭要素(WINBIO_REGISTERED_FORMAT)。

各言語での定義

#include <windows.h>

// WINBIO_VERSION  (x64 8 / x86 8 バイト)
typedef struct WINBIO_VERSION {
    DWORD MajorVersion;
    DWORD MinorVersion;
} WINBIO_VERSION;

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

// WINBIO_SENSOR_ATTRIBUTES  (x64 1580 / x86 1580 バイト)
typedef struct WINBIO_SENSOR_ATTRIBUTES {
    DWORD PayloadSize;
    HRESULT WinBioHresult;
    WINBIO_VERSION WinBioVersion;
    DWORD SensorType;
    DWORD SensorSubType;
    DWORD Capabilities;
    WORD ManufacturerName[256];
    WORD ModelName[256];
    WORD SerialNumber[256];
    WINBIO_VERSION FirmwareVersion;
    DWORD SupportedFormatEntries;
    WINBIO_REGISTERED_FORMAT SupportedFormat[1];
} WINBIO_SENSOR_ATTRIBUTES;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WINBIO_VERSION
{
    public uint MajorVersion;
    public uint MinorVersion;
}

[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_SENSOR_ATTRIBUTES
{
    public uint PayloadSize;
    public int WinBioHresult;
    public WINBIO_VERSION WinBioVersion;
    public uint SensorType;
    public uint SensorSubType;
    public uint Capabilities;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public ushort[] ManufacturerName;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public ushort[] ModelName;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 256)] public ushort[] SerialNumber;
    public WINBIO_VERSION FirmwareVersion;
    public uint SupportedFormatEntries;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public WINBIO_REGISTERED_FORMAT[] SupportedFormat;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WINBIO_VERSION
    Public MajorVersion As UInteger
    Public MinorVersion As UInteger
End Structure

<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_SENSOR_ATTRIBUTES
    Public PayloadSize As UInteger
    Public WinBioHresult As Integer
    Public WinBioVersion As WINBIO_VERSION
    Public SensorType As UInteger
    Public SensorSubType As UInteger
    Public Capabilities As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public ManufacturerName() As UShort
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public ModelName() As UShort
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=256)> Public SerialNumber() As UShort
    Public FirmwareVersion As WINBIO_VERSION
    Public SupportedFormatEntries As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public SupportedFormat() As WINBIO_REGISTERED_FORMAT
End Structure
import ctypes
from ctypes import wintypes

class WINBIO_VERSION(ctypes.Structure):
    _fields_ = [
        ("MajorVersion", wintypes.DWORD),
        ("MinorVersion", wintypes.DWORD),
    ]

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

class WINBIO_SENSOR_ATTRIBUTES(ctypes.Structure):
    _fields_ = [
        ("PayloadSize", wintypes.DWORD),
        ("WinBioHresult", ctypes.c_int),
        ("WinBioVersion", WINBIO_VERSION),
        ("SensorType", wintypes.DWORD),
        ("SensorSubType", wintypes.DWORD),
        ("Capabilities", wintypes.DWORD),
        ("ManufacturerName", ctypes.c_ushort * 256),
        ("ModelName", ctypes.c_ushort * 256),
        ("SerialNumber", ctypes.c_ushort * 256),
        ("FirmwareVersion", WINBIO_VERSION),
        ("SupportedFormatEntries", wintypes.DWORD),
        ("SupportedFormat", WINBIO_REGISTERED_FORMAT * 1),
    ]
#[repr(C)]
pub struct WINBIO_VERSION {
    pub MajorVersion: u32,
    pub MinorVersion: u32,
}

#[repr(C)]
pub struct WINBIO_REGISTERED_FORMAT {
    pub Owner: u16,
    pub Type: u16,
}

#[repr(C)]
pub struct WINBIO_SENSOR_ATTRIBUTES {
    pub PayloadSize: u32,
    pub WinBioHresult: i32,
    pub WinBioVersion: WINBIO_VERSION,
    pub SensorType: u32,
    pub SensorSubType: u32,
    pub Capabilities: u32,
    pub ManufacturerName: [u16; 256],
    pub ModelName: [u16; 256],
    pub SerialNumber: [u16; 256],
    pub FirmwareVersion: WINBIO_VERSION,
    pub SupportedFormatEntries: u32,
    pub SupportedFormat: [WINBIO_REGISTERED_FORMAT; 1],
}
import "golang.org/x/sys/windows"

type WINBIO_VERSION struct {
	MajorVersion uint32
	MinorVersion uint32
}

type WINBIO_REGISTERED_FORMAT struct {
	Owner uint16
	Type uint16
}

type WINBIO_SENSOR_ATTRIBUTES struct {
	PayloadSize uint32
	WinBioHresult int32
	WinBioVersion WINBIO_VERSION
	SensorType uint32
	SensorSubType uint32
	Capabilities uint32
	ManufacturerName [256]uint16
	ModelName [256]uint16
	SerialNumber [256]uint16
	FirmwareVersion WINBIO_VERSION
	SupportedFormatEntries uint32
	SupportedFormat [1]WINBIO_REGISTERED_FORMAT
}
type
  WINBIO_VERSION = record
    MajorVersion: DWORD;
    MinorVersion: DWORD;
  end;

  WINBIO_REGISTERED_FORMAT = record
    Owner: Word;
    Type: Word;
  end;

  WINBIO_SENSOR_ATTRIBUTES = record
    PayloadSize: DWORD;
    WinBioHresult: Integer;
    WinBioVersion: WINBIO_VERSION;
    SensorType: DWORD;
    SensorSubType: DWORD;
    Capabilities: DWORD;
    ManufacturerName: array[0..255] of Word;
    ModelName: array[0..255] of Word;
    SerialNumber: array[0..255] of Word;
    FirmwareVersion: WINBIO_VERSION;
    SupportedFormatEntries: DWORD;
    SupportedFormat: array[0..0] of WINBIO_REGISTERED_FORMAT;
  end;
const WINBIO_VERSION = extern struct {
    MajorVersion: u32,
    MinorVersion: u32,
};

const WINBIO_REGISTERED_FORMAT = extern struct {
    Owner: u16,
    Type: u16,
};

const WINBIO_SENSOR_ATTRIBUTES = extern struct {
    PayloadSize: u32,
    WinBioHresult: i32,
    WinBioVersion: WINBIO_VERSION,
    SensorType: u32,
    SensorSubType: u32,
    Capabilities: u32,
    ManufacturerName: [256]u16,
    ModelName: [256]u16,
    SerialNumber: [256]u16,
    FirmwareVersion: WINBIO_VERSION,
    SupportedFormatEntries: u32,
    SupportedFormat: [1]WINBIO_REGISTERED_FORMAT,
};
type
  WINBIO_VERSION {.bycopy.} = object
    MajorVersion: uint32
    MinorVersion: uint32

  WINBIO_REGISTERED_FORMAT {.bycopy.} = object
    Owner: uint16
    Type: uint16

  WINBIO_SENSOR_ATTRIBUTES {.bycopy.} = object
    PayloadSize: uint32
    WinBioHresult: int32
    WinBioVersion: WINBIO_VERSION
    SensorType: uint32
    SensorSubType: uint32
    Capabilities: uint32
    ManufacturerName: array[256, uint16]
    ModelName: array[256, uint16]
    SerialNumber: array[256, uint16]
    FirmwareVersion: WINBIO_VERSION
    SupportedFormatEntries: uint32
    SupportedFormat: array[1, WINBIO_REGISTERED_FORMAT]
struct WINBIO_VERSION
{
    uint MajorVersion;
    uint MinorVersion;
}

struct WINBIO_REGISTERED_FORMAT
{
    ushort Owner;
    ushort Type;
}

struct WINBIO_SENSOR_ATTRIBUTES
{
    uint PayloadSize;
    int WinBioHresult;
    WINBIO_VERSION WinBioVersion;
    uint SensorType;
    uint SensorSubType;
    uint Capabilities;
    ushort[256] ManufacturerName;
    ushort[256] ModelName;
    ushort[256] SerialNumber;
    WINBIO_VERSION FirmwareVersion;
    uint SupportedFormatEntries;
    WINBIO_REGISTERED_FORMAT[1] SupportedFormat;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WINBIO_SENSOR_ATTRIBUTES サイズ: 1580 バイト(x64)
dim st, 395    ; 4byte整数×395(構造体サイズ 1580 / 4 切り上げ)
; PayloadSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; WinBioHresult : HRESULT (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; WinBioVersion : WINBIO_VERSION (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; SensorType : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; SensorSubType : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Capabilities : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ManufacturerName : WORD (+28, 512byte)  varptr(st)+28 を基点に操作(512byte:入れ子/配列)
; ModelName : WORD (+540, 512byte)  varptr(st)+540 を基点に操作(512byte:入れ子/配列)
; SerialNumber : WORD (+1052, 512byte)  varptr(st)+1052 を基点に操作(512byte:入れ子/配列)
; FirmwareVersion : WINBIO_VERSION (+1564, 8byte)  varptr(st)+1564 を基点に操作(8byte:入れ子/配列)
; SupportedFormatEntries : DWORD (+1572, 4byte)  st.393 = 値  /  値 = st.393   (lpoke/lpeek も可)
; SupportedFormat : WINBIO_REGISTERED_FORMAT (+1576, 4byte)  varptr(st)+1576 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global WINBIO_VERSION
    #field int MajorVersion
    #field int MinorVersion
#endstruct

#defstruct global WINBIO_REGISTERED_FORMAT
    #field short Owner
    #field short Type
#endstruct

#defstruct global WINBIO_SENSOR_ATTRIBUTES
    #field int PayloadSize
    #field int WinBioHresult
    #field WINBIO_VERSION WinBioVersion
    #field int SensorType
    #field int SensorSubType
    #field int Capabilities
    #field short ManufacturerName 256
    #field short ModelName 256
    #field short SerialNumber 256
    #field WINBIO_VERSION FirmwareVersion
    #field int SupportedFormatEntries
    #field WINBIO_REGISTERED_FORMAT SupportedFormat 1
#endstruct

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