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

alljoyn_proxybusobject_methodcall

関数
リモートオブジェクトのメソッドを同期呼出し応答を取得する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_proxybusobject_methodcall(
    alljoyn_proxybusobject proxyObj,
    LPCSTR ifaceName,
    LPCSTR methodName,
    alljoyn_msgarg args,
    UINT_PTR numArgs,
    alljoyn_message replyMsg,
    DWORD timeout,
    BYTE flags
);

パラメーター

名前方向
proxyObjalljoyn_proxybusobjectin
ifaceNameLPCSTRin
methodNameLPCSTRin
argsalljoyn_msgargin
numArgsUINT_PTRin
replyMsgalljoyn_messagein
timeoutDWORDin
flagsBYTEin

戻り値の型: QStatus

各言語での呼び出し定義

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

QStatus alljoyn_proxybusobject_methodcall(
    alljoyn_proxybusobject proxyObj,
    LPCSTR ifaceName,
    LPCSTR methodName,
    alljoyn_msgarg args,
    UINT_PTR numArgs,
    alljoyn_message replyMsg,
    DWORD timeout,
    BYTE flags
);
[DllImport("MSAJApi.dll", ExactSpelling = true)]
static extern int alljoyn_proxybusobject_methodcall(
    IntPtr proxyObj,   // alljoyn_proxybusobject
    [MarshalAs(UnmanagedType.LPStr)] string ifaceName,   // LPCSTR
    [MarshalAs(UnmanagedType.LPStr)] string methodName,   // LPCSTR
    IntPtr args,   // alljoyn_msgarg
    UIntPtr numArgs,   // UINT_PTR
    IntPtr replyMsg,   // alljoyn_message
    uint timeout,   // DWORD
    byte flags   // BYTE
);
<DllImport("MSAJApi.dll", ExactSpelling:=True)>
Public Shared Function alljoyn_proxybusobject_methodcall(
    proxyObj As IntPtr,   ' alljoyn_proxybusobject
    <MarshalAs(UnmanagedType.LPStr)> ifaceName As String,   ' LPCSTR
    <MarshalAs(UnmanagedType.LPStr)> methodName As String,   ' LPCSTR
    args As IntPtr,   ' alljoyn_msgarg
    numArgs As UIntPtr,   ' UINT_PTR
    replyMsg As IntPtr,   ' alljoyn_message
    timeout As UInteger,   ' DWORD
    flags As Byte   ' BYTE
) As Integer
End Function
' proxyObj : alljoyn_proxybusobject
' ifaceName : LPCSTR
' methodName : LPCSTR
' args : alljoyn_msgarg
' numArgs : UINT_PTR
' replyMsg : alljoyn_message
' timeout : DWORD
' flags : BYTE
Declare PtrSafe Function alljoyn_proxybusobject_methodcall Lib "msajapi" ( _
    ByVal proxyObj As LongPtr, _
    ByVal ifaceName As String, _
    ByVal methodName As String, _
    ByVal args As LongPtr, _
    ByVal numArgs As LongPtr, _
    ByVal replyMsg As LongPtr, _
    ByVal timeout As Long, _
    ByVal flags As Byte) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

alljoyn_proxybusobject_methodcall = ctypes.windll.msajapi.alljoyn_proxybusobject_methodcall
alljoyn_proxybusobject_methodcall.restype = ctypes.c_int
alljoyn_proxybusobject_methodcall.argtypes = [
    ctypes.c_ssize_t,  # proxyObj : alljoyn_proxybusobject
    wintypes.LPCSTR,  # ifaceName : LPCSTR
    wintypes.LPCSTR,  # methodName : LPCSTR
    ctypes.c_ssize_t,  # args : alljoyn_msgarg
    ctypes.c_size_t,  # numArgs : UINT_PTR
    ctypes.c_ssize_t,  # replyMsg : alljoyn_message
    wintypes.DWORD,  # timeout : DWORD
    ctypes.c_ubyte,  # flags : BYTE
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_proxybusobject_methodcall = msajapi.NewProc("alljoyn_proxybusobject_methodcall")
)

// proxyObj (alljoyn_proxybusobject), ifaceName (LPCSTR), methodName (LPCSTR), args (alljoyn_msgarg), numArgs (UINT_PTR), replyMsg (alljoyn_message), timeout (DWORD), flags (BYTE)
r1, _, err := procalljoyn_proxybusobject_methodcall.Call(
	uintptr(proxyObj),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(ifaceName))),
	uintptr(unsafe.Pointer(windows.BytePtrFromString(methodName))),
	uintptr(args),
	uintptr(numArgs),
	uintptr(replyMsg),
	uintptr(timeout),
	uintptr(flags),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // QStatus
function alljoyn_proxybusobject_methodcall(
  proxyObj: NativeInt;   // alljoyn_proxybusobject
  ifaceName: PAnsiChar;   // LPCSTR
  methodName: PAnsiChar;   // LPCSTR
  args: NativeInt;   // alljoyn_msgarg
  numArgs: NativeUInt;   // UINT_PTR
  replyMsg: NativeInt;   // alljoyn_message
  timeout: DWORD;   // DWORD
  flags: Byte   // BYTE
): Integer; stdcall;
  external 'MSAJApi.dll' name 'alljoyn_proxybusobject_methodcall';
result := DllCall("MSAJApi\alljoyn_proxybusobject_methodcall"
    , "Ptr", proxyObj   ; alljoyn_proxybusobject
    , "AStr", ifaceName   ; LPCSTR
    , "AStr", methodName   ; LPCSTR
    , "Ptr", args   ; alljoyn_msgarg
    , "UPtr", numArgs   ; UINT_PTR
    , "Ptr", replyMsg   ; alljoyn_message
    , "UInt", timeout   ; DWORD
    , "UChar", flags   ; BYTE
    , "Int")   ; return: QStatus
●alljoyn_proxybusobject_methodcall(proxyObj, ifaceName, methodName, args, numArgs, replyMsg, timeout, flags) = DLL("MSAJApi.dll", "int alljoyn_proxybusobject_methodcall(int, char*, char*, int, int, int, dword, byte)")
# 呼び出し: alljoyn_proxybusobject_methodcall(proxyObj, ifaceName, methodName, args, numArgs, replyMsg, timeout, flags)
# proxyObj : alljoyn_proxybusobject -> "int"
# ifaceName : LPCSTR -> "char*"
# methodName : LPCSTR -> "char*"
# args : alljoyn_msgarg -> "int"
# numArgs : UINT_PTR -> "int"
# replyMsg : alljoyn_message -> "int"
# timeout : DWORD -> "dword"
# flags : BYTE -> "byte"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。