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

WinBioDeleteTemplate

関数
指定IDとサブ要素の登録済み生体テンプレートを削除する。
DLLwinbio.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

HRESULT WinBioDeleteTemplate(
    DWORD SessionHandle,
    DWORD UnitId,
    WINBIO_IDENTITY* Identity,
    BYTE SubFactor
);

パラメーター

名前方向
SessionHandleDWORDin
UnitIdDWORDin
IdentityWINBIO_IDENTITY*in
SubFactorBYTEin

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

WinBioDeleteTemplate = ctypes.windll.winbio.WinBioDeleteTemplate
WinBioDeleteTemplate.restype = ctypes.c_int
WinBioDeleteTemplate.argtypes = [
    wintypes.DWORD,  # SessionHandle : DWORD
    wintypes.DWORD,  # UnitId : DWORD
    ctypes.c_void_p,  # Identity : WINBIO_IDENTITY*
    ctypes.c_ubyte,  # SubFactor : BYTE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	winbio = windows.NewLazySystemDLL("winbio.dll")
	procWinBioDeleteTemplate = winbio.NewProc("WinBioDeleteTemplate")
)

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