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

WinBioIdentifyWithCallback

関数
コールバック方式で生体情報から利用者を識別する。
DLLwinbio.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

// winbio.dll
#include <windows.h>

HRESULT WinBioIdentifyWithCallback(
    DWORD SessionHandle,
    PWINBIO_IDENTIFY_CALLBACK IdentifyCallback,
    void* IdentifyCallbackContext   // optional
);

パラメーター

名前方向
SessionHandleDWORDin
IdentifyCallbackPWINBIO_IDENTIFY_CALLBACKin
IdentifyCallbackContextvoid*inoptional

戻り値の型: HRESULT

各言語での呼び出し定義

// winbio.dll
#include <windows.h>

HRESULT WinBioIdentifyWithCallback(
    DWORD SessionHandle,
    PWINBIO_IDENTIFY_CALLBACK IdentifyCallback,
    void* IdentifyCallbackContext   // optional
);
[DllImport("winbio.dll", ExactSpelling = true)]
static extern int WinBioIdentifyWithCallback(
    uint SessionHandle,   // DWORD
    IntPtr IdentifyCallback,   // PWINBIO_IDENTIFY_CALLBACK
    IntPtr IdentifyCallbackContext   // void* optional
);
<DllImport("winbio.dll", ExactSpelling:=True)>
Public Shared Function WinBioIdentifyWithCallback(
    SessionHandle As UInteger,   ' DWORD
    IdentifyCallback As IntPtr,   ' PWINBIO_IDENTIFY_CALLBACK
    IdentifyCallbackContext As IntPtr   ' void* optional
) As Integer
End Function
' SessionHandle : DWORD
' IdentifyCallback : PWINBIO_IDENTIFY_CALLBACK
' IdentifyCallbackContext : void* optional
Declare PtrSafe Function WinBioIdentifyWithCallback Lib "winbio" ( _
    ByVal SessionHandle As Long, _
    ByVal IdentifyCallback As LongPtr, _
    ByVal IdentifyCallbackContext As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WinBioIdentifyWithCallback = ctypes.windll.winbio.WinBioIdentifyWithCallback
WinBioIdentifyWithCallback.restype = ctypes.c_int
WinBioIdentifyWithCallback.argtypes = [
    wintypes.DWORD,  # SessionHandle : DWORD
    ctypes.c_void_p,  # IdentifyCallback : PWINBIO_IDENTIFY_CALLBACK
    ctypes.POINTER(None),  # IdentifyCallbackContext : void* optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('winbio.dll')
WinBioIdentifyWithCallback = Fiddle::Function.new(
  lib['WinBioIdentifyWithCallback'],
  [
    -Fiddle::TYPE_INT,  # SessionHandle : DWORD
    Fiddle::TYPE_VOIDP,  # IdentifyCallback : PWINBIO_IDENTIFY_CALLBACK
    Fiddle::TYPE_VOIDP,  # IdentifyCallbackContext : void* optional
  ],
  Fiddle::TYPE_INT)
#[link(name = "winbio")]
extern "system" {
    fn WinBioIdentifyWithCallback(
        SessionHandle: u32,  // DWORD
        IdentifyCallback: *const core::ffi::c_void,  // PWINBIO_IDENTIFY_CALLBACK
        IdentifyCallbackContext: *mut ()  // void* optional
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioIdentifyWithCallback(uint SessionHandle, IntPtr IdentifyCallback, IntPtr IdentifyCallbackContext);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioIdentifyWithCallback' -Namespace Win32 -PassThru
# $api::WinBioIdentifyWithCallback(SessionHandle, IdentifyCallback, IdentifyCallbackContext)
#uselib "winbio.dll"
#func global WinBioIdentifyWithCallback "WinBioIdentifyWithCallback" sptr, sptr, sptr
; WinBioIdentifyWithCallback SessionHandle, IdentifyCallback, IdentifyCallbackContext   ; 戻り値は stat
; SessionHandle : DWORD -> "sptr"
; IdentifyCallback : PWINBIO_IDENTIFY_CALLBACK -> "sptr"
; IdentifyCallbackContext : void* optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "winbio.dll"
#cfunc global WinBioIdentifyWithCallback "WinBioIdentifyWithCallback" int, sptr, sptr
; res = WinBioIdentifyWithCallback(SessionHandle, IdentifyCallback, IdentifyCallbackContext)
; SessionHandle : DWORD -> "int"
; IdentifyCallback : PWINBIO_IDENTIFY_CALLBACK -> "sptr"
; IdentifyCallbackContext : void* optional -> "sptr"
; HRESULT WinBioIdentifyWithCallback(DWORD SessionHandle, PWINBIO_IDENTIFY_CALLBACK IdentifyCallback, void* IdentifyCallbackContext)
#uselib "winbio.dll"
#cfunc global WinBioIdentifyWithCallback "WinBioIdentifyWithCallback" int, intptr, intptr
; res = WinBioIdentifyWithCallback(SessionHandle, IdentifyCallback, IdentifyCallbackContext)
; SessionHandle : DWORD -> "int"
; IdentifyCallback : PWINBIO_IDENTIFY_CALLBACK -> "intptr"
; IdentifyCallbackContext : void* optional -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winbio = windows.NewLazySystemDLL("winbio.dll")
	procWinBioIdentifyWithCallback = winbio.NewProc("WinBioIdentifyWithCallback")
)

// SessionHandle (DWORD), IdentifyCallback (PWINBIO_IDENTIFY_CALLBACK), IdentifyCallbackContext (void* optional)
r1, _, err := procWinBioIdentifyWithCallback.Call(
	uintptr(SessionHandle),
	uintptr(IdentifyCallback),
	uintptr(IdentifyCallbackContext),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function WinBioIdentifyWithCallback(
  SessionHandle: DWORD;   // DWORD
  IdentifyCallback: Pointer;   // PWINBIO_IDENTIFY_CALLBACK
  IdentifyCallbackContext: Pointer   // void* optional
): Integer; stdcall;
  external 'winbio.dll' name 'WinBioIdentifyWithCallback';
result := DllCall("winbio\WinBioIdentifyWithCallback"
    , "UInt", SessionHandle   ; DWORD
    , "Ptr", IdentifyCallback   ; PWINBIO_IDENTIFY_CALLBACK
    , "Ptr", IdentifyCallbackContext   ; void* optional
    , "Int")   ; return: HRESULT
●WinBioIdentifyWithCallback(SessionHandle, IdentifyCallback, IdentifyCallbackContext) = DLL("winbio.dll", "int WinBioIdentifyWithCallback(dword, void*, void*)")
# 呼び出し: WinBioIdentifyWithCallback(SessionHandle, IdentifyCallback, IdentifyCallbackContext)
# SessionHandle : DWORD -> "dword"
# IdentifyCallback : PWINBIO_IDENTIFY_CALLBACK -> "void*"
# IdentifyCallbackContext : void* optional -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。