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

alljoyn_busattachment_getinterface

関数
バスから指定名のインターフェース記述を取得する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

alljoyn_interfacedescription alljoyn_busattachment_getinterface(
    alljoyn_busattachment bus,
    LPCSTR name
);

パラメーター

名前方向説明
busalljoyn_busattachmentin操作対象のバスアタッチメントハンドル。AllJoyn接続を表す。
nameLPCSTRin取得するインターフェイスの名前。完全修飾名で指定する。

戻り値の型: alljoyn_interfacedescription

各言語での呼び出し定義

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

alljoyn_interfacedescription alljoyn_busattachment_getinterface(
    alljoyn_busattachment bus,
    LPCSTR name
);
[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern IntPtr alljoyn_busattachment_getinterface(
    IntPtr bus,   // alljoyn_busattachment
    [MarshalAs(UnmanagedType.LPStr)] string name   // LPCSTR
);
<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_busattachment_getinterface(
    bus As IntPtr,   ' alljoyn_busattachment
    <MarshalAs(UnmanagedType.LPStr)> name As String   ' LPCSTR
) As IntPtr
End Function
' bus : alljoyn_busattachment
' name : LPCSTR
Declare PtrSafe Function alljoyn_busattachment_getinterface Lib "msajapi" ( _
    ByVal bus As LongPtr, _
    ByVal name As String) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

alljoyn_busattachment_getinterface = ctypes.windll.msajapi.alljoyn_busattachment_getinterface
alljoyn_busattachment_getinterface.restype = ctypes.c_ssize_t
alljoyn_busattachment_getinterface.argtypes = [
    ctypes.c_ssize_t,  # bus : alljoyn_busattachment
    wintypes.LPCSTR,  # name : LPCSTR
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_busattachment_getinterface = Fiddle::Function.new(
  lib['alljoyn_busattachment_getinterface'],
  [
    Fiddle::TYPE_INTPTR_T,  # bus : alljoyn_busattachment
    Fiddle::TYPE_VOIDP,  # name : LPCSTR
  ],
  Fiddle::TYPE_INTPTR_T)
#[link(name = "msajapi")]
extern "system" {
    fn alljoyn_busattachment_getinterface(
        bus: isize,  // alljoyn_busattachment
        name: *const u8  // LPCSTR
    ) -> isize;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSAJApi.dll")]
public static extern IntPtr alljoyn_busattachment_getinterface(IntPtr bus, [MarshalAs(UnmanagedType.LPStr)] string name);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_busattachment_getinterface' -Namespace Win32 -PassThru
# $api::alljoyn_busattachment_getinterface(bus, name)
#uselib "MSAJApi.dll"
#func global alljoyn_busattachment_getinterface "alljoyn_busattachment_getinterface" sptr, sptr
; alljoyn_busattachment_getinterface bus, name   ; 戻り値は stat
; bus : alljoyn_busattachment -> "sptr"
; name : LPCSTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "MSAJApi.dll"
#cfunc global alljoyn_busattachment_getinterface "alljoyn_busattachment_getinterface" sptr, str
; res = alljoyn_busattachment_getinterface(bus, name)
; bus : alljoyn_busattachment -> "sptr"
; name : LPCSTR -> "str"
; alljoyn_interfacedescription alljoyn_busattachment_getinterface(alljoyn_busattachment bus, LPCSTR name)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_busattachment_getinterface "alljoyn_busattachment_getinterface" intptr, str
; res = alljoyn_busattachment_getinterface(bus, name)
; bus : alljoyn_busattachment -> "intptr"
; name : LPCSTR -> "str"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_busattachment_getinterface = msajapi.NewProc("alljoyn_busattachment_getinterface")
)

// bus (alljoyn_busattachment), name (LPCSTR)
r1, _, err := procalljoyn_busattachment_getinterface.Call(
	uintptr(bus),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(name))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // alljoyn_interfacedescription
function alljoyn_busattachment_getinterface(
  bus: NativeInt;   // alljoyn_busattachment
  name: PAnsiChar   // LPCSTR
): NativeInt; stdcall;
  external 'MSAJApi.dll' name 'alljoyn_busattachment_getinterface';
result := DllCall("MSAJApi\alljoyn_busattachment_getinterface"
    , "Ptr", bus   ; alljoyn_busattachment
    , "AStr", name   ; LPCSTR
    , "Ptr")   ; return: alljoyn_interfacedescription
●alljoyn_busattachment_getinterface(bus, name) = DLL("MSAJApi.dll", "int alljoyn_busattachment_getinterface(int, char*)")
# 呼び出し: alljoyn_busattachment_getinterface(bus, name)
# bus : alljoyn_busattachment -> "int"
# name : LPCSTR -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。