ホーム › Devices.BiometricFramework › WinBioGetProperty
WinBioGetProperty
関数生体認証の指定プロパティ値を取得する。
シグネチャ
// winbio.dll
#include <windows.h>
HRESULT WinBioGetProperty(
DWORD SessionHandle,
DWORD PropertyType,
DWORD PropertyId,
DWORD UnitId, // optional
WINBIO_IDENTITY* Identity, // optional
BYTE SubFactor, // optional
void** PropertyBuffer,
UINT_PTR* PropertyBufferSize // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| SessionHandle | DWORD | in |
| PropertyType | DWORD | in |
| PropertyId | DWORD | in |
| UnitId | DWORD | inoptional |
| Identity | WINBIO_IDENTITY* | inoptional |
| SubFactor | BYTE | inoptional |
| PropertyBuffer | void** | out |
| PropertyBufferSize | UINT_PTR* | outoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// winbio.dll
#include <windows.h>
HRESULT WinBioGetProperty(
DWORD SessionHandle,
DWORD PropertyType,
DWORD PropertyId,
DWORD UnitId, // optional
WINBIO_IDENTITY* Identity, // optional
BYTE SubFactor, // optional
void** PropertyBuffer,
UINT_PTR* PropertyBufferSize // optional
);[DllImport("winbio.dll", ExactSpelling = true)]
static extern int WinBioGetProperty(
uint SessionHandle, // DWORD
uint PropertyType, // DWORD
uint PropertyId, // DWORD
uint UnitId, // DWORD optional
IntPtr Identity, // WINBIO_IDENTITY* optional
byte SubFactor, // BYTE optional
IntPtr PropertyBuffer, // void** out
IntPtr PropertyBufferSize // UINT_PTR* optional, out
);<DllImport("winbio.dll", ExactSpelling:=True)>
Public Shared Function WinBioGetProperty(
SessionHandle As UInteger, ' DWORD
PropertyType As UInteger, ' DWORD
PropertyId As UInteger, ' DWORD
UnitId As UInteger, ' DWORD optional
Identity As IntPtr, ' WINBIO_IDENTITY* optional
SubFactor As Byte, ' BYTE optional
PropertyBuffer As IntPtr, ' void** out
PropertyBufferSize As IntPtr ' UINT_PTR* optional, out
) As Integer
End Function' SessionHandle : DWORD
' PropertyType : DWORD
' PropertyId : DWORD
' UnitId : DWORD optional
' Identity : WINBIO_IDENTITY* optional
' SubFactor : BYTE optional
' PropertyBuffer : void** out
' PropertyBufferSize : UINT_PTR* optional, out
Declare PtrSafe Function WinBioGetProperty Lib "winbio" ( _
ByVal SessionHandle As Long, _
ByVal PropertyType As Long, _
ByVal PropertyId As Long, _
ByVal UnitId As Long, _
ByVal Identity As LongPtr, _
ByVal SubFactor As Byte, _
ByVal PropertyBuffer As LongPtr, _
ByVal PropertyBufferSize As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WinBioGetProperty = ctypes.windll.winbio.WinBioGetProperty
WinBioGetProperty.restype = ctypes.c_int
WinBioGetProperty.argtypes = [
wintypes.DWORD, # SessionHandle : DWORD
wintypes.DWORD, # PropertyType : DWORD
wintypes.DWORD, # PropertyId : DWORD
wintypes.DWORD, # UnitId : DWORD optional
ctypes.c_void_p, # Identity : WINBIO_IDENTITY* optional
ctypes.c_ubyte, # SubFactor : BYTE optional
ctypes.c_void_p, # PropertyBuffer : void** out
ctypes.POINTER(ctypes.c_size_t), # PropertyBufferSize : UINT_PTR* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('winbio.dll')
WinBioGetProperty = Fiddle::Function.new(
lib['WinBioGetProperty'],
[
-Fiddle::TYPE_INT, # SessionHandle : DWORD
-Fiddle::TYPE_INT, # PropertyType : DWORD
-Fiddle::TYPE_INT, # PropertyId : DWORD
-Fiddle::TYPE_INT, # UnitId : DWORD optional
Fiddle::TYPE_VOIDP, # Identity : WINBIO_IDENTITY* optional
-Fiddle::TYPE_CHAR, # SubFactor : BYTE optional
Fiddle::TYPE_VOIDP, # PropertyBuffer : void** out
Fiddle::TYPE_VOIDP, # PropertyBufferSize : UINT_PTR* optional, out
],
Fiddle::TYPE_INT)#[link(name = "winbio")]
extern "system" {
fn WinBioGetProperty(
SessionHandle: u32, // DWORD
PropertyType: u32, // DWORD
PropertyId: u32, // DWORD
UnitId: u32, // DWORD optional
Identity: *mut WINBIO_IDENTITY, // WINBIO_IDENTITY* optional
SubFactor: u8, // BYTE optional
PropertyBuffer: *mut *mut (), // void** out
PropertyBufferSize: *mut usize // UINT_PTR* optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioGetProperty(uint SessionHandle, uint PropertyType, uint PropertyId, uint UnitId, IntPtr Identity, byte SubFactor, IntPtr PropertyBuffer, IntPtr PropertyBufferSize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioGetProperty' -Namespace Win32 -PassThru
# $api::WinBioGetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)#uselib "winbio.dll"
#func global WinBioGetProperty "WinBioGetProperty" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WinBioGetProperty SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, varptr(PropertyBufferSize) ; 戻り値は stat
; SessionHandle : DWORD -> "sptr"
; PropertyType : DWORD -> "sptr"
; PropertyId : DWORD -> "sptr"
; UnitId : DWORD optional -> "sptr"
; Identity : WINBIO_IDENTITY* optional -> "sptr"
; SubFactor : BYTE optional -> "sptr"
; PropertyBuffer : void** out -> "sptr"
; PropertyBufferSize : UINT_PTR* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "winbio.dll" #cfunc global WinBioGetProperty "WinBioGetProperty" int, int, int, int, var, int, sptr, var ; res = WinBioGetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "var" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void** out -> "sptr" ; PropertyBufferSize : UINT_PTR* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "winbio.dll" #cfunc global WinBioGetProperty "WinBioGetProperty" int, int, int, int, sptr, int, sptr, sptr ; res = WinBioGetProperty(SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, varptr(PropertyBufferSize)) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "sptr" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void** out -> "sptr" ; PropertyBufferSize : UINT_PTR* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT WinBioGetProperty(DWORD SessionHandle, DWORD PropertyType, DWORD PropertyId, DWORD UnitId, WINBIO_IDENTITY* Identity, BYTE SubFactor, void** PropertyBuffer, UINT_PTR* PropertyBufferSize) #uselib "winbio.dll" #cfunc global WinBioGetProperty "WinBioGetProperty" int, int, int, int, var, int, intptr, var ; res = WinBioGetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "var" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void** out -> "intptr" ; PropertyBufferSize : UINT_PTR* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WinBioGetProperty(DWORD SessionHandle, DWORD PropertyType, DWORD PropertyId, DWORD UnitId, WINBIO_IDENTITY* Identity, BYTE SubFactor, void** PropertyBuffer, UINT_PTR* PropertyBufferSize) #uselib "winbio.dll" #cfunc global WinBioGetProperty "WinBioGetProperty" int, int, int, int, intptr, int, intptr, intptr ; res = WinBioGetProperty(SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, varptr(PropertyBufferSize)) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "intptr" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void** out -> "intptr" ; PropertyBufferSize : UINT_PTR* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winbio = windows.NewLazySystemDLL("winbio.dll")
procWinBioGetProperty = winbio.NewProc("WinBioGetProperty")
)
// SessionHandle (DWORD), PropertyType (DWORD), PropertyId (DWORD), UnitId (DWORD optional), Identity (WINBIO_IDENTITY* optional), SubFactor (BYTE optional), PropertyBuffer (void** out), PropertyBufferSize (UINT_PTR* optional, out)
r1, _, err := procWinBioGetProperty.Call(
uintptr(SessionHandle),
uintptr(PropertyType),
uintptr(PropertyId),
uintptr(UnitId),
uintptr(Identity),
uintptr(SubFactor),
uintptr(PropertyBuffer),
uintptr(PropertyBufferSize),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WinBioGetProperty(
SessionHandle: DWORD; // DWORD
PropertyType: DWORD; // DWORD
PropertyId: DWORD; // DWORD
UnitId: DWORD; // DWORD optional
Identity: Pointer; // WINBIO_IDENTITY* optional
SubFactor: Byte; // BYTE optional
PropertyBuffer: Pointer; // void** out
PropertyBufferSize: Pointer // UINT_PTR* optional, out
): Integer; stdcall;
external 'winbio.dll' name 'WinBioGetProperty';result := DllCall("winbio\WinBioGetProperty"
, "UInt", SessionHandle ; DWORD
, "UInt", PropertyType ; DWORD
, "UInt", PropertyId ; DWORD
, "UInt", UnitId ; DWORD optional
, "Ptr", Identity ; WINBIO_IDENTITY* optional
, "UChar", SubFactor ; BYTE optional
, "Ptr", PropertyBuffer ; void** out
, "Ptr", PropertyBufferSize ; UINT_PTR* optional, out
, "Int") ; return: HRESULT●WinBioGetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize) = DLL("winbio.dll", "int WinBioGetProperty(dword, dword, dword, dword, void*, byte, void*, void*)")
# 呼び出し: WinBioGetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)
# SessionHandle : DWORD -> "dword"
# PropertyType : DWORD -> "dword"
# PropertyId : DWORD -> "dword"
# UnitId : DWORD optional -> "dword"
# Identity : WINBIO_IDENTITY* optional -> "void*"
# SubFactor : BYTE optional -> "byte"
# PropertyBuffer : void** out -> "void*"
# PropertyBufferSize : UINT_PTR* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。