ホーム › Devices.AllJoyn › alljoyn_aboutobjectdescription_getinterfaces
alljoyn_aboutobjectdescription_getinterfaces
関数指定パスで公開されるインターフェース名一覧を取得する。
シグネチャ
// MSAJApi.dll
#include <windows.h>
UINT_PTR alljoyn_aboutobjectdescription_getinterfaces(
alljoyn_aboutobjectdescription description,
LPCSTR path,
const CHAR** interfaces,
UINT_PTR numInterfaces
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| description | alljoyn_aboutobjectdescription | in |
| path | LPCSTR | in |
| interfaces | CHAR** | in |
| numInterfaces | UINT_PTR | in |
戻り値の型: UINT_PTR
各言語での呼び出し定義
// MSAJApi.dll
#include <windows.h>
UINT_PTR alljoyn_aboutobjectdescription_getinterfaces(
alljoyn_aboutobjectdescription description,
LPCSTR path,
const CHAR** interfaces,
UINT_PTR numInterfaces
);[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern UIntPtr alljoyn_aboutobjectdescription_getinterfaces(
IntPtr description, // alljoyn_aboutobjectdescription
[MarshalAs(UnmanagedType.LPStr)] string path, // LPCSTR
IntPtr interfaces, // CHAR**
UIntPtr numInterfaces // UINT_PTR
);<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_aboutobjectdescription_getinterfaces(
description As IntPtr, ' alljoyn_aboutobjectdescription
<MarshalAs(UnmanagedType.LPStr)> path As String, ' LPCSTR
interfaces As IntPtr, ' CHAR**
numInterfaces As UIntPtr ' UINT_PTR
) As UIntPtr
End Function' description : alljoyn_aboutobjectdescription
' path : LPCSTR
' interfaces : CHAR**
' numInterfaces : UINT_PTR
Declare PtrSafe Function alljoyn_aboutobjectdescription_getinterfaces Lib "msajapi" ( _
ByVal description As LongPtr, _
ByVal path As String, _
ByVal interfaces As LongPtr, _
ByVal numInterfaces As LongPtr) As LongPtr
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
alljoyn_aboutobjectdescription_getinterfaces = ctypes.windll.msajapi.alljoyn_aboutobjectdescription_getinterfaces
alljoyn_aboutobjectdescription_getinterfaces.restype = ctypes.c_size_t
alljoyn_aboutobjectdescription_getinterfaces.argtypes = [
ctypes.c_ssize_t, # description : alljoyn_aboutobjectdescription
wintypes.LPCSTR, # path : LPCSTR
ctypes.c_void_p, # interfaces : CHAR**
ctypes.c_size_t, # numInterfaces : UINT_PTR
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_aboutobjectdescription_getinterfaces = Fiddle::Function.new(
lib['alljoyn_aboutobjectdescription_getinterfaces'],
[
Fiddle::TYPE_INTPTR_T, # description : alljoyn_aboutobjectdescription
Fiddle::TYPE_VOIDP, # path : LPCSTR
Fiddle::TYPE_VOIDP, # interfaces : CHAR**
Fiddle::TYPE_UINTPTR_T, # numInterfaces : UINT_PTR
],
Fiddle::TYPE_UINTPTR_T)#[link(name = "msajapi")]
extern "system" {
fn alljoyn_aboutobjectdescription_getinterfaces(
description: isize, // alljoyn_aboutobjectdescription
path: *const u8, // LPCSTR
interfaces: *const *const i8, // CHAR**
numInterfaces: usize // UINT_PTR
) -> usize;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("MSAJApi.dll")]
public static extern UIntPtr alljoyn_aboutobjectdescription_getinterfaces(IntPtr description, [MarshalAs(UnmanagedType.LPStr)] string path, IntPtr interfaces, UIntPtr numInterfaces);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_aboutobjectdescription_getinterfaces' -Namespace Win32 -PassThru
# $api::alljoyn_aboutobjectdescription_getinterfaces(description, path, interfaces, numInterfaces)#uselib "MSAJApi.dll"
#func global alljoyn_aboutobjectdescription_getinterfaces "alljoyn_aboutobjectdescription_getinterfaces" sptr, sptr, sptr, sptr
; alljoyn_aboutobjectdescription_getinterfaces description, path, varptr(interfaces), numInterfaces ; 戻り値は stat
; description : alljoyn_aboutobjectdescription -> "sptr"
; path : LPCSTR -> "sptr"
; interfaces : CHAR** -> "sptr"
; numInterfaces : UINT_PTR -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。出力引数:
#uselib "MSAJApi.dll" #cfunc global alljoyn_aboutobjectdescription_getinterfaces "alljoyn_aboutobjectdescription_getinterfaces" sptr, str, var, sptr ; res = alljoyn_aboutobjectdescription_getinterfaces(description, path, interfaces, numInterfaces) ; description : alljoyn_aboutobjectdescription -> "sptr" ; path : LPCSTR -> "str" ; interfaces : CHAR** -> "var" ; numInterfaces : UINT_PTR -> "sptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。#uselib "MSAJApi.dll" #cfunc global alljoyn_aboutobjectdescription_getinterfaces "alljoyn_aboutobjectdescription_getinterfaces" sptr, str, sptr, sptr ; res = alljoyn_aboutobjectdescription_getinterfaces(description, path, varptr(interfaces), numInterfaces) ; description : alljoyn_aboutobjectdescription -> "sptr" ; path : LPCSTR -> "str" ; interfaces : CHAR** -> "sptr" ; numInterfaces : UINT_PTR -> "sptr" ; ※出力/バッファ引数はポインタ方式(token=sptr / 呼び出しは varptr(変数))。
出力引数:
; UINT_PTR alljoyn_aboutobjectdescription_getinterfaces(alljoyn_aboutobjectdescription description, LPCSTR path, CHAR** interfaces, UINT_PTR numInterfaces) #uselib "MSAJApi.dll" #cfunc global alljoyn_aboutobjectdescription_getinterfaces "alljoyn_aboutobjectdescription_getinterfaces" intptr, str, var, intptr ; res = alljoyn_aboutobjectdescription_getinterfaces(description, path, interfaces, numInterfaces) ; description : alljoyn_aboutobjectdescription -> "intptr" ; path : LPCSTR -> "str" ; interfaces : CHAR** -> "var" ; numInterfaces : UINT_PTR -> "intptr" ; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。; UINT_PTR alljoyn_aboutobjectdescription_getinterfaces(alljoyn_aboutobjectdescription description, LPCSTR path, CHAR** interfaces, UINT_PTR numInterfaces) #uselib "MSAJApi.dll" #cfunc global alljoyn_aboutobjectdescription_getinterfaces "alljoyn_aboutobjectdescription_getinterfaces" intptr, str, intptr, intptr ; res = alljoyn_aboutobjectdescription_getinterfaces(description, path, varptr(interfaces), numInterfaces) ; description : alljoyn_aboutobjectdescription -> "intptr" ; path : LPCSTR -> "str" ; interfaces : CHAR** -> "intptr" ; numInterfaces : UINT_PTR -> "intptr" ; ※出力/バッファ引数はポインタ方式(token=intptr / 呼び出しは varptr(変数))。
import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
procalljoyn_aboutobjectdescription_getinterfaces = msajapi.NewProc("alljoyn_aboutobjectdescription_getinterfaces")
)
// description (alljoyn_aboutobjectdescription), path (LPCSTR), interfaces (CHAR**), numInterfaces (UINT_PTR)
r1, _, err := procalljoyn_aboutobjectdescription_getinterfaces.Call(
uintptr(description),
uintptr(unsafe.Pointer(windows.BytePtrFromString(path))),
uintptr(interfaces),
uintptr(numInterfaces),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // UINT_PTRfunction alljoyn_aboutobjectdescription_getinterfaces(
description: NativeInt; // alljoyn_aboutobjectdescription
path: PAnsiChar; // LPCSTR
interfaces: Pointer; // CHAR**
numInterfaces: NativeUInt // UINT_PTR
): NativeUInt; stdcall;
external 'MSAJApi.dll' name 'alljoyn_aboutobjectdescription_getinterfaces';result := DllCall("MSAJApi\alljoyn_aboutobjectdescription_getinterfaces"
, "Ptr", description ; alljoyn_aboutobjectdescription
, "AStr", path ; LPCSTR
, "Ptr", interfaces ; CHAR**
, "UPtr", numInterfaces ; UINT_PTR
, "UPtr") ; return: UINT_PTR●alljoyn_aboutobjectdescription_getinterfaces(description, path, interfaces, numInterfaces) = DLL("MSAJApi.dll", "int alljoyn_aboutobjectdescription_getinterfaces(int, char*, void*, int)")
# 呼び出し: alljoyn_aboutobjectdescription_getinterfaces(description, path, interfaces, numInterfaces)
# description : alljoyn_aboutobjectdescription -> "int"
# path : LPCSTR -> "char*"
# interfaces : CHAR** -> "void*"
# numInterfaces : UINT_PTR -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。