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

BluetoothGATTAbortReliableWrite

関数
GATT信頼性書き込みトランザクションを中止する。
DLLBluetoothApis.dll呼出規約winapi対応OSwindows8.0

シグネチャ

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

HRESULT BluetoothGATTAbortReliableWrite(
    HANDLE hDevice,
    ULONGLONG ReliableWriteContext,
    DWORD Flags
);

パラメーター

名前方向
hDeviceHANDLEin
ReliableWriteContextULONGLONGin
FlagsDWORDin

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT BluetoothGATTAbortReliableWrite(
    HANDLE hDevice,
    ULONGLONG ReliableWriteContext,
    DWORD Flags
);
[DllImport("BluetoothApis.dll", ExactSpelling = true)]
static extern int BluetoothGATTAbortReliableWrite(
    IntPtr hDevice,   // HANDLE
    ulong ReliableWriteContext,   // ULONGLONG
    uint Flags   // DWORD
);
<DllImport("BluetoothApis.dll", ExactSpelling:=True)>
Public Shared Function BluetoothGATTAbortReliableWrite(
    hDevice As IntPtr,   ' HANDLE
    ReliableWriteContext As ULong,   ' ULONGLONG
    Flags As UInteger   ' DWORD
) As Integer
End Function
' hDevice : HANDLE
' ReliableWriteContext : ULONGLONG
' Flags : DWORD
Declare PtrSafe Function BluetoothGATTAbortReliableWrite Lib "bluetoothapis" ( _
    ByVal hDevice As LongPtr, _
    ByVal ReliableWriteContext As LongLong, _
    ByVal Flags As Long) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

BluetoothGATTAbortReliableWrite = ctypes.windll.bluetoothapis.BluetoothGATTAbortReliableWrite
BluetoothGATTAbortReliableWrite.restype = ctypes.c_int
BluetoothGATTAbortReliableWrite.argtypes = [
    wintypes.HANDLE,  # hDevice : HANDLE
    ctypes.c_ulonglong,  # ReliableWriteContext : ULONGLONG
    wintypes.DWORD,  # Flags : DWORD
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('BluetoothApis.dll')
BluetoothGATTAbortReliableWrite = Fiddle::Function.new(
  lib['BluetoothGATTAbortReliableWrite'],
  [
    Fiddle::TYPE_VOIDP,  # hDevice : HANDLE
    -Fiddle::TYPE_LONG_LONG,  # ReliableWriteContext : ULONGLONG
    -Fiddle::TYPE_INT,  # Flags : DWORD
  ],
  Fiddle::TYPE_INT)
#[link(name = "bluetoothapis")]
extern "system" {
    fn BluetoothGATTAbortReliableWrite(
        hDevice: *mut core::ffi::c_void,  // HANDLE
        ReliableWriteContext: u64,  // ULONGLONG
        Flags: u32  // DWORD
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("BluetoothApis.dll")]
public static extern int BluetoothGATTAbortReliableWrite(IntPtr hDevice, ulong ReliableWriteContext, uint Flags);
"@
$api = Add-Type -MemberDefinition $sig -Name 'BluetoothApis_BluetoothGATTAbortReliableWrite' -Namespace Win32 -PassThru
# $api::BluetoothGATTAbortReliableWrite(hDevice, ReliableWriteContext, Flags)
#uselib "BluetoothApis.dll"
#func global BluetoothGATTAbortReliableWrite "BluetoothGATTAbortReliableWrite" sptr, sptr, sptr
; BluetoothGATTAbortReliableWrite hDevice, ReliableWriteContext, Flags   ; 戻り値は stat
; hDevice : HANDLE -> "sptr"
; ReliableWriteContext : ULONGLONG -> "sptr"
; Flags : DWORD -> "sptr"
; ※HSP3.7は int64 引数(64bit値渡し)に非対応です。
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "BluetoothApis.dll"
#cfunc global BluetoothGATTAbortReliableWrite "BluetoothGATTAbortReliableWrite" sptr, int64, int
; res = BluetoothGATTAbortReliableWrite(hDevice, ReliableWriteContext, Flags)
; hDevice : HANDLE -> "sptr"
; ReliableWriteContext : ULONGLONG -> "int64"
; Flags : DWORD -> "int"
; ※int64 引数の DLL 値渡しは x64 ランタイム(hsp3_64)のみ対応(x86 は未対応)。
; HRESULT BluetoothGATTAbortReliableWrite(HANDLE hDevice, ULONGLONG ReliableWriteContext, DWORD Flags)
#uselib "BluetoothApis.dll"
#cfunc global BluetoothGATTAbortReliableWrite "BluetoothGATTAbortReliableWrite" intptr, int64, int
; res = BluetoothGATTAbortReliableWrite(hDevice, ReliableWriteContext, Flags)
; hDevice : HANDLE -> "intptr"
; ReliableWriteContext : ULONGLONG -> "int64"
; Flags : DWORD -> "int"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	bluetoothapis = windows.NewLazySystemDLL("BluetoothApis.dll")
	procBluetoothGATTAbortReliableWrite = bluetoothapis.NewProc("BluetoothGATTAbortReliableWrite")
)

// hDevice (HANDLE), ReliableWriteContext (ULONGLONG), Flags (DWORD)
r1, _, err := procBluetoothGATTAbortReliableWrite.Call(
	uintptr(hDevice),
	uintptr(ReliableWriteContext),
	uintptr(Flags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function BluetoothGATTAbortReliableWrite(
  hDevice: THandle;   // HANDLE
  ReliableWriteContext: UInt64;   // ULONGLONG
  Flags: DWORD   // DWORD
): Integer; stdcall;
  external 'BluetoothApis.dll' name 'BluetoothGATTAbortReliableWrite';
result := DllCall("BluetoothApis\BluetoothGATTAbortReliableWrite"
    , "Ptr", hDevice   ; HANDLE
    , "Int64", ReliableWriteContext   ; ULONGLONG
    , "UInt", Flags   ; DWORD
    , "Int")   ; return: HRESULT
●BluetoothGATTAbortReliableWrite(hDevice, ReliableWriteContext, Flags) = DLL("BluetoothApis.dll", "int BluetoothGATTAbortReliableWrite(void*, qword, dword)")
# 呼び出し: BluetoothGATTAbortReliableWrite(hDevice, ReliableWriteContext, Flags)
# hDevice : HANDLE -> "void*"
# ReliableWriteContext : ULONGLONG -> "qword"
# Flags : DWORD -> "dword"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。