ホーム › Devices.BiometricFramework › WinBioAsyncOpenSession
WinBioAsyncOpenSession
関数生体認証操作用の非同期セッションを開く。
シグネチャ
// winbio.dll
#include <windows.h>
HRESULT WinBioAsyncOpenSession(
DWORD Factor,
WINBIO_POOL PoolType,
DWORD Flags,
DWORD* UnitArray, // optional
UINT_PTR UnitCount, // optional
GUID* DatabaseId, // optional
WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod,
HWND TargetWindow, // optional
DWORD MessageCode, // optional
PWINBIO_ASYNC_COMPLETION_CALLBACK CallbackRoutine, // optional
void* UserData, // optional
BOOL AsynchronousOpen,
DWORD* SessionHandle // optional
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| Factor | DWORD | in |
| PoolType | WINBIO_POOL | in |
| Flags | DWORD | in |
| UnitArray | DWORD* | inoptional |
| UnitCount | UINT_PTR | inoptional |
| DatabaseId | GUID* | inoptional |
| NotificationMethod | WINBIO_ASYNC_NOTIFICATION_METHOD | in |
| TargetWindow | HWND | inoptional |
| MessageCode | DWORD | inoptional |
| CallbackRoutine | PWINBIO_ASYNC_COMPLETION_CALLBACK | inoptional |
| UserData | void* | inoptional |
| AsynchronousOpen | BOOL | in |
| SessionHandle | DWORD* | outoptional |
戻り値の型: HRESULT
各言語での呼び出し定義
// winbio.dll
#include <windows.h>
HRESULT WinBioAsyncOpenSession(
DWORD Factor,
WINBIO_POOL PoolType,
DWORD Flags,
DWORD* UnitArray, // optional
UINT_PTR UnitCount, // optional
GUID* DatabaseId, // optional
WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod,
HWND TargetWindow, // optional
DWORD MessageCode, // optional
PWINBIO_ASYNC_COMPLETION_CALLBACK CallbackRoutine, // optional
void* UserData, // optional
BOOL AsynchronousOpen,
DWORD* SessionHandle // optional
);[DllImport("winbio.dll", ExactSpelling = true)]
static extern int WinBioAsyncOpenSession(
uint Factor, // DWORD
uint PoolType, // WINBIO_POOL
uint Flags, // DWORD
IntPtr UnitArray, // DWORD* optional
UIntPtr UnitCount, // UINT_PTR optional
IntPtr DatabaseId, // GUID* optional
int NotificationMethod, // WINBIO_ASYNC_NOTIFICATION_METHOD
IntPtr TargetWindow, // HWND optional
uint MessageCode, // DWORD optional
IntPtr CallbackRoutine, // PWINBIO_ASYNC_COMPLETION_CALLBACK optional
IntPtr UserData, // void* optional
bool AsynchronousOpen, // BOOL
IntPtr SessionHandle // DWORD* optional, out
);<DllImport("winbio.dll", ExactSpelling:=True)>
Public Shared Function WinBioAsyncOpenSession(
Factor As UInteger, ' DWORD
PoolType As UInteger, ' WINBIO_POOL
Flags As UInteger, ' DWORD
UnitArray As IntPtr, ' DWORD* optional
UnitCount As UIntPtr, ' UINT_PTR optional
DatabaseId As IntPtr, ' GUID* optional
NotificationMethod As Integer, ' WINBIO_ASYNC_NOTIFICATION_METHOD
TargetWindow As IntPtr, ' HWND optional
MessageCode As UInteger, ' DWORD optional
CallbackRoutine As IntPtr, ' PWINBIO_ASYNC_COMPLETION_CALLBACK optional
UserData As IntPtr, ' void* optional
AsynchronousOpen As Boolean, ' BOOL
SessionHandle As IntPtr ' DWORD* optional, out
) As Integer
End Function' Factor : DWORD
' PoolType : WINBIO_POOL
' Flags : DWORD
' UnitArray : DWORD* optional
' UnitCount : UINT_PTR optional
' DatabaseId : GUID* optional
' NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD
' TargetWindow : HWND optional
' MessageCode : DWORD optional
' CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional
' UserData : void* optional
' AsynchronousOpen : BOOL
' SessionHandle : DWORD* optional, out
Declare PtrSafe Function WinBioAsyncOpenSession Lib "winbio" ( _
ByVal Factor As Long, _
ByVal PoolType As Long, _
ByVal Flags As Long, _
ByVal UnitArray As LongPtr, _
ByVal UnitCount As LongPtr, _
ByVal DatabaseId As LongPtr, _
ByVal NotificationMethod As Long, _
ByVal TargetWindow As LongPtr, _
ByVal MessageCode As Long, _
ByVal CallbackRoutine As LongPtr, _
ByVal UserData As LongPtr, _
ByVal AsynchronousOpen As Long, _
ByVal SessionHandle As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WinBioAsyncOpenSession = ctypes.windll.winbio.WinBioAsyncOpenSession
WinBioAsyncOpenSession.restype = ctypes.c_int
WinBioAsyncOpenSession.argtypes = [
wintypes.DWORD, # Factor : DWORD
wintypes.DWORD, # PoolType : WINBIO_POOL
wintypes.DWORD, # Flags : DWORD
ctypes.POINTER(wintypes.DWORD), # UnitArray : DWORD* optional
ctypes.c_size_t, # UnitCount : UINT_PTR optional
ctypes.c_void_p, # DatabaseId : GUID* optional
ctypes.c_int, # NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD
wintypes.HANDLE, # TargetWindow : HWND optional
wintypes.DWORD, # MessageCode : DWORD optional
ctypes.c_void_p, # CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional
ctypes.POINTER(None), # UserData : void* optional
wintypes.BOOL, # AsynchronousOpen : BOOL
ctypes.POINTER(wintypes.DWORD), # SessionHandle : DWORD* optional, out
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('winbio.dll')
WinBioAsyncOpenSession = Fiddle::Function.new(
lib['WinBioAsyncOpenSession'],
[
-Fiddle::TYPE_INT, # Factor : DWORD
-Fiddle::TYPE_INT, # PoolType : WINBIO_POOL
-Fiddle::TYPE_INT, # Flags : DWORD
Fiddle::TYPE_VOIDP, # UnitArray : DWORD* optional
Fiddle::TYPE_UINTPTR_T, # UnitCount : UINT_PTR optional
Fiddle::TYPE_VOIDP, # DatabaseId : GUID* optional
Fiddle::TYPE_INT, # NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD
Fiddle::TYPE_VOIDP, # TargetWindow : HWND optional
-Fiddle::TYPE_INT, # MessageCode : DWORD optional
Fiddle::TYPE_VOIDP, # CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional
Fiddle::TYPE_VOIDP, # UserData : void* optional
Fiddle::TYPE_INT, # AsynchronousOpen : BOOL
Fiddle::TYPE_VOIDP, # SessionHandle : DWORD* optional, out
],
Fiddle::TYPE_INT)#[link(name = "winbio")]
extern "system" {
fn WinBioAsyncOpenSession(
Factor: u32, // DWORD
PoolType: u32, // WINBIO_POOL
Flags: u32, // DWORD
UnitArray: *mut u32, // DWORD* optional
UnitCount: usize, // UINT_PTR optional
DatabaseId: *mut GUID, // GUID* optional
NotificationMethod: i32, // WINBIO_ASYNC_NOTIFICATION_METHOD
TargetWindow: *mut core::ffi::c_void, // HWND optional
MessageCode: u32, // DWORD optional
CallbackRoutine: *const core::ffi::c_void, // PWINBIO_ASYNC_COMPLETION_CALLBACK optional
UserData: *mut (), // void* optional
AsynchronousOpen: i32, // BOOL
SessionHandle: *mut u32 // DWORD* optional, out
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioAsyncOpenSession(uint Factor, uint PoolType, uint Flags, IntPtr UnitArray, UIntPtr UnitCount, IntPtr DatabaseId, int NotificationMethod, IntPtr TargetWindow, uint MessageCode, IntPtr CallbackRoutine, IntPtr UserData, bool AsynchronousOpen, IntPtr SessionHandle);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioAsyncOpenSession' -Namespace Win32 -PassThru
# $api::WinBioAsyncOpenSession(Factor, PoolType, Flags, UnitArray, UnitCount, DatabaseId, NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, SessionHandle)#uselib "winbio.dll"
#func global WinBioAsyncOpenSession "WinBioAsyncOpenSession" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WinBioAsyncOpenSession Factor, PoolType, Flags, varptr(UnitArray), UnitCount, varptr(DatabaseId), NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, varptr(SessionHandle) ; 戻り値は stat
; Factor : DWORD -> "sptr"
; PoolType : WINBIO_POOL -> "sptr"
; Flags : DWORD -> "sptr"
; UnitArray : DWORD* optional -> "sptr"
; UnitCount : UINT_PTR optional -> "sptr"
; DatabaseId : GUID* optional -> "sptr"
; NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD -> "sptr"
; TargetWindow : HWND optional -> "sptr"
; MessageCode : DWORD optional -> "sptr"
; CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional -> "sptr"
; UserData : void* optional -> "sptr"
; AsynchronousOpen : BOOL -> "sptr"
; SessionHandle : DWORD* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "winbio.dll" #cfunc global WinBioAsyncOpenSession "WinBioAsyncOpenSession" int, int, int, var, sptr, var, int, sptr, int, sptr, sptr, int, var ; res = WinBioAsyncOpenSession(Factor, PoolType, Flags, UnitArray, UnitCount, DatabaseId, NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, SessionHandle) ; Factor : DWORD -> "int" ; PoolType : WINBIO_POOL -> "int" ; Flags : DWORD -> "int" ; UnitArray : DWORD* optional -> "var" ; UnitCount : UINT_PTR optional -> "sptr" ; DatabaseId : GUID* optional -> "var" ; NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD -> "int" ; TargetWindow : HWND optional -> "sptr" ; MessageCode : DWORD optional -> "int" ; CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional -> "sptr" ; UserData : void* optional -> "sptr" ; AsynchronousOpen : BOOL -> "int" ; SessionHandle : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "winbio.dll" #cfunc global WinBioAsyncOpenSession "WinBioAsyncOpenSession" int, int, int, sptr, sptr, sptr, int, sptr, int, sptr, sptr, int, sptr ; res = WinBioAsyncOpenSession(Factor, PoolType, Flags, varptr(UnitArray), UnitCount, varptr(DatabaseId), NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, varptr(SessionHandle)) ; Factor : DWORD -> "int" ; PoolType : WINBIO_POOL -> "int" ; Flags : DWORD -> "int" ; UnitArray : DWORD* optional -> "sptr" ; UnitCount : UINT_PTR optional -> "sptr" ; DatabaseId : GUID* optional -> "sptr" ; NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD -> "int" ; TargetWindow : HWND optional -> "sptr" ; MessageCode : DWORD optional -> "int" ; CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional -> "sptr" ; UserData : void* optional -> "sptr" ; AsynchronousOpen : BOOL -> "int" ; SessionHandle : DWORD* optional, out -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT WinBioAsyncOpenSession(DWORD Factor, WINBIO_POOL PoolType, DWORD Flags, DWORD* UnitArray, UINT_PTR UnitCount, GUID* DatabaseId, WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod, HWND TargetWindow, DWORD MessageCode, PWINBIO_ASYNC_COMPLETION_CALLBACK CallbackRoutine, void* UserData, BOOL AsynchronousOpen, DWORD* SessionHandle) #uselib "winbio.dll" #cfunc global WinBioAsyncOpenSession "WinBioAsyncOpenSession" int, int, int, var, intptr, var, int, intptr, int, intptr, intptr, int, var ; res = WinBioAsyncOpenSession(Factor, PoolType, Flags, UnitArray, UnitCount, DatabaseId, NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, SessionHandle) ; Factor : DWORD -> "int" ; PoolType : WINBIO_POOL -> "int" ; Flags : DWORD -> "int" ; UnitArray : DWORD* optional -> "var" ; UnitCount : UINT_PTR optional -> "intptr" ; DatabaseId : GUID* optional -> "var" ; NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD -> "int" ; TargetWindow : HWND optional -> "intptr" ; MessageCode : DWORD optional -> "int" ; CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional -> "intptr" ; UserData : void* optional -> "intptr" ; AsynchronousOpen : BOOL -> "int" ; SessionHandle : DWORD* optional, out -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WinBioAsyncOpenSession(DWORD Factor, WINBIO_POOL PoolType, DWORD Flags, DWORD* UnitArray, UINT_PTR UnitCount, GUID* DatabaseId, WINBIO_ASYNC_NOTIFICATION_METHOD NotificationMethod, HWND TargetWindow, DWORD MessageCode, PWINBIO_ASYNC_COMPLETION_CALLBACK CallbackRoutine, void* UserData, BOOL AsynchronousOpen, DWORD* SessionHandle) #uselib "winbio.dll" #cfunc global WinBioAsyncOpenSession "WinBioAsyncOpenSession" int, int, int, intptr, intptr, intptr, int, intptr, int, intptr, intptr, int, intptr ; res = WinBioAsyncOpenSession(Factor, PoolType, Flags, varptr(UnitArray), UnitCount, varptr(DatabaseId), NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, varptr(SessionHandle)) ; Factor : DWORD -> "int" ; PoolType : WINBIO_POOL -> "int" ; Flags : DWORD -> "int" ; UnitArray : DWORD* optional -> "intptr" ; UnitCount : UINT_PTR optional -> "intptr" ; DatabaseId : GUID* optional -> "intptr" ; NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD -> "int" ; TargetWindow : HWND optional -> "intptr" ; MessageCode : DWORD optional -> "int" ; CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional -> "intptr" ; UserData : void* optional -> "intptr" ; AsynchronousOpen : BOOL -> "int" ; SessionHandle : DWORD* optional, out -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winbio = windows.NewLazySystemDLL("winbio.dll")
procWinBioAsyncOpenSession = winbio.NewProc("WinBioAsyncOpenSession")
)
// Factor (DWORD), PoolType (WINBIO_POOL), Flags (DWORD), UnitArray (DWORD* optional), UnitCount (UINT_PTR optional), DatabaseId (GUID* optional), NotificationMethod (WINBIO_ASYNC_NOTIFICATION_METHOD), TargetWindow (HWND optional), MessageCode (DWORD optional), CallbackRoutine (PWINBIO_ASYNC_COMPLETION_CALLBACK optional), UserData (void* optional), AsynchronousOpen (BOOL), SessionHandle (DWORD* optional, out)
r1, _, err := procWinBioAsyncOpenSession.Call(
uintptr(Factor),
uintptr(PoolType),
uintptr(Flags),
uintptr(UnitArray),
uintptr(UnitCount),
uintptr(DatabaseId),
uintptr(NotificationMethod),
uintptr(TargetWindow),
uintptr(MessageCode),
uintptr(CallbackRoutine),
uintptr(UserData),
uintptr(AsynchronousOpen),
uintptr(SessionHandle),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WinBioAsyncOpenSession(
Factor: DWORD; // DWORD
PoolType: DWORD; // WINBIO_POOL
Flags: DWORD; // DWORD
UnitArray: Pointer; // DWORD* optional
UnitCount: NativeUInt; // UINT_PTR optional
DatabaseId: PGUID; // GUID* optional
NotificationMethod: Integer; // WINBIO_ASYNC_NOTIFICATION_METHOD
TargetWindow: THandle; // HWND optional
MessageCode: DWORD; // DWORD optional
CallbackRoutine: Pointer; // PWINBIO_ASYNC_COMPLETION_CALLBACK optional
UserData: Pointer; // void* optional
AsynchronousOpen: BOOL; // BOOL
SessionHandle: Pointer // DWORD* optional, out
): Integer; stdcall;
external 'winbio.dll' name 'WinBioAsyncOpenSession';result := DllCall("winbio\WinBioAsyncOpenSession"
, "UInt", Factor ; DWORD
, "UInt", PoolType ; WINBIO_POOL
, "UInt", Flags ; DWORD
, "Ptr", UnitArray ; DWORD* optional
, "UPtr", UnitCount ; UINT_PTR optional
, "Ptr", DatabaseId ; GUID* optional
, "Int", NotificationMethod ; WINBIO_ASYNC_NOTIFICATION_METHOD
, "Ptr", TargetWindow ; HWND optional
, "UInt", MessageCode ; DWORD optional
, "Ptr", CallbackRoutine ; PWINBIO_ASYNC_COMPLETION_CALLBACK optional
, "Ptr", UserData ; void* optional
, "Int", AsynchronousOpen ; BOOL
, "Ptr", SessionHandle ; DWORD* optional, out
, "Int") ; return: HRESULT●WinBioAsyncOpenSession(Factor, PoolType, Flags, UnitArray, UnitCount, DatabaseId, NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, SessionHandle) = DLL("winbio.dll", "int WinBioAsyncOpenSession(dword, dword, dword, void*, int, void*, int, void*, dword, void*, void*, bool, void*)")
# 呼び出し: WinBioAsyncOpenSession(Factor, PoolType, Flags, UnitArray, UnitCount, DatabaseId, NotificationMethod, TargetWindow, MessageCode, CallbackRoutine, UserData, AsynchronousOpen, SessionHandle)
# Factor : DWORD -> "dword"
# PoolType : WINBIO_POOL -> "dword"
# Flags : DWORD -> "dword"
# UnitArray : DWORD* optional -> "void*"
# UnitCount : UINT_PTR optional -> "int"
# DatabaseId : GUID* optional -> "void*"
# NotificationMethod : WINBIO_ASYNC_NOTIFICATION_METHOD -> "int"
# TargetWindow : HWND optional -> "void*"
# MessageCode : DWORD optional -> "dword"
# CallbackRoutine : PWINBIO_ASYNC_COMPLETION_CALLBACK optional -> "void*"
# UserData : void* optional -> "void*"
# AsynchronousOpen : BOOL -> "bool"
# SessionHandle : DWORD* optional, out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。