ホーム › Devices.BiometricFramework › WinBioSetProperty
WinBioSetProperty
関数生体認証の指定プロパティ値を設定する。
シグネチャ
// winbio.dll
#include <windows.h>
HRESULT WinBioSetProperty(
DWORD SessionHandle,
DWORD PropertyType,
DWORD PropertyId,
DWORD UnitId, // optional
WINBIO_IDENTITY* Identity, // optional
BYTE SubFactor, // optional
void* PropertyBuffer,
UINT_PTR PropertyBufferSize
);パラメーター
| 名前 | 型 | 方向 | 説明 |
|---|---|---|---|
| SessionHandle | DWORD | in | プロパティ設定に用いるセッションのハンドル。 |
| PropertyType | DWORD | in | プロパティの種別(セッション/ユニット/テンプレート単位)を指定するDWORD値。 |
| PropertyId | DWORD | in | 設定するプロパティを識別するDWORD値。 |
| UnitId | DWORD | inoptional | ユニット単位プロパティの場合の対象ユニットID。不要時は0。 |
| Identity | WINBIO_IDENTITY* | inoptional | テンプレート単位プロパティの場合の対象ユーザーIDポインタ。不要時はNULL可。 |
| SubFactor | BYTE | inoptional | テンプレート単位プロパティの場合の下位ファクターを指定するバイト値。 |
| PropertyBuffer | void* | in | 設定するプロパティ値のデータバッファへのポインタ。 |
| PropertyBufferSize | UINT_PTR | in | PropertyBufferのバイトサイズ。 |
戻り値の型: HRESULT
各言語での呼び出し定義
// winbio.dll
#include <windows.h>
HRESULT WinBioSetProperty(
DWORD SessionHandle,
DWORD PropertyType,
DWORD PropertyId,
DWORD UnitId, // optional
WINBIO_IDENTITY* Identity, // optional
BYTE SubFactor, // optional
void* PropertyBuffer,
UINT_PTR PropertyBufferSize
);[DllImport("winbio.dll", ExactSpelling = true)]
static extern int WinBioSetProperty(
uint SessionHandle, // DWORD
uint PropertyType, // DWORD
uint PropertyId, // DWORD
uint UnitId, // DWORD optional
IntPtr Identity, // WINBIO_IDENTITY* optional
byte SubFactor, // BYTE optional
IntPtr PropertyBuffer, // void*
UIntPtr PropertyBufferSize // UINT_PTR
);<DllImport("winbio.dll", ExactSpelling:=True)>
Public Shared Function WinBioSetProperty(
SessionHandle As UInteger, ' DWORD
PropertyType As UInteger, ' DWORD
PropertyId As UInteger, ' DWORD
UnitId As UInteger, ' DWORD optional
Identity As IntPtr, ' WINBIO_IDENTITY* optional
SubFactor As Byte, ' BYTE optional
PropertyBuffer As IntPtr, ' void*
PropertyBufferSize As UIntPtr ' UINT_PTR
) As Integer
End Function' SessionHandle : DWORD
' PropertyType : DWORD
' PropertyId : DWORD
' UnitId : DWORD optional
' Identity : WINBIO_IDENTITY* optional
' SubFactor : BYTE optional
' PropertyBuffer : void*
' PropertyBufferSize : UINT_PTR
Declare PtrSafe Function WinBioSetProperty Lib "winbio" ( _
ByVal SessionHandle As Long, _
ByVal PropertyType As Long, _
ByVal PropertyId As Long, _
ByVal UnitId As Long, _
ByVal Identity As LongPtr, _
ByVal SubFactor As Byte, _
ByVal PropertyBuffer As LongPtr, _
ByVal PropertyBufferSize As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
WinBioSetProperty = ctypes.windll.winbio.WinBioSetProperty
WinBioSetProperty.restype = ctypes.c_int
WinBioSetProperty.argtypes = [
wintypes.DWORD, # SessionHandle : DWORD
wintypes.DWORD, # PropertyType : DWORD
wintypes.DWORD, # PropertyId : DWORD
wintypes.DWORD, # UnitId : DWORD optional
ctypes.c_void_p, # Identity : WINBIO_IDENTITY* optional
ctypes.c_ubyte, # SubFactor : BYTE optional
ctypes.POINTER(None), # PropertyBuffer : void*
ctypes.c_size_t, # PropertyBufferSize : UINT_PTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('winbio.dll')
WinBioSetProperty = Fiddle::Function.new(
lib['WinBioSetProperty'],
[
-Fiddle::TYPE_INT, # SessionHandle : DWORD
-Fiddle::TYPE_INT, # PropertyType : DWORD
-Fiddle::TYPE_INT, # PropertyId : DWORD
-Fiddle::TYPE_INT, # UnitId : DWORD optional
Fiddle::TYPE_VOIDP, # Identity : WINBIO_IDENTITY* optional
-Fiddle::TYPE_CHAR, # SubFactor : BYTE optional
Fiddle::TYPE_VOIDP, # PropertyBuffer : void*
Fiddle::TYPE_UINTPTR_T, # PropertyBufferSize : UINT_PTR
],
Fiddle::TYPE_INT)#[link(name = "winbio")]
extern "system" {
fn WinBioSetProperty(
SessionHandle: u32, // DWORD
PropertyType: u32, // DWORD
PropertyId: u32, // DWORD
UnitId: u32, // DWORD optional
Identity: *mut WINBIO_IDENTITY, // WINBIO_IDENTITY* optional
SubFactor: u8, // BYTE optional
PropertyBuffer: *mut (), // void*
PropertyBufferSize: usize // UINT_PTR
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("winbio.dll")]
public static extern int WinBioSetProperty(uint SessionHandle, uint PropertyType, uint PropertyId, uint UnitId, IntPtr Identity, byte SubFactor, IntPtr PropertyBuffer, UIntPtr PropertyBufferSize);
"@
$api = Add-Type -MemberDefinition $sig -Name 'winbio_WinBioSetProperty' -Namespace Win32 -PassThru
# $api::WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)#uselib "winbio.dll"
#func global WinBioSetProperty "WinBioSetProperty" sptr, sptr, sptr, sptr, sptr, sptr, sptr, sptr
; WinBioSetProperty SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, PropertyBufferSize ; 戻り値は stat
; SessionHandle : DWORD -> "sptr"
; PropertyType : DWORD -> "sptr"
; PropertyId : DWORD -> "sptr"
; UnitId : DWORD optional -> "sptr"
; Identity : WINBIO_IDENTITY* optional -> "sptr"
; SubFactor : BYTE optional -> "sptr"
; PropertyBuffer : void* -> "sptr"
; PropertyBufferSize : UINT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, var, int, sptr, sptr ; res = WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "var" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void* -> "sptr" ; PropertyBufferSize : UINT_PTR -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, sptr, int, sptr, sptr ; res = WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, PropertyBufferSize) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "sptr" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void* -> "sptr" ; PropertyBufferSize : UINT_PTR -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; HRESULT WinBioSetProperty(DWORD SessionHandle, DWORD PropertyType, DWORD PropertyId, DWORD UnitId, WINBIO_IDENTITY* Identity, BYTE SubFactor, void* PropertyBuffer, UINT_PTR PropertyBufferSize) #uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, var, int, intptr, intptr ; res = WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "var" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void* -> "intptr" ; PropertyBufferSize : UINT_PTR -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; HRESULT WinBioSetProperty(DWORD SessionHandle, DWORD PropertyType, DWORD PropertyId, DWORD UnitId, WINBIO_IDENTITY* Identity, BYTE SubFactor, void* PropertyBuffer, UINT_PTR PropertyBufferSize) #uselib "winbio.dll" #cfunc global WinBioSetProperty "WinBioSetProperty" int, int, int, int, intptr, int, intptr, intptr ; res = WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, varptr(Identity), SubFactor, PropertyBuffer, PropertyBufferSize) ; SessionHandle : DWORD -> "int" ; PropertyType : DWORD -> "int" ; PropertyId : DWORD -> "int" ; UnitId : DWORD optional -> "int" ; Identity : WINBIO_IDENTITY* optional -> "intptr" ; SubFactor : BYTE optional -> "int" ; PropertyBuffer : void* -> "intptr" ; PropertyBufferSize : UINT_PTR -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
winbio = windows.NewLazySystemDLL("winbio.dll")
procWinBioSetProperty = winbio.NewProc("WinBioSetProperty")
)
// SessionHandle (DWORD), PropertyType (DWORD), PropertyId (DWORD), UnitId (DWORD optional), Identity (WINBIO_IDENTITY* optional), SubFactor (BYTE optional), PropertyBuffer (void*), PropertyBufferSize (UINT_PTR)
r1, _, err := procWinBioSetProperty.Call(
uintptr(SessionHandle),
uintptr(PropertyType),
uintptr(PropertyId),
uintptr(UnitId),
uintptr(Identity),
uintptr(SubFactor),
uintptr(PropertyBuffer),
uintptr(PropertyBufferSize),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // HRESULTfunction WinBioSetProperty(
SessionHandle: DWORD; // DWORD
PropertyType: DWORD; // DWORD
PropertyId: DWORD; // DWORD
UnitId: DWORD; // DWORD optional
Identity: Pointer; // WINBIO_IDENTITY* optional
SubFactor: Byte; // BYTE optional
PropertyBuffer: Pointer; // void*
PropertyBufferSize: NativeUInt // UINT_PTR
): Integer; stdcall;
external 'winbio.dll' name 'WinBioSetProperty';result := DllCall("winbio\WinBioSetProperty"
, "UInt", SessionHandle ; DWORD
, "UInt", PropertyType ; DWORD
, "UInt", PropertyId ; DWORD
, "UInt", UnitId ; DWORD optional
, "Ptr", Identity ; WINBIO_IDENTITY* optional
, "UChar", SubFactor ; BYTE optional
, "Ptr", PropertyBuffer ; void*
, "UPtr", PropertyBufferSize ; UINT_PTR
, "Int") ; return: HRESULT●WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize) = DLL("winbio.dll", "int WinBioSetProperty(dword, dword, dword, dword, void*, byte, void*, int)")
# 呼び出し: WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)
# SessionHandle : DWORD -> "dword"
# PropertyType : DWORD -> "dword"
# PropertyId : DWORD -> "dword"
# UnitId : DWORD optional -> "dword"
# Identity : WINBIO_IDENTITY* optional -> "void*"
# SubFactor : BYTE optional -> "byte"
# PropertyBuffer : void* -> "void*"
# PropertyBufferSize : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。const std = @import("std");
extern "winbio" fn WinBioSetProperty(
SessionHandle: u32, // DWORD
PropertyType: u32, // DWORD
PropertyId: u32, // DWORD
UnitId: u32, // DWORD optional
Identity: [*c]WINBIO_IDENTITY, // WINBIO_IDENTITY* optional
SubFactor: u8, // BYTE optional
PropertyBuffer: ?*anyopaque, // void*
PropertyBufferSize: usize // UINT_PTR
) callconv(std.os.windows.WINAPI) i32;proc WinBioSetProperty(
SessionHandle: uint32, # DWORD
PropertyType: uint32, # DWORD
PropertyId: uint32, # DWORD
UnitId: uint32, # DWORD optional
Identity: ptr WINBIO_IDENTITY, # WINBIO_IDENTITY* optional
SubFactor: uint8, # BYTE optional
PropertyBuffer: pointer, # void*
PropertyBufferSize: uint # UINT_PTR
): int32 {.importc: "WinBioSetProperty", stdcall, dynlib: "winbio.dll".}pragma(lib, "winbio");
extern(Windows)
int WinBioSetProperty(
uint SessionHandle, // DWORD
uint PropertyType, // DWORD
uint PropertyId, // DWORD
uint UnitId, // DWORD optional
WINBIO_IDENTITY* Identity, // WINBIO_IDENTITY* optional
ubyte SubFactor, // BYTE optional
void* PropertyBuffer, // void*
size_t PropertyBufferSize // UINT_PTR
);ccall((:WinBioSetProperty, "winbio.dll"), stdcall, Int32,
(UInt32, UInt32, UInt32, UInt32, Ptr{WINBIO_IDENTITY}, UInt8, Ptr{Cvoid}, Csize_t),
SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)
# SessionHandle : DWORD -> UInt32
# PropertyType : DWORD -> UInt32
# PropertyId : DWORD -> UInt32
# UnitId : DWORD optional -> UInt32
# Identity : WINBIO_IDENTITY* optional -> Ptr{WINBIO_IDENTITY}
# SubFactor : BYTE optional -> UInt8
# PropertyBuffer : void* -> Ptr{Cvoid}
# PropertyBufferSize : UINT_PTR -> Csize_t
# stdcall は 32bit のみ意味を持つ(x64 では無視)。local ffi = require("ffi")
ffi.cdef[[
int32_t WinBioSetProperty(
uint32_t SessionHandle,
uint32_t PropertyType,
uint32_t PropertyId,
uint32_t UnitId,
void* Identity,
uint8_t SubFactor,
void* PropertyBuffer,
uintptr_t PropertyBufferSize);
]]
local winbio = ffi.load("winbio")
-- winbio.WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)
-- SessionHandle : DWORD
-- PropertyType : DWORD
-- PropertyId : DWORD
-- UnitId : DWORD optional
-- Identity : WINBIO_IDENTITY* optional
-- SubFactor : BYTE optional
-- PropertyBuffer : void*
-- PropertyBufferSize : UINT_PTR
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。const koffi = require('koffi');
const lib = koffi.load('winbio.dll');
const WinBioSetProperty = lib.func('__stdcall', 'WinBioSetProperty', 'int32_t', ['uint32_t', 'uint32_t', 'uint32_t', 'uint32_t', 'void *', 'uint8_t', 'void *', 'uintptr_t']);
// WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)
// SessionHandle : DWORD -> 'uint32_t'
// PropertyType : DWORD -> 'uint32_t'
// PropertyId : DWORD -> 'uint32_t'
// UnitId : DWORD optional -> 'uint32_t'
// Identity : WINBIO_IDENTITY* optional -> 'void *'
// SubFactor : BYTE optional -> 'uint8_t'
// PropertyBuffer : void* -> 'void *'
// PropertyBufferSize : UINT_PTR -> 'uintptr_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。const lib = Deno.dlopen("winbio.dll", {
WinBioSetProperty: { parameters: ["u32", "u32", "u32", "u32", "pointer", "u8", "pointer", "usize"], result: "i32" },
});
// lib.symbols.WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize)
// SessionHandle : DWORD -> "u32"
// PropertyType : DWORD -> "u32"
// PropertyId : DWORD -> "u32"
// UnitId : DWORD optional -> "u32"
// Identity : WINBIO_IDENTITY* optional -> "pointer"
// SubFactor : BYTE optional -> "u8"
// PropertyBuffer : void* -> "pointer"
// PropertyBufferSize : UINT_PTR -> "usize"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。<?php
$ffi = FFI::cdef(<<<C
int32_t WinBioSetProperty(
uint32_t SessionHandle,
uint32_t PropertyType,
uint32_t PropertyId,
uint32_t UnitId,
void* Identity,
uint8_t SubFactor,
void* PropertyBuffer,
size_t PropertyBufferSize);
C, "winbio.dll");
// $ffi->WinBioSetProperty(SessionHandle, PropertyType, PropertyId, UnitId, Identity, SubFactor, PropertyBuffer, PropertyBufferSize);
// SessionHandle : DWORD
// PropertyType : DWORD
// PropertyId : DWORD
// UnitId : DWORD optional
// Identity : WINBIO_IDENTITY* optional
// SubFactor : BYTE optional
// PropertyBuffer : void*
// PropertyBufferSize : UINT_PTR
// 構造体/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 WinBioSetProperty(
int SessionHandle, // DWORD
int PropertyType, // DWORD
int PropertyId, // DWORD
int UnitId, // DWORD optional
Pointer Identity, // WINBIO_IDENTITY* optional
byte SubFactor, // BYTE optional
Pointer PropertyBuffer, // void*
long PropertyBufferSize // UINT_PTR
);
}@[Link("winbio")]
lib Libwinbio
fun WinBioSetProperty = WinBioSetProperty(
SessionHandle : UInt32, # DWORD
PropertyType : UInt32, # DWORD
PropertyId : UInt32, # DWORD
UnitId : UInt32, # DWORD optional
Identity : WINBIO_IDENTITY*, # WINBIO_IDENTITY* optional
SubFactor : UInt8, # BYTE optional
PropertyBuffer : Void*, # void*
PropertyBufferSize : LibC::SizeT # UINT_PTR
) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。import 'dart:ffi';
import 'package:ffi/ffi.dart';
typedef WinBioSetPropertyNative = Int32 Function(Uint32, Uint32, Uint32, Uint32, Pointer<Void>, Uint8, Pointer<Void>, UintPtr);
typedef WinBioSetPropertyDart = int Function(int, int, int, int, Pointer<Void>, int, Pointer<Void>, int);
final WinBioSetProperty = DynamicLibrary.open('winbio.dll')
.lookupFunction<WinBioSetPropertyNative, WinBioSetPropertyDart>('WinBioSetProperty');
// SessionHandle : DWORD -> Uint32
// PropertyType : DWORD -> Uint32
// PropertyId : DWORD -> Uint32
// UnitId : DWORD optional -> Uint32
// Identity : WINBIO_IDENTITY* optional -> Pointer<Void>
// SubFactor : BYTE optional -> Uint8
// PropertyBuffer : void* -> Pointer<Void>
// PropertyBufferSize : UINT_PTR -> UintPtr
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。{$mode objfpc}{$H+}
function WinBioSetProperty(
SessionHandle: DWORD; // DWORD
PropertyType: DWORD; // DWORD
PropertyId: DWORD; // DWORD
UnitId: DWORD; // DWORD optional
Identity: Pointer; // WINBIO_IDENTITY* optional
SubFactor: Byte; // BYTE optional
PropertyBuffer: Pointer; // void*
PropertyBufferSize: NativeUInt // UINT_PTR
): Integer; stdcall;
external 'winbio.dll' name 'WinBioSetProperty';import Foreign
import Foreign.C.Types
import Foreign.C.String
foreign import stdcall safe "WinBioSetProperty"
c_WinBioSetProperty :: Word32 -> Word32 -> Word32 -> Word32 -> Ptr () -> Word8 -> Ptr () -> CUIntPtr -> IO Int32
-- SessionHandle : DWORD -> Word32
-- PropertyType : DWORD -> Word32
-- PropertyId : DWORD -> Word32
-- UnitId : DWORD optional -> Word32
-- Identity : WINBIO_IDENTITY* optional -> Ptr ()
-- SubFactor : BYTE optional -> Word8
-- PropertyBuffer : void* -> Ptr ()
-- PropertyBufferSize : UINT_PTR -> CUIntPtr
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。open Ctypes
open Foreign
let winbiosetproperty =
foreign "WinBioSetProperty"
(uint32_t @-> uint32_t @-> uint32_t @-> uint32_t @-> (ptr void) @-> uint8_t @-> (ptr void) @-> size_t @-> returning int32_t)
(* SessionHandle : DWORD -> uint32_t *)
(* PropertyType : DWORD -> uint32_t *)
(* PropertyId : DWORD -> uint32_t *)
(* UnitId : DWORD optional -> uint32_t *)
(* Identity : WINBIO_IDENTITY* optional -> (ptr void) *)
(* SubFactor : BYTE optional -> uint8_t *)
(* PropertyBuffer : void* -> (ptr void) *)
(* PropertyBufferSize : UINT_PTR -> size_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)(cffi:define-foreign-library winbio (t "winbio.dll"))
(cffi:use-foreign-library winbio)
(cffi:defcfun ("WinBioSetProperty" win-bio-set-property :convention :stdcall) :int32
(session-handle :uint32) ; DWORD
(property-type :uint32) ; DWORD
(property-id :uint32) ; DWORD
(unit-id :uint32) ; DWORD optional
(identity :pointer) ; WINBIO_IDENTITY* optional
(sub-factor :uint8) ; BYTE optional
(property-buffer :pointer) ; void*
(property-buffer-size :uint64)) ; UINT_PTR
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。use Win32::API;
my $WinBioSetProperty = Win32::API::More->new('winbio',
'int WinBioSetProperty(DWORD SessionHandle, DWORD PropertyType, DWORD PropertyId, DWORD UnitId, LPVOID Identity, BYTE SubFactor, LPVOID PropertyBuffer, WPARAM PropertyBufferSize)');
# my $ret = $WinBioSetProperty->Call($SessionHandle, $PropertyType, $PropertyId, $UnitId, $Identity, $SubFactor, $PropertyBuffer, $PropertyBufferSize);
# SessionHandle : DWORD -> DWORD
# PropertyType : DWORD -> DWORD
# PropertyId : DWORD -> DWORD
# UnitId : DWORD optional -> DWORD
# Identity : WINBIO_IDENTITY* optional -> LPVOID
# SubFactor : BYTE optional -> BYTE
# PropertyBuffer : void* -> LPVOID
# PropertyBufferSize : UINT_PTR -> WPARAM
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。関連項目
使用する型