Win32 API 日本語リファレンス
ホームNetworkManagement.P2P › PeerCollabUnsubscribeEndpointData

PeerCollabUnsubscribeEndpointData

関数
エンドポイントデータの購読を解除する。
DLLP2P.dll呼出規約winapi対応OSWindows Vista 以降

シグネチャ

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

HRESULT PeerCollabUnsubscribeEndpointData(
    const PEER_ENDPOINT* pcEndpoint
);

パラメーター

名前方向説明
pcEndpointPEER_ENDPOINT*inデータ変更通知の購読を解除する対象のエンドポイントを示すPEER_ENDPOINT構造体へのポインター。

戻り値の型: HRESULT

各言語での呼び出し定義

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

HRESULT PeerCollabUnsubscribeEndpointData(
    const PEER_ENDPOINT* pcEndpoint
);
[DllImport("P2P.dll", ExactSpelling = true)]
static extern int PeerCollabUnsubscribeEndpointData(
    IntPtr pcEndpoint   // PEER_ENDPOINT*
);
<DllImport("P2P.dll", ExactSpelling:=True)>
Public Shared Function PeerCollabUnsubscribeEndpointData(
    pcEndpoint As IntPtr   ' PEER_ENDPOINT*
) As Integer
End Function
' pcEndpoint : PEER_ENDPOINT*
Declare PtrSafe Function PeerCollabUnsubscribeEndpointData Lib "p2p" ( _
    ByVal pcEndpoint As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

PeerCollabUnsubscribeEndpointData = ctypes.windll.p2p.PeerCollabUnsubscribeEndpointData
PeerCollabUnsubscribeEndpointData.restype = ctypes.c_int
PeerCollabUnsubscribeEndpointData.argtypes = [
    ctypes.c_void_p,  # pcEndpoint : PEER_ENDPOINT*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('P2P.dll')
PeerCollabUnsubscribeEndpointData = Fiddle::Function.new(
  lib['PeerCollabUnsubscribeEndpointData'],
  [
    Fiddle::TYPE_VOIDP,  # pcEndpoint : PEER_ENDPOINT*
  ],
  Fiddle::TYPE_INT)
#[link(name = "p2p")]
extern "system" {
    fn PeerCollabUnsubscribeEndpointData(
        pcEndpoint: *const PEER_ENDPOINT  // PEER_ENDPOINT*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("P2P.dll")]
public static extern int PeerCollabUnsubscribeEndpointData(IntPtr pcEndpoint);
"@
$api = Add-Type -MemberDefinition $sig -Name 'P2P_PeerCollabUnsubscribeEndpointData' -Namespace Win32 -PassThru
# $api::PeerCollabUnsubscribeEndpointData(pcEndpoint)
#uselib "P2P.dll"
#func global PeerCollabUnsubscribeEndpointData "PeerCollabUnsubscribeEndpointData" sptr
; PeerCollabUnsubscribeEndpointData varptr(pcEndpoint)   ; 戻り値は stat
; pcEndpoint : PEER_ENDPOINT* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
出力引数:
#uselib "P2P.dll"
#cfunc global PeerCollabUnsubscribeEndpointData "PeerCollabUnsubscribeEndpointData" var
; res = PeerCollabUnsubscribeEndpointData(pcEndpoint)
; pcEndpoint : PEER_ENDPOINT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
出力引数:
; HRESULT PeerCollabUnsubscribeEndpointData(PEER_ENDPOINT* pcEndpoint)
#uselib "P2P.dll"
#cfunc global PeerCollabUnsubscribeEndpointData "PeerCollabUnsubscribeEndpointData" var
; res = PeerCollabUnsubscribeEndpointData(pcEndpoint)
; pcEndpoint : PEER_ENDPOINT* -> "var"
; ※出力/バッファ引数は var 方式(変数を直接渡す)。varptr 方式にも切替可。
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	p2p = windows.NewLazySystemDLL("P2P.dll")
	procPeerCollabUnsubscribeEndpointData = p2p.NewProc("PeerCollabUnsubscribeEndpointData")
)

// pcEndpoint (PEER_ENDPOINT*)
r1, _, err := procPeerCollabUnsubscribeEndpointData.Call(
	uintptr(pcEndpoint),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // HRESULT
function PeerCollabUnsubscribeEndpointData(
  pcEndpoint: Pointer   // PEER_ENDPOINT*
): Integer; stdcall;
  external 'P2P.dll' name 'PeerCollabUnsubscribeEndpointData';
result := DllCall("P2P\PeerCollabUnsubscribeEndpointData"
    , "Ptr", pcEndpoint   ; PEER_ENDPOINT*
    , "Int")   ; return: HRESULT
●PeerCollabUnsubscribeEndpointData(pcEndpoint) = DLL("P2P.dll", "int PeerCollabUnsubscribeEndpointData(void*)")
# 呼び出し: PeerCollabUnsubscribeEndpointData(pcEndpoint)
# pcEndpoint : PEER_ENDPOINT* -> "void*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。
const std = @import("std");

extern "p2p" fn PeerCollabUnsubscribeEndpointData(
    pcEndpoint: [*c]PEER_ENDPOINT // PEER_ENDPOINT*
) callconv(std.os.windows.WINAPI) i32;
proc PeerCollabUnsubscribeEndpointData(
    pcEndpoint: ptr PEER_ENDPOINT  # PEER_ENDPOINT*
): int32 {.importc: "PeerCollabUnsubscribeEndpointData", stdcall, dynlib: "P2P.dll".}
pragma(lib, "p2p");
extern(Windows)
int PeerCollabUnsubscribeEndpointData(
    PEER_ENDPOINT* pcEndpoint   // PEER_ENDPOINT*
);
ccall((:PeerCollabUnsubscribeEndpointData, "P2P.dll"), stdcall, Int32,
      (Ptr{PEER_ENDPOINT},),
      pcEndpoint)
# pcEndpoint : PEER_ENDPOINT* -> Ptr{PEER_ENDPOINT}
# stdcall は 32bit のみ意味を持つ(x64 では無視)。
local ffi = require("ffi")
ffi.cdef[[
int32_t PeerCollabUnsubscribeEndpointData(
    void* pcEndpoint);
]]
local p2p = ffi.load("p2p")
-- p2p.PeerCollabUnsubscribeEndpointData(pcEndpoint)
-- pcEndpoint : PEER_ENDPOINT*
-- 構造体/GUIDへのポインタは cdef が通るよう void* で表記(実型は各引数コメント参照)。値渡し構造体・enum は対応する typedef を cdef に追加すること。
const koffi = require('koffi');
const lib = koffi.load('P2P.dll');
const PeerCollabUnsubscribeEndpointData = lib.func('__stdcall', 'PeerCollabUnsubscribeEndpointData', 'int32_t', ['void *']);
// PeerCollabUnsubscribeEndpointData(pcEndpoint)
// pcEndpoint : PEER_ENDPOINT* -> 'void *'
// 出力ポインタは koffi.out(...) で包む。構造体は koffi.struct で定義。
const lib = Deno.dlopen("P2P.dll", {
  PeerCollabUnsubscribeEndpointData: { parameters: ["pointer"], result: "i32" },
});
// lib.symbols.PeerCollabUnsubscribeEndpointData(pcEndpoint)
// pcEndpoint : PEER_ENDPOINT* -> "pointer"
// 文字列引数は "buffer"(NUL 終端のバイト列を Uint8Array で渡す)。
// 値渡し構造体は { struct: [ ...field types... ] } を使用。
<?php
$ffi = FFI::cdef(<<<C
int32_t PeerCollabUnsubscribeEndpointData(
    void* pcEndpoint);
C, "P2P.dll");
// $ffi->PeerCollabUnsubscribeEndpointData(pcEndpoint);
// pcEndpoint : PEER_ENDPOINT*
// 構造体/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 P2p extends StdCallLibrary {
    P2p INSTANCE = Native.load("p2p", P2p.class);
    int PeerCollabUnsubscribeEndpointData(
        Pointer pcEndpoint   // PEER_ENDPOINT*
    );
}
@[Link("p2p")]
lib LibP2P
  fun PeerCollabUnsubscribeEndpointData = PeerCollabUnsubscribeEndpointData(
    pcEndpoint : PEER_ENDPOINT*   # PEER_ENDPOINT*
  ) : Int32
end
# 構造体/GUID/enum は lib 内に対応する型定義が必要。
# 呼出規約: x64 は規約統一のため OK。x86(32bit)は WINAPI=stdcall だが Crystal の fun に stdcall 付与構文がなく非対応。
import 'dart:ffi';
import 'package:ffi/ffi.dart';

typedef PeerCollabUnsubscribeEndpointDataNative = Int32 Function(Pointer<Void>);
typedef PeerCollabUnsubscribeEndpointDataDart = int Function(Pointer<Void>);
final PeerCollabUnsubscribeEndpointData = DynamicLibrary.open('P2P.dll')
    .lookupFunction<PeerCollabUnsubscribeEndpointDataNative, PeerCollabUnsubscribeEndpointDataDart>('PeerCollabUnsubscribeEndpointData');
// pcEndpoint : PEER_ENDPOINT* -> Pointer<Void>
// 文字列は package:ffi の "...".toNativeUtf16()/toNativeUtf8() で変換。
{$mode objfpc}{$H+}
function PeerCollabUnsubscribeEndpointData(
  pcEndpoint: Pointer   // PEER_ENDPOINT*
): Integer; stdcall;
  external 'P2P.dll' name 'PeerCollabUnsubscribeEndpointData';
import Foreign
import Foreign.C.Types
import Foreign.C.String

foreign import stdcall safe "PeerCollabUnsubscribeEndpointData"
  c_PeerCollabUnsubscribeEndpointData :: Ptr () -> IO Int32
-- pcEndpoint : PEER_ENDPOINT* -> Ptr ()
-- 要 GHC(Windows)。stdcall は x64 では ccall として扱われる。ブロックする API は safe 呼び出し推奨。
open Ctypes
open Foreign

let peercollabunsubscribeendpointdata =
  foreign "PeerCollabUnsubscribeEndpointData"
    ((ptr void) @-> returning int32_t)
(* pcEndpoint : PEER_ENDPOINT* -> (ptr void) *)
(* foreign は cdecl 前提。x64 Windows では WINAPI と一致。構造体は ctypes structure を定義のこと。 *)
(cffi:define-foreign-library p2p (t "P2P.dll"))
(cffi:use-foreign-library p2p)

(cffi:defcfun ("PeerCollabUnsubscribeEndpointData" peer-collab-unsubscribe-endpoint-data :convention :stdcall) :int32
  (pc-endpoint :pointer))   ; PEER_ENDPOINT*
; isize/usize(INT_PTR/SIZE_T)は x64 前提で :int64/:uint64。x86 では :int32/:uint32。
use Win32::API;
my $PeerCollabUnsubscribeEndpointData = Win32::API::More->new('P2P',
    'int PeerCollabUnsubscribeEndpointData(LPVOID pcEndpoint)');
# my $ret = $PeerCollabUnsubscribeEndpointData->Call($pcEndpoint);
# pcEndpoint : PEER_ENDPOINT* -> LPVOID
# 値渡し構造体は pack() した文字列、または Win32::API::Struct を使用。

関連項目

使用する型