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

alljoyn_busattachment_createinterface_secure

関数
セキュリティポリシー付きのインターフェース記述を作成する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_busattachment_createinterface_secure(
    alljoyn_busattachment bus,
    LPCSTR name,
    alljoyn_interfacedescription* iface,
    alljoyn_interfacedescription_securitypolicy secPolicy
);

パラメーター

名前方向
busalljoyn_busattachmentin
nameLPCSTRin
ifacealljoyn_interfacedescription*inout
secPolicyalljoyn_interfacedescription_securitypolicyin

戻り値の型: QStatus

各言語での呼び出し定義

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

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

alljoyn_busattachment_createinterface_secure = ctypes.windll.msajapi.alljoyn_busattachment_createinterface_secure
alljoyn_busattachment_createinterface_secure.restype = ctypes.c_int
alljoyn_busattachment_createinterface_secure.argtypes = [
    ctypes.c_ssize_t,  # bus : alljoyn_busattachment
    wintypes.LPCSTR,  # name : LPCSTR
    ctypes.c_void_p,  # iface : alljoyn_interfacedescription* in/out
    ctypes.c_int,  # secPolicy : alljoyn_interfacedescription_securitypolicy
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_busattachment_createinterface_secure = msajapi.NewProc("alljoyn_busattachment_createinterface_secure")
)

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