ホーム › Devices.BiometricFramework › WinBioSetProperty
WinBioSetProperty
関数生体認証の指定プロパティ値を設定する。
シグネチャ
// winbio.dll
#include <windows.h>
HRESULT WinBioSetProperty(
DWORD SessionHandle,
DWORD PropertyType,
DWORD PropertyId,
DWORD UnitId, // optional
WINBIO_IDENTITY* Identity, // optional
BYTE SubFactor, // optional
void* PropertyBuffer,
UINT_PTR PropertyBufferSize
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| SessionHandle | DWORD | in |
| PropertyType | DWORD | in |
| PropertyId | DWORD | in |
| UnitId | DWORD | inoptional |
| Identity | WINBIO_IDENTITY* | inoptional |
| SubFactor | BYTE | inoptional |
| PropertyBuffer | void* | in |
| PropertyBufferSize | UINT_PTR | in |
戻り値の型: HRESULT
各言語での呼び出し定義
// winbio.dll
#include <windows.h>
HRESULT WinBioSetProperty(
DWORD SessionHandle,
DWORD PropertyType,
DWORD PropertyId,
DWORD UnitId, // optional
WINBIO_IDENTITY* Identity, // optional
BYTE SubFactor, // optional
void* PropertyBuffer,
UINT_PTR PropertyBufferSize
);[DllImport("winbio.dll", ExactSpelling = true)]
static extern int WinBioSetProperty(
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*
UIntPtr PropertyBufferSize // UINT_PTR
);<DllImport("winbio.dll", ExactSpelling:=True)>
Public Shared Function WinBioSetProperty(
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*
PropertyBufferSize As UIntPtr ' UINT_PTR
) As Integer
End Function' SessionHandle : DWORD
' PropertyType : DWORD
' PropertyId : DWORD
' UnitId : DWORD optional
' Identity : WINBIO_IDENTITY* optional
' SubFactor : BYTE optional
' PropertyBuffer : void*
' PropertyBufferSize : UINT_PTR
Declare PtrSafe Function WinBioSetProperty 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
WinBioSetProperty = ctypes.windll.winbio.WinBioSetProperty
WinBioSetProperty.restype = ctypes.c_int
WinBioSetProperty.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.POINTER(None), # PropertyBuffer : void*
ctypes.c_size_t, # PropertyBufferSize : UINT_PTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('winbio.dll')
WinBioSetProperty = Fiddle::Function.new(
lib['WinBioSetProperty'],
[
-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*
Fiddle::TYPE_UINTPTR_T, # PropertyBufferSize : UINT_PTR
],
Fiddle::TYPE_INT)#[link(name = "winbio")]
extern "system" {
fn WinBioSetProperty(
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 (), // void*
PropertyBufferSize: usize // UINT_PTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioSetProperty(uint SessionHandle, uint PropertyType, uint PropertyId, uint UnitId, IntPtr Identity, byte SubFactor, IntPtr PropertyBuffer, UIntPtr PropertyBufferSize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioSetProperty' -Namespace Win32 -PassThru
# $api::WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)#uselib "winbio.dll"
#func global WinBioSetProperty "WinBioSetProperty" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WinBioSetProperty SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, 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* -> "sptr"
; PropertyBufferSize : UINT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, var, int, sptr, sptr ; res = WinBioSetProperty(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* -> "sptr" ; PropertyBufferSize : UINT_PTR -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, sptr, int, sptr, sptr ; res = WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, 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* -> "sptr" ; PropertyBufferSize : UINT_PTR -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT WinBioSetProperty(DWORD SessionHandle, DWORD PropertyType, DWORD PropertyId, DWORD UnitId, WINBIO_IDENTITY* Identity, BYTE SubFactor, void* PropertyBuffer, UINT_PTR PropertyBufferSize) #uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, var, int, intptr, intptr ; res = WinBioSetProperty(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* -> "intptr" ; PropertyBufferSize : UINT_PTR -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WinBioSetProperty(DWORD SessionHandle, DWORD PropertyType, DWORD PropertyId, DWORD UnitId, WINBIO_IDENTITY* Identity, BYTE SubFactor, void* PropertyBuffer, UINT_PTR PropertyBufferSize) #uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, intptr, int, intptr, intptr ; res = WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, 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* -> "intptr" ; PropertyBufferSize : UINT_PTR -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winbio = windows.NewLazySystemDLL("winbio.dll")
procWinBioSetProperty = winbio.NewProc("WinBioSetProperty")
)
// SessionHandle (DWORD), PropertyType (DWORD), PropertyId (DWORD), UnitId (DWORD optional), Identity (WINBIO_IDENTITY* optional), SubFactor (BYTE optional), PropertyBuffer (void*), PropertyBufferSize (UINT_PTR)
r1, _, err := procWinBioSetProperty.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 WinBioSetProperty(
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*
PropertyBufferSize: NativeUInt // UINT_PTR
): Integer; stdcall;
external 'winbio.dll' name 'WinBioSetProperty';result := DllCall("winbio\WinBioSetProperty"
, "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*
, "UPtr", PropertyBufferSize ; UINT_PTR
, "Int") ; return: HRESULT●WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize) = DLL("winbio.dll", "int WinBioSetProperty(dword, dword, dword, dword, void*, byte, void*, int)")
# 呼び出し: WinBioSetProperty(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* -> "void*"
# PropertyBufferSize : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。