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

WinBioGetCredentialState

関数
指定IDの生体認証資格情報の状態を取得する。
DLLwinbio.dll呼出規約winapi対応OSWindows 7 以降

シグネチャ

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

HRESULT WinBioGetCredentialState(
    WINBIO_IDENTITY Identity,
    WINBIO_CREDENTIAL_TYPE Type,
    WINBIO_CREDENTIAL_STATE* CredentialState
);

パラメーター

名前方向
IdentityWINBIO_IDENTITYin
TypeWINBIO_CREDENTIAL_TYPEin
CredentialStateWINBIO_CREDENTIAL_STATE*out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT WinBioGetCredentialState(
    WINBIO_IDENTITY Identity,
    WINBIO_CREDENTIAL_TYPE Type,
    WINBIO_CREDENTIAL_STATE* CredentialState
);
[DllImport("winbio.dll", ExactSpelling = true)]
static extern int WinBioGetCredentialState(
    WINBIO_IDENTITY Identity,   // WINBIO_IDENTITY
    int Type,   // WINBIO_CREDENTIAL_TYPE
    out int CredentialState   // WINBIO_CREDENTIAL_STATE* out
);
<DllImport("winbio.dll", ExactSpelling:=True)>
Public Shared Function WinBioGetCredentialState(
    Identity As WINBIO_IDENTITY,   ' WINBIO_IDENTITY
    Type As Integer,   ' WINBIO_CREDENTIAL_TYPE
    <Out> ByRef CredentialState As Integer   ' WINBIO_CREDENTIAL_STATE* out
) As Integer
End Function
' Identity : WINBIO_IDENTITY
' Type : WINBIO_CREDENTIAL_TYPE
' CredentialState : WINBIO_CREDENTIAL_STATE* out
Declare PtrSafe Function WinBioGetCredentialState Lib "winbio" ( _
    ByVal Identity As LongPtr, _
    ByVal Type As Long, _
    ByRef CredentialState As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WinBioGetCredentialState = ctypes.windll.winbio.WinBioGetCredentialState
WinBioGetCredentialState.restype = ctypes.c_int
WinBioGetCredentialState.argtypes = [
    WINBIO_IDENTITY,  # Identity : WINBIO_IDENTITY
    ctypes.c_int,  # Type : WINBIO_CREDENTIAL_TYPE
    ctypes.c_void_p,  # CredentialState : WINBIO_CREDENTIAL_STATE* out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('winbio.dll')
WinBioGetCredentialState = Fiddle::Function.new(
  lib['WinBioGetCredentialState'],
  [
    Fiddle::TYPE_VOIDP,  # Identity : WINBIO_IDENTITY
    Fiddle::TYPE_INT,  # Type : WINBIO_CREDENTIAL_TYPE
    Fiddle::TYPE_VOIDP,  # CredentialState : WINBIO_CREDENTIAL_STATE* out
  ],
  Fiddle::TYPE_INT)
#[link(name = "winbio")]
extern "system" {
    fn WinBioGetCredentialState(
        Identity: WINBIO_IDENTITY,  // WINBIO_IDENTITY
        Type: i32,  // WINBIO_CREDENTIAL_TYPE
        CredentialState: *mut i32  // WINBIO_CREDENTIAL_STATE* out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioGetCredentialState(WINBIO_IDENTITY Identity, int Type, out int CredentialState);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioGetCredentialState' -Namespace Win32 -PassThru
# $api::WinBioGetCredentialState(Identity, Type, CredentialState)
#uselib "winbio.dll"
#func global WinBioGetCredentialState "WinBioGetCredentialState" sptr, sptr, sptr
; WinBioGetCredentialState Identity, Type, CredentialState   ; 戻り値は stat
; Identity : WINBIO_IDENTITY -> "sptr"
; Type : WINBIO_CREDENTIAL_TYPE -> "sptr"
; CredentialState : WINBIO_CREDENTIAL_STATE* out -> "sptr"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "winbio.dll"
#cfunc global WinBioGetCredentialState "WinBioGetCredentialState" int, int, int
; res = WinBioGetCredentialState(Identity, Type, CredentialState)
; Identity : WINBIO_IDENTITY -> "int"
; Type : WINBIO_CREDENTIAL_TYPE -> "int"
; CredentialState : WINBIO_CREDENTIAL_STATE* out -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
; HRESULT WinBioGetCredentialState(WINBIO_IDENTITY Identity, WINBIO_CREDENTIAL_TYPE Type, WINBIO_CREDENTIAL_STATE* CredentialState)
#uselib "winbio.dll"
#cfunc global WinBioGetCredentialState "WinBioGetCredentialState" int, int, int
; res = WinBioGetCredentialState(Identity, Type, CredentialState)
; Identity : WINBIO_IDENTITY -> "int"
; Type : WINBIO_CREDENTIAL_TYPE -> "int"
; CredentialState : WINBIO_CREDENTIAL_STATE* out -> "int"
; ※値渡し構造体は直接渡せません。intにパック、または var で構造体変数を渡してください。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	winbio = windows.NewLazySystemDLL("winbio.dll")
	procWinBioGetCredentialState = winbio.NewProc("WinBioGetCredentialState")
)

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