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認証器一覧取得のオプションを保持するWEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS構造体へのポインタ。
ppAuthenticatorDetailsListWEBAUTHN_AUTHENTICATOR_DETAILS_LIST**out認証器の詳細一覧WEBAUTHN_AUTHENTICATOR_DETAILS_LISTを受け取るポインタ。WebAuthNFreeAuthenticatorListで解放する。

戻り値の型: 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)。
const std = @import("std");

extern "webauthn" fn WebAuthNGetAuthenticatorList(
    pWebAuthNGetAuthenticatorListOptions: [*c]WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS, // WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
    ppAuthenticatorDetailsList: [*c][*c]WEBAUTHN_AUTHENTICATOR_DETAILS_LIST // WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
) callconv(std.os.windows.WINAPI) i32;
proc WebAuthNGetAuthenticatorList(
    pWebAuthNGetAuthenticatorListOptions: ptr WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS,  # WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
    ppAuthenticatorDetailsList: ptr WEBAUTHN_AUTHENTICATOR_DETAILS_LIST  # WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
): int32 {.importc: "WebAuthNGetAuthenticatorList", stdcall, dynlib: "webauthn.dll".}
pragma(lib, "webauthn");
extern(Windows)
int WebAuthNGetAuthenticatorList(
    WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* pWebAuthNGetAuthenticatorListOptions,   // WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
    WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** ppAuthenticatorDetailsList   // WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
);
ccall((:WebAuthNGetAuthenticatorList, "webauthn.dll"), stdcall, Int32,
      (Ptr{WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS}, Ptr{WEBAUTHN_AUTHENTICATOR_DETAILS_LIST}),
      pWebAuthNGetAuthenticatorListOptions, ppAuthenticatorDetailsList)
# pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional -> Ptr{WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS}
# ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out -> Ptr{WEBAUTHN_AUTHENTICATOR_DETAILS_LIST}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t WebAuthNGetAuthenticatorList(
    void* pWebAuthNGetAuthenticatorListOptions,
    void* ppAuthenticatorDetailsList);
]]
local webauthn = ffi.load("webauthn")
-- webauthn.WebAuthNGetAuthenticatorList(pWebAuthNGetAuthenticatorListOptions, ppAuthenticatorDetailsList)
-- pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
-- ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('webauthn.dll');
const WebAuthNGetAuthenticatorList = lib.func('__stdcall', 'WebAuthNGetAuthenticatorList', 'int32_t', ['void *', 'void *']);
// WebAuthNGetAuthenticatorList(pWebAuthNGetAuthenticatorListOptions, ppAuthenticatorDetailsList)
// pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional -> 'void *'
// ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("webauthn.dll", {
  WebAuthNGetAuthenticatorList: { parameters: ["pointer", "pointer"], result: "i32" },
});
// lib.symbols.WebAuthNGetAuthenticatorList(pWebAuthNGetAuthenticatorListOptions, ppAuthenticatorDetailsList)
// pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional -> "pointer"
// ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t WebAuthNGetAuthenticatorList(
    void* pWebAuthNGetAuthenticatorListOptions,
    void* ppAuthenticatorDetailsList);
C, "webauthn.dll");
// $ffi->WebAuthNGetAuthenticatorList(pWebAuthNGetAuthenticatorListOptions, ppAuthenticatorDetailsList);
// pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
// ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
// 構造体/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 Webauthn extends StdCallLibrary {
    Webauthn INSTANCE = Native.load("webauthn", Webauthn.class);
    int WebAuthNGetAuthenticatorList(
        Pointer pWebAuthNGetAuthenticatorListOptions,   // WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
        Pointer ppAuthenticatorDetailsList   // WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
    );
}
@[Link("webauthn")]
lib Libwebauthn
  fun WebAuthNGetAuthenticatorList = WebAuthNGetAuthenticatorList(
    pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS*,   # WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
    ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST**   # WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef WebAuthNGetAuthenticatorListNative = Int32 Function(Pointer<Void>, Pointer<Void>);
typedef WebAuthNGetAuthenticatorListDart = int Function(Pointer<Void>, Pointer<Void>);
final WebAuthNGetAuthenticatorList = DynamicLibrary.open('webauthn.dll')
    .lookupFunction<WebAuthNGetAuthenticatorListNative, WebAuthNGetAuthenticatorListDart>('WebAuthNGetAuthenticatorList');
// pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional -> Pointer<Void>
// ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function WebAuthNGetAuthenticatorList(
  pWebAuthNGetAuthenticatorListOptions: Pointer;   // WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
  ppAuthenticatorDetailsList: Pointer   // WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
): Integer; stdcall;
  external 'webauthn.dll' name 'WebAuthNGetAuthenticatorList';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "WebAuthNGetAuthenticatorList"
  c_WebAuthNGetAuthenticatorList :: Ptr () -> Ptr () -> IO Int32
-- pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional -> Ptr ()
-- ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let webauthngetauthenticatorlist =
  foreign "WebAuthNGetAuthenticatorList"
    ((ptr void) @-> (ptr void) @-> returning int32_t)
(* pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional -> (ptr void) *)
(* ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library webauthn (t "webauthn.dll"))
(cffi:use-foreign-library webauthn)

(cffi:defcfun ("WebAuthNGetAuthenticatorList" web-auth-nget-authenticator-list :convention :stdcall) :int32
  (p-web-auth-nget-authenticator-list-options :pointer)   ; WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional
  (pp-authenticator-details-list :pointer))   ; WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $WebAuthNGetAuthenticatorList = Win32::API::More->new('webauthn',
    'int WebAuthNGetAuthenticatorList(LPVOID pWebAuthNGetAuthenticatorListOptions, LPVOID ppAuthenticatorDetailsList)');
# my $ret = $WebAuthNGetAuthenticatorList->Call($pWebAuthNGetAuthenticatorListOptions, $ppAuthenticatorDetailsList);
# pWebAuthNGetAuthenticatorListOptions : WEBAUTHN_AUTHENTICATOR_DETAILS_OPTIONS* optional -> LPVOID
# ppAuthenticatorDetailsList : WEBAUTHN_AUTHENTICATOR_DETAILS_LIST** out -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型