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

alljoyn_busattachment_canceladvertisename

関数
広告中のバス名の広告を停止する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_busattachment_canceladvertisename(
    alljoyn_busattachment bus,
    LPCSTR name,
    WORD transports
);

パラメーター

名前方向
busalljoyn_busattachmentin
nameLPCSTRin
transportsWORDin

戻り値の型: QStatus

各言語での呼び出し定義

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

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

alljoyn_busattachment_canceladvertisename = ctypes.windll.msajapi.alljoyn_busattachment_canceladvertisename
alljoyn_busattachment_canceladvertisename.restype = ctypes.c_int
alljoyn_busattachment_canceladvertisename.argtypes = [
    ctypes.c_ssize_t,  # bus : alljoyn_busattachment
    wintypes.LPCSTR,  # name : LPCSTR
    ctypes.c_ushort,  # transports : WORD
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_busattachment_canceladvertisename = msajapi.NewProc("alljoyn_busattachment_canceladvertisename")
)

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