ホーム › Security.Authentication.WebAuthn › WebAuthNFreeAssertion
WebAuthNFreeAssertion
関数WebAuthnのアサーション構造体を解放する。
シグネチャ
// webauthn.dll
#include <windows.h>
void WebAuthNFreeAssertion(
WEBAUTHN_ASSERTION* pWebAuthNAssertion
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| pWebAuthNAssertion | WEBAUTHN_ASSERTION* | in | GetAssertionで取得したWEBAUTHN_ASSERTION構造体へのポインタ。解放対象。 |
戻り値の型: void
各言語での呼び出し定義
// webauthn.dll
#include <windows.h>
void WebAuthNFreeAssertion(
WEBAUTHN_ASSERTION* pWebAuthNAssertion
);[DllImport("webauthn.dll", ExactSpelling = true)]
static extern void WebAuthNFreeAssertion(
IntPtr pWebAuthNAssertion // WEBAUTHN_ASSERTION*
);<DllImport("webauthn.dll", ExactSpelling:=True)>
Public Shared Sub WebAuthNFreeAssertion(
pWebAuthNAssertion As IntPtr ' WEBAUTHN_ASSERTION*
)
End Sub' pWebAuthNAssertion : WEBAUTHN_ASSERTION*
Declare PtrSafe Sub WebAuthNFreeAssertion Lib "webauthn" ( _
ByVal pWebAuthNAssertion As LongPtr)
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WebAuthNFreeAssertion = ctypes.windll.webauthn.WebAuthNFreeAssertion
WebAuthNFreeAssertion.restype = None
WebAuthNFreeAssertion.argtypes = [
ctypes.c_void_p, # pWebAuthNAssertion : WEBAUTHN_ASSERTION*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('webauthn.dll')
WebAuthNFreeAssertion = Fiddle::Function.new(
lib['WebAuthNFreeAssertion'],
[
Fiddle::TYPE_VOIDP, # pWebAuthNAssertion : WEBAUTHN_ASSERTION*
],
Fiddle::TYPE_VOID)#[link(name = "webauthn")]
extern "system" {
fn WebAuthNFreeAssertion(
pWebAuthNAssertion: *mut WEBAUTHN_ASSERTION // WEBAUTHN_ASSERTION*
);
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("webauthn.dll")]
public static extern void WebAuthNFreeAssertion(IntPtr pWebAuthNAssertion);
"@
$api = Add-Type -MemberDefinition $sig -Name 'webauthn_WebAuthNFreeAssertion' -Namespace Win32 -PassThru
# $api::WebAuthNFreeAssertion(pWebAuthNAssertion)#uselib "webauthn.dll"
#func global WebAuthNFreeAssertion "WebAuthNFreeAssertion" sptr
; WebAuthNFreeAssertion varptr(pWebAuthNAssertion)
; pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> "sptr"出力引数:
#uselib "webauthn.dll" #func global WebAuthNFreeAssertion "WebAuthNFreeAssertion" var ; WebAuthNFreeAssertion pWebAuthNAssertion ; pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "webauthn.dll" #func global WebAuthNFreeAssertion "WebAuthNFreeAssertion" sptr ; WebAuthNFreeAssertion varptr(pWebAuthNAssertion) ; pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; void WebAuthNFreeAssertion(WEBAUTHN_ASSERTION* pWebAuthNAssertion) #uselib "webauthn.dll" #func global WebAuthNFreeAssertion "WebAuthNFreeAssertion" var ; WebAuthNFreeAssertion pWebAuthNAssertion ; pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; void WebAuthNFreeAssertion(WEBAUTHN_ASSERTION* pWebAuthNAssertion) #uselib "webauthn.dll" #func global WebAuthNFreeAssertion "WebAuthNFreeAssertion" intptr ; WebAuthNFreeAssertion varptr(pWebAuthNAssertion) ; pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
webauthn = windows.NewLazySystemDLL("webauthn.dll")
procWebAuthNFreeAssertion = webauthn.NewProc("WebAuthNFreeAssertion")
)
// pWebAuthNAssertion (WEBAUTHN_ASSERTION*)
r1, _, err := procWebAuthNFreeAssertion.Call(
uintptr(pWebAuthNAssertion),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // voidprocedure WebAuthNFreeAssertion(
pWebAuthNAssertion: Pointer // WEBAUTHN_ASSERTION*
); stdcall;
external 'webauthn.dll' name 'WebAuthNFreeAssertion';result := DllCall("webauthn\WebAuthNFreeAssertion"
, "Ptr", pWebAuthNAssertion ; WEBAUTHN_ASSERTION*
, "Int") ; return: void●WebAuthNFreeAssertion(pWebAuthNAssertion) = DLL("webauthn.dll", "int WebAuthNFreeAssertion(void*)")
# 呼び出し: WebAuthNFreeAssertion(pWebAuthNAssertion)
# pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "webauthn" fn WebAuthNFreeAssertion(
pWebAuthNAssertion: [*c]WEBAUTHN_ASSERTION // WEBAUTHN_ASSERTION*
) callconv(std.os.windows.WINAPI) void;proc WebAuthNFreeAssertion(
pWebAuthNAssertion: ptr WEBAUTHN_ASSERTION # WEBAUTHN_ASSERTION*
) {.importc: "WebAuthNFreeAssertion", stdcall, dynlib: "webauthn.dll".}pragma(lib, "webauthn");
extern(Windows)
void WebAuthNFreeAssertion(
WEBAUTHN_ASSERTION* pWebAuthNAssertion // WEBAUTHN_ASSERTION*
);ccall((:WebAuthNFreeAssertion, "webauthn.dll"), stdcall, Cvoid,
(Ptr{WEBAUTHN_ASSERTION},),
pWebAuthNAssertion)
# pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> Ptr{WEBAUTHN_ASSERTION}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
void WebAuthNFreeAssertion(
void* pWebAuthNAssertion);
]]
local webauthn = ffi.load("webauthn")
-- webauthn.WebAuthNFreeAssertion(pWebAuthNAssertion)
-- pWebAuthNAssertion : WEBAUTHN_ASSERTION*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('webauthn.dll');
const WebAuthNFreeAssertion = lib.func('__stdcall', 'WebAuthNFreeAssertion', 'void', ['void *']);
// WebAuthNFreeAssertion(pWebAuthNAssertion)
// pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("webauthn.dll", {
WebAuthNFreeAssertion: { parameters: ["pointer"], result: "void" },
});
// lib.symbols.WebAuthNFreeAssertion(pWebAuthNAssertion)
// pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
void WebAuthNFreeAssertion(
void* pWebAuthNAssertion);
C, "webauthn.dll");
// $ffi->WebAuthNFreeAssertion(pWebAuthNAssertion);
// pWebAuthNAssertion : WEBAUTHN_ASSERTION*
// 構造体/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);
void WebAuthNFreeAssertion(
Pointer pWebAuthNAssertion // WEBAUTHN_ASSERTION*
);
}@[Link("webauthn")]
lib Libwebauthn
fun WebAuthNFreeAssertion = WebAuthNFreeAssertion(
pWebAuthNAssertion : WEBAUTHN_ASSERTION* # WEBAUTHN_ASSERTION*
) : Void
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WebAuthNFreeAssertionNative = Void Function(Pointer<Void>);
typedef WebAuthNFreeAssertionDart = void Function(Pointer<Void>);
final WebAuthNFreeAssertion = DynamicLibrary.open('webauthn.dll')
.lookupFunction<WebAuthNFreeAssertionNative, WebAuthNFreeAssertionDart>('WebAuthNFreeAssertion');
// pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
procedure WebAuthNFreeAssertion(
pWebAuthNAssertion: Pointer // WEBAUTHN_ASSERTION*
); stdcall;
external 'webauthn.dll' name 'WebAuthNFreeAssertion';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WebAuthNFreeAssertion"
c_WebAuthNFreeAssertion :: Ptr () -> IO ()
-- pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let webauthnfreeassertion =
foreign "WebAuthNFreeAssertion"
((ptr void) @-> returning void)
(* pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library webauthn (t "webauthn.dll"))
(cffi:use-foreign-library webauthn)
(cffi:defcfun ("WebAuthNFreeAssertion" web-auth-nfree-assertion :convention :stdcall) :void
(p-web-auth-nassertion :pointer)) ; WEBAUTHN_ASSERTION*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WebAuthNFreeAssertion = Win32::API::More->new('webauthn',
'void WebAuthNFreeAssertion(LPVOID pWebAuthNAssertion)');
# my $ret = $WebAuthNFreeAssertion->Call($pWebAuthNAssertion);
# pWebAuthNAssertion : WEBAUTHN_ASSERTION* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型