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

WinBioEnrollCommit

関数
採取した生体情報を登録テンプレートとして確定保存する。
DLLwinbio.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

HRESULT WinBioEnrollCommit(
    DWORD SessionHandle,
    WINBIO_IDENTITY* Identity,   // optional
    BYTE* IsNewTemplate   // optional
);

パラメーター

名前方向
SessionHandleDWORDin
IdentityWINBIO_IDENTITY*outoptional
IsNewTemplateBYTE*outoptional

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

WinBioEnrollCommit = ctypes.windll.winbio.WinBioEnrollCommit
WinBioEnrollCommit.restype = ctypes.c_int
WinBioEnrollCommit.argtypes = [
    wintypes.DWORD,  # SessionHandle : DWORD
    ctypes.c_void_p,  # Identity : WINBIO_IDENTITY* optional, out
    ctypes.POINTER(ctypes.c_ubyte),  # IsNewTemplate : BYTE* optional, out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('winbio.dll')
WinBioEnrollCommit = Fiddle::Function.new(
  lib['WinBioEnrollCommit'],
  [
    -Fiddle::TYPE_INT,  # SessionHandle : DWORD
    Fiddle::TYPE_VOIDP,  # Identity : WINBIO_IDENTITY* optional, out
    Fiddle::TYPE_VOIDP,  # IsNewTemplate : BYTE* optional, out
  ],
  Fiddle::TYPE_INT)
#[link(name = "winbio")]
extern "system" {
    fn WinBioEnrollCommit(
        SessionHandle: u32,  // DWORD
        Identity: *mut WINBIO_IDENTITY,  // WINBIO_IDENTITY* optional, out
        IsNewTemplate: *mut u8  // BYTE* optional, out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioEnrollCommit(uint SessionHandle, IntPtr Identity, IntPtr IsNewTemplate);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioEnrollCommit' -Namespace Win32 -PassThru
# $api::WinBioEnrollCommit(SessionHandle, Identity, IsNewTemplate)
#uselib "winbio.dll"
#func global WinBioEnrollCommit "WinBioEnrollCommit" sptr, sptr, sptr
; WinBioEnrollCommit SessionHandle, varptr(Identity), varptr(IsNewTemplate)   ; 戻り値は stat
; SessionHandle : DWORD -> "sptr"
; Identity : WINBIO_IDENTITY* optional, out -> "sptr"
; IsNewTemplate : BYTE* optional, out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "winbio.dll"
#cfunc global WinBioEnrollCommit "WinBioEnrollCommit" int, var, var
; res = WinBioEnrollCommit(SessionHandle, Identity, IsNewTemplate)
; SessionHandle : DWORD -> "int"
; Identity : WINBIO_IDENTITY* optional, out -> "var"
; IsNewTemplate : BYTE* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT WinBioEnrollCommit(DWORD SessionHandle, WINBIO_IDENTITY* Identity, BYTE* IsNewTemplate)
#uselib "winbio.dll"
#cfunc global WinBioEnrollCommit "WinBioEnrollCommit" int, var, var
; res = WinBioEnrollCommit(SessionHandle, Identity, IsNewTemplate)
; SessionHandle : DWORD -> "int"
; Identity : WINBIO_IDENTITY* optional, out -> "var"
; IsNewTemplate : BYTE* optional, out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winbio = windows.NewLazySystemDLL("winbio.dll")
	procWinBioEnrollCommit = winbio.NewProc("WinBioEnrollCommit")
)

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