ホーム › Devices.Bluetooth › BluetoothUpdateDeviceRecord
BluetoothUpdateDeviceRecord
関数Bluetoothデバイスのキャッシュ情報を更新する。
シグネチャ
// BluetoothApis.dll
#include <windows.h>
DWORD BluetoothUpdateDeviceRecord(
const BLUETOOTH_DEVICE_INFO* pbtdi
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| pbtdi | BLUETOOTH_DEVICE_INFO* | in |
戻り値の型: DWORD
各言語での呼び出し定義
// BluetoothApis.dll
#include <windows.h>
DWORD BluetoothUpdateDeviceRecord(
const BLUETOOTH_DEVICE_INFO* pbtdi
);[DllImport("BluetoothApis.dll", ExactSpelling = true)]
static extern uint BluetoothUpdateDeviceRecord(
IntPtr pbtdi // BLUETOOTH_DEVICE_INFO*
);<DllImport("BluetoothApis.dll", ExactSpelling:=True)>
Public Shared Function BluetoothUpdateDeviceRecord(
pbtdi As IntPtr ' BLUETOOTH_DEVICE_INFO*
) As UInteger
End Function' pbtdi : BLUETOOTH_DEVICE_INFO*
Declare PtrSafe Function BluetoothUpdateDeviceRecord Lib "bluetoothapis" ( _
ByVal pbtdi As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
BluetoothUpdateDeviceRecord = ctypes.windll.bluetoothapis.BluetoothUpdateDeviceRecord
BluetoothUpdateDeviceRecord.restype = wintypes.DWORD
BluetoothUpdateDeviceRecord.argtypes = [
ctypes.c_void_p, # pbtdi : BLUETOOTH_DEVICE_INFO*
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('BluetoothApis.dll')
BluetoothUpdateDeviceRecord = Fiddle::Function.new(
lib['BluetoothUpdateDeviceRecord'],
[
Fiddle::TYPE_VOIDP, # pbtdi : BLUETOOTH_DEVICE_INFO*
],
-Fiddle::TYPE_INT)#[link(name = "bluetoothapis")]
extern "system" {
fn BluetoothUpdateDeviceRecord(
pbtdi: *const BLUETOOTH_DEVICE_INFO // BLUETOOTH_DEVICE_INFO*
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("BluetoothApis.dll")]
public static extern uint BluetoothUpdateDeviceRecord(IntPtr pbtdi);
"@
$api = Add-Type -MemberDefinition $sig -Name 'BluetoothApis_BluetoothUpdateDeviceRecord' -Namespace Win32 -PassThru
# $api::BluetoothUpdateDeviceRecord(pbtdi)#uselib "BluetoothApis.dll"
#func global BluetoothUpdateDeviceRecord "BluetoothUpdateDeviceRecord" sptr
; BluetoothUpdateDeviceRecord varptr(pbtdi) ; 戻り値は stat
; pbtdi : BLUETOOTH_DEVICE_INFO* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "BluetoothApis.dll" #cfunc global BluetoothUpdateDeviceRecord "BluetoothUpdateDeviceRecord" var ; res = BluetoothUpdateDeviceRecord(pbtdi) ; pbtdi : BLUETOOTH_DEVICE_INFO* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "BluetoothApis.dll" #cfunc global BluetoothUpdateDeviceRecord "BluetoothUpdateDeviceRecord" sptr ; res = BluetoothUpdateDeviceRecord(varptr(pbtdi)) ; pbtdi : BLUETOOTH_DEVICE_INFO* -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; DWORD BluetoothUpdateDeviceRecord(BLUETOOTH_DEVICE_INFO* pbtdi) #uselib "BluetoothApis.dll" #cfunc global BluetoothUpdateDeviceRecord "BluetoothUpdateDeviceRecord" var ; res = BluetoothUpdateDeviceRecord(pbtdi) ; pbtdi : BLUETOOTH_DEVICE_INFO* -> "var" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; DWORD BluetoothUpdateDeviceRecord(BLUETOOTH_DEVICE_INFO* pbtdi) #uselib "BluetoothApis.dll" #cfunc global BluetoothUpdateDeviceRecord "BluetoothUpdateDeviceRecord" intptr ; res = BluetoothUpdateDeviceRecord(varptr(pbtdi)) ; pbtdi : BLUETOOTH_DEVICE_INFO* -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
bluetoothapis = windows.NewLazySystemDLL("BluetoothApis.dll")
procBluetoothUpdateDeviceRecord = bluetoothapis.NewProc("BluetoothUpdateDeviceRecord")
)
// pbtdi (BLUETOOTH_DEVICE_INFO*)
r1, _, err := procBluetoothUpdateDeviceRecord.Call(
uintptr(pbtdi),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction BluetoothUpdateDeviceRecord(
pbtdi: Pointer // BLUETOOTH_DEVICE_INFO*
): DWORD; stdcall;
external 'BluetoothApis.dll' name 'BluetoothUpdateDeviceRecord';result := DllCall("BluetoothApis\BluetoothUpdateDeviceRecord"
, "Ptr", pbtdi ; BLUETOOTH_DEVICE_INFO*
, "UInt") ; return: DWORD●BluetoothUpdateDeviceRecord(pbtdi) = DLL("BluetoothApis.dll", "dword BluetoothUpdateDeviceRecord(void*)")
# 呼び出し: BluetoothUpdateDeviceRecord(pbtdi)
# pbtdi : BLUETOOTH_DEVICE_INFO* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。