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

alljoyn_interfacedescription_addproperty

関数
インターフェイス記述にプロパティを追加する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_interfacedescription_addproperty(
    alljoyn_interfacedescription iface,
    LPCSTR name,
    LPCSTR signature,
    BYTE access
);

パラメーター

名前方向
ifacealljoyn_interfacedescriptionin
nameLPCSTRin
signatureLPCSTRin
accessBYTEin

戻り値の型: QStatus

各言語での呼び出し定義

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

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

alljoyn_interfacedescription_addproperty = ctypes.windll.msajapi.alljoyn_interfacedescription_addproperty
alljoyn_interfacedescription_addproperty.restype = ctypes.c_int
alljoyn_interfacedescription_addproperty.argtypes = [
    ctypes.c_ssize_t,  # iface : alljoyn_interfacedescription
    wintypes.LPCSTR,  # name : LPCSTR
    wintypes.LPCSTR,  # signature : LPCSTR
    ctypes.c_ubyte,  # access : BYTE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_interfacedescription_addproperty = msajapi.NewProc("alljoyn_interfacedescription_addproperty")
)

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