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

alljoyn_interfacedescription_getproperty

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

シグネチャ

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

INT alljoyn_interfacedescription_getproperty(
    alljoyn_interfacedescription iface,
    LPCSTR name,
    alljoyn_interfacedescription_property* property
);

パラメーター

名前方向
ifacealljoyn_interfacedescriptionin
nameLPCSTRin
propertyalljoyn_interfacedescription_property*inout

戻り値の型: INT

各言語での呼び出し定義

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

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

alljoyn_interfacedescription_getproperty = ctypes.windll.msajapi.alljoyn_interfacedescription_getproperty
alljoyn_interfacedescription_getproperty.restype = ctypes.c_int
alljoyn_interfacedescription_getproperty.argtypes = [
    ctypes.c_ssize_t,  # iface : alljoyn_interfacedescription
    wintypes.LPCSTR,  # name : LPCSTR
    ctypes.c_void_p,  # property : alljoyn_interfacedescription_property* in/out
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('MSAJApi.dll')
alljoyn_interfacedescription_getproperty = Fiddle::Function.new(
  lib['alljoyn_interfacedescription_getproperty'],
  [
    Fiddle::TYPE_INTPTR_T,  # iface : alljoyn_interfacedescription
    Fiddle::TYPE_VOIDP,  # name : LPCSTR
    Fiddle::TYPE_VOIDP,  # property : alljoyn_interfacedescription_property* in/out
  ],
  Fiddle::TYPE_INT)
#[link(name = "msajapi")]
extern "system" {
    fn alljoyn_interfacedescription_getproperty(
        iface: isize,  // alljoyn_interfacedescription
        name: *const u8,  // LPCSTR
        property: *mut alljoyn_interfacedescription_property  // alljoyn_interfacedescription_property* in/out
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("MSAJApi.dll")]
public static extern int alljoyn_interfacedescription_getproperty(IntPtr iface, [MarshalAs(UnmanagedType.LPStr)] string name, IntPtr property);
"@
$api = Add-Type -MemberDefinition $sig -Name 'MSAJApi_alljoyn_interfacedescription_getproperty' -Namespace Win32 -PassThru
# $api::alljoyn_interfacedescription_getproperty(iface, name, property)
#uselib "MSAJApi.dll"
#func global alljoyn_interfacedescription_getproperty "alljoyn_interfacedescription_getproperty" sptr, sptr, sptr
; alljoyn_interfacedescription_getproperty iface, name, varptr(property)   ; 戻り値は stat
; iface : alljoyn_interfacedescription -> "sptr"
; name : LPCSTR -> "sptr"
; property : alljoyn_interfacedescription_property* in/out -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_getproperty "alljoyn_interfacedescription_getproperty" sptr, str, var
; res = alljoyn_interfacedescription_getproperty(iface, name, property)
; iface : alljoyn_interfacedescription -> "sptr"
; name : LPCSTR -> "str"
; property : alljoyn_interfacedescription_property* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; INT alljoyn_interfacedescription_getproperty(alljoyn_interfacedescription iface, LPCSTR name, alljoyn_interfacedescription_property* property)
#uselib "MSAJApi.dll"
#cfunc global alljoyn_interfacedescription_getproperty "alljoyn_interfacedescription_getproperty" intptr, str, var
; res = alljoyn_interfacedescription_getproperty(iface, name, property)
; iface : alljoyn_interfacedescription -> "intptr"
; name : LPCSTR -> "str"
; property : alljoyn_interfacedescription_property* in/out -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_interfacedescription_getproperty = msajapi.NewProc("alljoyn_interfacedescription_getproperty")
)

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