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

BluetoothSdpGetContainerElementData

関数
SDPコンテナ要素から個別要素のデータを取得する。
DLLBluetoothApis.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

DWORD BluetoothSdpGetContainerElementData(
    BYTE* pContainerStream,
    DWORD cbContainerLength,
    INT_PTR* pElement,
    SDP_ELEMENT_DATA* pData
);

パラメーター

名前方向
pContainerStreamBYTE*in
cbContainerLengthDWORDin
pElementINT_PTR*inout
pDataSDP_ELEMENT_DATA*out

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD BluetoothSdpGetContainerElementData(
    BYTE* pContainerStream,
    DWORD cbContainerLength,
    INT_PTR* pElement,
    SDP_ELEMENT_DATA* pData
);
[DllImport("BluetoothApis.dll", ExactSpelling = true)]
static extern uint BluetoothSdpGetContainerElementData(
    IntPtr pContainerStream,   // BYTE*
    uint cbContainerLength,   // DWORD
    ref IntPtr pElement,   // INT_PTR* in/out
    IntPtr pData   // SDP_ELEMENT_DATA* out
);
<DllImport("BluetoothApis.dll", ExactSpelling:=True)>
Public Shared Function BluetoothSdpGetContainerElementData(
    pContainerStream As IntPtr,   ' BYTE*
    cbContainerLength As UInteger,   ' DWORD
    ByRef pElement As IntPtr,   ' INT_PTR* in/out
    pData As IntPtr   ' SDP_ELEMENT_DATA* out
) As UInteger
End Function
' pContainerStream : BYTE*
' cbContainerLength : DWORD
' pElement : INT_PTR* in/out
' pData : SDP_ELEMENT_DATA* out
Declare PtrSafe Function BluetoothSdpGetContainerElementData Lib "bluetoothapis" ( _
    ByVal pContainerStream As LongPtr, _
    ByVal cbContainerLength As Long, _
    ByRef pElement As LongPtr, _
    ByVal pData As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

BluetoothSdpGetContainerElementData = ctypes.windll.bluetoothapis.BluetoothSdpGetContainerElementData
BluetoothSdpGetContainerElementData.restype = wintypes.DWORD
BluetoothSdpGetContainerElementData.argtypes = [
    ctypes.POINTER(ctypes.c_ubyte),  # pContainerStream : BYTE*
    wintypes.DWORD,  # cbContainerLength : DWORD
    ctypes.POINTER(ctypes.c_ssize_t),  # pElement : INT_PTR* in/out
    ctypes.c_void_p,  # pData : SDP_ELEMENT_DATA* out
]
require 'fiddle'
require 'fiddle/import'

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

var (
	bluetoothapis = windows.NewLazySystemDLL("BluetoothApis.dll")
	procBluetoothSdpGetContainerElementData = bluetoothapis.NewProc("BluetoothSdpGetContainerElementData")
)

// pContainerStream (BYTE*), cbContainerLength (DWORD), pElement (INT_PTR* in/out), pData (SDP_ELEMENT_DATA* out)
r1, _, err := procBluetoothSdpGetContainerElementData.Call(
	uintptr(pContainerStream),
	uintptr(cbContainerLength),
	uintptr(pElement),
	uintptr(pData),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function BluetoothSdpGetContainerElementData(
  pContainerStream: Pointer;   // BYTE*
  cbContainerLength: DWORD;   // DWORD
  pElement: Pointer;   // INT_PTR* in/out
  pData: Pointer   // SDP_ELEMENT_DATA* out
): DWORD; stdcall;
  external 'BluetoothApis.dll' name 'BluetoothSdpGetContainerElementData';
result := DllCall("BluetoothApis\BluetoothSdpGetContainerElementData"
    , "Ptr", pContainerStream   ; BYTE*
    , "UInt", cbContainerLength   ; DWORD
    , "Ptr", pElement   ; INT_PTR* in/out
    , "Ptr", pData   ; SDP_ELEMENT_DATA* out
    , "UInt")   ; return: DWORD
●BluetoothSdpGetContainerElementData(pContainerStream, cbContainerLength, pElement, pData) = DLL("BluetoothApis.dll", "dword BluetoothSdpGetContainerElementData(void*, dword, void*, void*)")
# 呼び出し: BluetoothSdpGetContainerElementData(pContainerStream, cbContainerLength, pElement, pData)
# pContainerStream : BYTE* -> "void*"
# cbContainerLength : DWORD -> "dword"
# pElement : INT_PTR* in/out -> "void*"
# pData : SDP_ELEMENT_DATA* out -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。