ホーム › Devices.BiometricFramework › WinBioEnrollSelect
WinBioEnrollSelect
関数登録処理中に使用するサブ要素を選択する。
シグネチャ
// winbio.dll
#include <windows.h>
HRESULT WinBioEnrollSelect(
DWORD SessionHandle,
ULONGLONG SelectorValue
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| SessionHandle | DWORD | in | 登録処理に用いるセッションのハンドル。 |
| SelectorValue | ULONGLONG | in | マルチセンサー登録時に選択するサブ要素を表す64ビット値。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// winbio.dll
#include <windows.h>
HRESULT WinBioEnrollSelect(
DWORD SessionHandle,
ULONGLONG SelectorValue
);[DllImport("winbio.dll", ExactSpelling = true)]
static extern int WinBioEnrollSelect(
uint SessionHandle, // DWORD
ulong SelectorValue // ULONGLONG
);<DllImport("winbio.dll", ExactSpelling:=True)>
Public Shared Function WinBioEnrollSelect(
SessionHandle As UInteger, ' DWORD
SelectorValue As ULong ' ULONGLONG
) As Integer
End Function' SessionHandle : DWORD
' SelectorValue : ULONGLONG
Declare PtrSafe Function WinBioEnrollSelect Lib "winbio" ( _
ByVal SessionHandle As Long, _
ByVal SelectorValue As LongLong) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WinBioEnrollSelect = ctypes.windll.winbio.WinBioEnrollSelect
WinBioEnrollSelect.restype = ctypes.c_int
WinBioEnrollSelect.argtypes = [
wintypes.DWORD, # SessionHandle : DWORD
ctypes.c_ulonglong, # SelectorValue : ULONGLONG
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('winbio.dll')
WinBioEnrollSelect = Fiddle::Function.new(
lib['WinBioEnrollSelect'],
[
-Fiddle::TYPE_INT, # SessionHandle : DWORD
-Fiddle::TYPE_LONG_LONG, # SelectorValue : ULONGLONG
],
Fiddle::TYPE_INT)#[link(name = "winbio")]
extern "system" {
fn WinBioEnrollSelect(
SessionHandle: u32, // DWORD
SelectorValue: u64 // ULONGLONG
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioEnrollSelect(uint SessionHandle, ulong SelectorValue);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioEnrollSelect' -Namespace Win32 -PassThru
# $api::WinBioEnrollSelect(SessionHandle, SelectorValue)#uselib "winbio.dll"
#func global WinBioEnrollSelect "WinBioEnrollSelect" sptr, sptr
; WinBioEnrollSelect SessionHandle, SelectorValue ; 戻り値は stat
; SessionHandle : DWORD -> "sptr"
; SelectorValue : ULONGLONG -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "winbio.dll"
#cfunc global WinBioEnrollSelect "WinBioEnrollSelect" int, int64
; res = WinBioEnrollSelect(SessionHandle, SelectorValue)
; SessionHandle : DWORD -> "int"
; SelectorValue : ULONGLONG -> "int64"
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。; HRESULT WinBioEnrollSelect(DWORD SessionHandle, ULONGLONG SelectorValue)
#uselib "winbio.dll"
#cfunc global WinBioEnrollSelect "WinBioEnrollSelect" int, int64
; res = WinBioEnrollSelect(SessionHandle, SelectorValue)
; SessionHandle : DWORD -> "int"
; SelectorValue : ULONGLONG -> "int64"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winbio = windows.NewLazySystemDLL("winbio.dll")
procWinBioEnrollSelect = winbio.NewProc("WinBioEnrollSelect")
)
// SessionHandle (DWORD), SelectorValue (ULONGLONG)
r1, _, err := procWinBioEnrollSelect.Call(
uintptr(SessionHandle),
uintptr(SelectorValue),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WinBioEnrollSelect(
SessionHandle: DWORD; // DWORD
SelectorValue: UInt64 // ULONGLONG
): Integer; stdcall;
external 'winbio.dll' name 'WinBioEnrollSelect';result := DllCall("winbio\WinBioEnrollSelect"
, "UInt", SessionHandle ; DWORD
, "Int64", SelectorValue ; ULONGLONG
, "Int") ; return: HRESULT●WinBioEnrollSelect(SessionHandle, SelectorValue) = DLL("winbio.dll", "int WinBioEnrollSelect(dword, qword)")
# 呼び出し: WinBioEnrollSelect(SessionHandle, SelectorValue)
# SessionHandle : DWORD -> "dword"
# SelectorValue : ULONGLONG -> "qword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "winbio" fn WinBioEnrollSelect(
SessionHandle: u32, // DWORD
SelectorValue: u64 // ULONGLONG
) callconv(std.os.windows.WINAPI) i32;proc WinBioEnrollSelect(
SessionHandle: uint32, # DWORD
SelectorValue: uint64 # ULONGLONG
): int32 {.importc: "WinBioEnrollSelect", stdcall, dynlib: "winbio.dll".}pragma(lib, "winbio");
extern(Windows)
int WinBioEnrollSelect(
uint SessionHandle, // DWORD
ulong SelectorValue // ULONGLONG
);ccall((:WinBioEnrollSelect, "winbio.dll"), stdcall, Int32,
(UInt32, UInt64),
SessionHandle, SelectorValue)
# SessionHandle : DWORD -> UInt32
# SelectorValue : ULONGLONG -> UInt64
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t WinBioEnrollSelect(
uint32_t SessionHandle,
uint64_t SelectorValue);
]]
local winbio = ffi.load("winbio")
-- winbio.WinBioEnrollSelect(SessionHandle, SelectorValue)
-- SessionHandle : DWORD
-- SelectorValue : ULONGLONG
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('winbio.dll');
const WinBioEnrollSelect = lib.func('__stdcall', 'WinBioEnrollSelect', 'int32_t', ['uint32_t', 'uint64_t']);
// WinBioEnrollSelect(SessionHandle, SelectorValue)
// SessionHandle : DWORD -> 'uint32_t'
// SelectorValue : ULONGLONG -> 'uint64_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("winbio.dll", {
WinBioEnrollSelect: { parameters: ["u32", "u64"], result: "i32" },
});
// lib.symbols.WinBioEnrollSelect(SessionHandle, SelectorValue)
// SessionHandle : DWORD -> "u32"
// SelectorValue : ULONGLONG -> "u64"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t WinBioEnrollSelect(
uint32_t SessionHandle,
uint64_t SelectorValue);
C, "winbio.dll");
// $ffi->WinBioEnrollSelect(SessionHandle, SelectorValue);
// SessionHandle : DWORD
// SelectorValue : ULONGLONG
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;
public interface Winbio extends StdCallLibrary {
Winbio INSTANCE = Native.load("winbio", Winbio.class);
int WinBioEnrollSelect(
int SessionHandle, // DWORD
long SelectorValue // ULONGLONG
);
}@[Link("winbio")]
lib Libwinbio
fun WinBioEnrollSelect = WinBioEnrollSelect(
SessionHandle : UInt32, # DWORD
SelectorValue : UInt64 # ULONGLONG
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WinBioEnrollSelectNative = Int32 Function(Uint32, Uint64);
typedef WinBioEnrollSelectDart = int Function(int, int);
final WinBioEnrollSelect = DynamicLibrary.open('winbio.dll')
.lookupFunction<WinBioEnrollSelectNative, WinBioEnrollSelectDart>('WinBioEnrollSelect');
// SessionHandle : DWORD -> Uint32
// SelectorValue : ULONGLONG -> Uint64
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function WinBioEnrollSelect(
SessionHandle: DWORD; // DWORD
SelectorValue: UInt64 // ULONGLONG
): Integer; stdcall;
external 'winbio.dll' name 'WinBioEnrollSelect';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WinBioEnrollSelect"
c_WinBioEnrollSelect :: Word32 -> Word64 -> IO Int32
-- SessionHandle : DWORD -> Word32
-- SelectorValue : ULONGLONG -> Word64
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let winbioenrollselect =
foreign "WinBioEnrollSelect"
(uint32_t @-> uint64_t @-> returning int32_t)
(* SessionHandle : DWORD -> uint32_t *)
(* SelectorValue : ULONGLONG -> uint64_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library winbio (t "winbio.dll"))
(cffi:use-foreign-library winbio)
(cffi:defcfun ("WinBioEnrollSelect" win-bio-enroll-select :convention :stdcall) :int32
(session-handle :uint32) ; DWORD
(selector-value :uint64)) ; ULONGLONG
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WinBioEnrollSelect = Win32::API::More->new('winbio',
'int WinBioEnrollSelect(DWORD SessionHandle, UINT64 SelectorValue)');
# my $ret = $WinBioEnrollSelect->Call($SessionHandle, $SelectorValue);
# SessionHandle : DWORD -> DWORD
# SelectorValue : ULONGLONG -> UINT64
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。