Win32 API 日本語リファレンス
ホームSecurity.Authentication.WebAuthn › WebAuthNGetAuthenticatorList

WebAuthNGetAuthenticatorList

関数
利用可能な認証器の詳細一覧を取得する。
DLLwebauthn.dll呼出規約winapi

シグネチャ

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

HRESULT WebAuthNGetAuthenticatorList(
    WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* pWebAuthNGetAuthenticatorListOptions,   // optional
    WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** ppAuthenticatorDetailsList
);

パラメーター

名前方向
pWebAuthNGetAuthenticatorListOptionsWEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS*inoptional
ppAuthenticatorDetailsListWEBAUTHN_AUTHENTICATOR_DETAILS_LIST**out

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT WebAuthNGetAuthenticatorList(
    WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* pWebAuthNGetAuthenticatorListOptions,   // optional
    WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** ppAuthenticatorDetailsList
);
[DllImport("webauthn.dll", ExactSpelling = true)]
static extern int WebAuthNGetAuthenticatorList(
    IntPtr pWebAuthNGetAuthenticatorListOptions,   // WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
    IntPtr ppAuthenticatorDetailsList   // WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
);
<DllImport("webauthn.dll", ExactSpelling:=True)>
Public Shared Function WebAuthNGetAuthenticatorList(
    pWebAuthNGetAuthenticatorListOptions As IntPtr,   ' WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
    ppAuthenticatorDetailsList As IntPtr   ' WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
) As Integer
End Function
' pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
' ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
Declare PtrSafe Function WebAuthNGetAuthenticatorList Lib "webauthn" ( _
    ByVal pWebAuthNGetAuthenticatorListOptions As LongPtr, _
    ByVal ppAuthenticatorDetailsList As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

WebAuthNGetAuthenticatorList = ctypes.windll.webauthn.WebAuthNGetAuthenticatorList
WebAuthNGetAuthenticatorList.restype = ctypes.c_int
WebAuthNGetAuthenticatorList.argtypes = [
    ctypes.c_void_p,  # pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
    ctypes.c_void_p,  # ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	webauthn = windows.NewLazySystemDLL("webauthn.dll")
	procWebAuthNGetAuthenticatorList = webauthn.NewProc("WebAuthNGetAuthenticatorList")
)

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