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対象の自動Pingオブジェクトのハンドル。
groupLPCSTRin宛先を除去するPingグループの識別名。
destinationLPCSTRin監視から除去する宛先のバス名。
removeallINTin重複登録を全て除去するか。非0で全件除去する。

戻り値の型: 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)。
const std = @import("std");

extern "msajapi" fn alljoyn_autopinger_removedestination(
    autopinger: isize, // alljoyn_autopinger
    group: [*c]const u8, // LPCSTR
    destination: [*c]const u8, // LPCSTR
    removeall: i32 // INT
) callconv(std.os.windows.WINAPI) i32;
proc alljoyn_autopinger_removedestination(
    autopinger: int,  # alljoyn_autopinger
    group: cstring,  # LPCSTR
    destination: cstring,  # LPCSTR
    removeall: int32  # INT
): int32 {.importc: "alljoyn_autopinger_removedestination", stdcall, dynlib: "MSAJApi.dll".}
pragma(lib, "msajapi");
extern(Windows)
int alljoyn_autopinger_removedestination(
    ptrdiff_t autopinger,   // alljoyn_autopinger
    const(char)* group,   // LPCSTR
    const(char)* destination,   // LPCSTR
    int removeall   // INT
);
ccall((:alljoyn_autopinger_removedestination, "MSAJApi.dll"), stdcall, Int32,
      (Int, Cstring, Cstring, Int32),
      autopinger, group, destination, removeall)
# autopinger : alljoyn_autopinger -> Int
# group : LPCSTR -> Cstring
# destination : LPCSTR -> Cstring
# removeall : INT -> Int32
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t alljoyn_autopinger_removedestination(
    intptr_t autopinger,
    const char* group,
    const char* destination,
    int32_t removeall);
]]
local msajapi = ffi.load("msajapi")
-- msajapi.alljoyn_autopinger_removedestination(autopinger, group, destination, removeall)
-- autopinger : alljoyn_autopinger
-- group : LPCSTR
-- destination : LPCSTR
-- removeall : INT
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('MSAJApi.dll');
const alljoyn_autopinger_removedestination = lib.func('__stdcall', 'alljoyn_autopinger_removedestination', 'int32_t', ['intptr_t', 'str', 'str', 'int32_t']);
// alljoyn_autopinger_removedestination(autopinger, group, destination, removeall)
// autopinger : alljoyn_autopinger -> 'intptr_t'
// group : LPCSTR -> 'str'
// destination : LPCSTR -> 'str'
// removeall : INT -> 'int32_t'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("MSAJApi.dll", {
  alljoyn_autopinger_removedestination: { parameters: ["isize", "buffer", "buffer", "i32"], result: "i32" },
});
// lib.symbols.alljoyn_autopinger_removedestination(autopinger, group, destination, removeall)
// autopinger : alljoyn_autopinger -> "isize"
// group : LPCSTR -> "buffer"
// destination : LPCSTR -> "buffer"
// removeall : INT -> "i32"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t alljoyn_autopinger_removedestination(
    intptr_t autopinger,
    const char* group,
    const char* destination,
    int32_t removeall);
C, "MSAJApi.dll");
// $ffi->alljoyn_autopinger_removedestination(autopinger, group, destination, removeall);
// autopinger : alljoyn_autopinger
// group : LPCSTR
// destination : LPCSTR
// removeall : INT
// 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
// WINAPI(stdcall): x64 では呼出規約が統一されるため問題なし。x86 では __stdcall 対応のラッパが必要な場合あり。
import com.sun.jna.*;
import com.sun.jna.ptr.*;
import com.sun.jna.win32.StdCallLibrary;
import com.sun.jna.win32.W32APIOptions;

public interface Msajapi extends StdCallLibrary {
    Msajapi INSTANCE = Native.load("msajapi", Msajapi.class);
    int alljoyn_autopinger_removedestination(
        long autopinger,   // alljoyn_autopinger
        String group,   // LPCSTR
        String destination,   // LPCSTR
        int removeall   // INT
    );
}
@[Link("msajapi")]
lib LibMSAJApi
  fun alljoyn_autopinger_removedestination = alljoyn_autopinger_removedestination(
    autopinger : LibC::SSizeT,   # alljoyn_autopinger
    group : UInt8*,   # LPCSTR
    destination : UInt8*,   # LPCSTR
    removeall : Int32   # INT
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef alljoyn_autopinger_removedestinationNative = Int32 Function(IntPtr, Pointer<Utf8>, Pointer<Utf8>, Int32);
typedef alljoyn_autopinger_removedestinationDart = int Function(int, Pointer<Utf8>, Pointer<Utf8>, int);
final alljoyn_autopinger_removedestination = DynamicLibrary.open('MSAJApi.dll')
    .lookupFunction<alljoyn_autopinger_removedestinationNative, alljoyn_autopinger_removedestinationDart>('alljoyn_autopinger_removedestination');
// autopinger : alljoyn_autopinger -> IntPtr
// group : LPCSTR -> Pointer<Utf8>
// destination : LPCSTR -> Pointer<Utf8>
// removeall : INT -> Int32
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
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';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "alljoyn_autopinger_removedestination"
  c_alljoyn_autopinger_removedestination :: CIntPtr -> CString -> CString -> Int32 -> IO Int32
-- autopinger : alljoyn_autopinger -> CIntPtr
-- group : LPCSTR -> CString
-- destination : LPCSTR -> CString
-- removeall : INT -> Int32
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let alljoyn_autopinger_removedestination =
  foreign "alljoyn_autopinger_removedestination"
    (intptr_t @-> string @-> string @-> int32_t @-> returning int32_t)
(* autopinger : alljoyn_autopinger -> intptr_t *)
(* group : LPCSTR -> string *)
(* destination : LPCSTR -> string *)
(* removeall : INT -> int32_t *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library msajapi (t "MSAJApi.dll"))
(cffi:use-foreign-library msajapi)

(cffi:defcfun ("alljoyn_autopinger_removedestination" alljoyn-autopinger-removedestination :convention :stdcall) :int32
  (autopinger :int64)   ; alljoyn_autopinger
  (group :string)   ; LPCSTR
  (destination :string)   ; LPCSTR
  (removeall :int32))   ; INT
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $alljoyn_autopinger_removedestination = Win32::API::More->new('MSAJApi',
    'int alljoyn_autopinger_removedestination(LPARAM autopinger, LPCSTR group, LPCSTR destination, int removeall)');
# my $ret = $alljoyn_autopinger_removedestination->Call($autopinger, $group, $destination, $removeall);
# autopinger : alljoyn_autopinger -> LPARAM
# group : LPCSTR -> LPCSTR
# destination : LPCSTR -> LPCSTR
# removeall : INT -> int
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型