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

BluetoothSendAuthenticationResponseEx

関数
拡張版のBluetooth認証応答を送信する。
DLLBluetoothApis.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD BluetoothSendAuthenticationResponseEx(
    HANDLE hRadioIn,   // optional
    BLUETOOTH_AUTHENTICATE_RESPONSE* pauthResponse
);

パラメーター

名前方向
hRadioInHANDLEinoptional
pauthResponseBLUETOOTH_AUTHENTICATE_RESPONSE*in

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD BluetoothSendAuthenticationResponseEx(
    HANDLE hRadioIn,   // optional
    BLUETOOTH_AUTHENTICATE_RESPONSE* pauthResponse
);
[DllImport("BluetoothApis.dll", ExactSpelling = true)]
static extern uint BluetoothSendAuthenticationResponseEx(
    IntPtr hRadioIn,   // HANDLE optional
    IntPtr pauthResponse   // BLUETOOTH_AUTHENTICATE_RESPONSE*
);
<DllImport("BluetoothApis.dll", ExactSpelling:=True)>
Public Shared Function BluetoothSendAuthenticationResponseEx(
    hRadioIn As IntPtr,   ' HANDLE optional
    pauthResponse As IntPtr   ' BLUETOOTH_AUTHENTICATE_RESPONSE*
) As UInteger
End Function
' hRadioIn : HANDLE optional
' pauthResponse : BLUETOOTH_AUTHENTICATE_RESPONSE*
Declare PtrSafe Function BluetoothSendAuthenticationResponseEx Lib "bluetoothapis" ( _
    ByVal hRadioIn As LongPtr, _
    ByVal pauthResponse As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

BluetoothSendAuthenticationResponseEx = ctypes.windll.bluetoothapis.BluetoothSendAuthenticationResponseEx
BluetoothSendAuthenticationResponseEx.restype = wintypes.DWORD
BluetoothSendAuthenticationResponseEx.argtypes = [
    wintypes.HANDLE,  # hRadioIn : HANDLE optional
    ctypes.c_void_p,  # pauthResponse : BLUETOOTH_AUTHENTICATE_RESPONSE*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	bluetoothapis = windows.NewLazySystemDLL("BluetoothApis.dll")
	procBluetoothSendAuthenticationResponseEx = bluetoothapis.NewProc("BluetoothSendAuthenticationResponseEx")
)

// hRadioIn (HANDLE optional), pauthResponse (BLUETOOTH_AUTHENTICATE_RESPONSE*)
r1, _, err := procBluetoothSendAuthenticationResponseEx.Call(
	uintptr(hRadioIn),
	uintptr(pauthResponse),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function BluetoothSendAuthenticationResponseEx(
  hRadioIn: THandle;   // HANDLE optional
  pauthResponse: Pointer   // BLUETOOTH_AUTHENTICATE_RESPONSE*
): DWORD; stdcall;
  external 'BluetoothApis.dll' name 'BluetoothSendAuthenticationResponseEx';
result := DllCall("BluetoothApis\BluetoothSendAuthenticationResponseEx"
    , "Ptr", hRadioIn   ; HANDLE optional
    , "Ptr", pauthResponse   ; BLUETOOTH_AUTHENTICATE_RESPONSE*
    , "UInt")   ; return: DWORD
●BluetoothSendAuthenticationResponseEx(hRadioIn, pauthResponse) = DLL("BluetoothApis.dll", "dword BluetoothSendAuthenticationResponseEx(void*, void*)")
# 呼び出し: BluetoothSendAuthenticationResponseEx(hRadioIn, pauthResponse)
# hRadioIn : HANDLE optional -> "void*"
# pauthResponse : BLUETOOTH_AUTHENTICATE_RESPONSE* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。