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

alljoyn_autopinger_removedestination

関数
指定pingグループから監視対象の宛先を削除する。
DLLMSAJApi.dll呼出規約winapi

シグネチャ

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

QStatus alljoyn_autopinger_removedestination(
    alljoyn_autopinger autopinger,
    LPCSTR group,
    LPCSTR destination,
    INT removeall
);

パラメーター

名前方向
autopingeralljoyn_autopingerin
groupLPCSTRin
destinationLPCSTRin
removeallINTin

戻り値の型: QStatus

各言語での呼び出し定義

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

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

alljoyn_autopinger_removedestination = ctypes.windll.msajapi.alljoyn_autopinger_removedestination
alljoyn_autopinger_removedestination.restype = ctypes.c_int
alljoyn_autopinger_removedestination.argtypes = [
    ctypes.c_ssize_t,  # autopinger : alljoyn_autopinger
    wintypes.LPCSTR,  # group : LPCSTR
    wintypes.LPCSTR,  # destination : LPCSTR
    ctypes.c_int,  # removeall : INT
]
require 'fiddle'
require 'fiddle/import'

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

var (
	msajapi = windows.NewLazySystemDLL("MSAJApi.dll")
	procalljoyn_autopinger_removedestination = msajapi.NewProc("alljoyn_autopinger_removedestination")
)

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