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

PeerPnrpUnregister

関数
PNRPに登録したピア名を登録解除する。
DLLP2P.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT PeerPnrpUnregister(
    void* hRegistration
);

パラメーター

名前方向
hRegistrationvoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

PeerPnrpUnregister = ctypes.windll.p2p.PeerPnrpUnregister
PeerPnrpUnregister.restype = ctypes.c_int
PeerPnrpUnregister.argtypes = [
    ctypes.POINTER(None),  # hRegistration : void*
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('P2P.dll')
PeerPnrpUnregister = Fiddle::Function.new(
  lib['PeerPnrpUnregister'],
  [
    Fiddle::TYPE_VOIDP,  # hRegistration : void*
  ],
  Fiddle::TYPE_INT)
#[link(name = "p2p")]
extern "system" {
    fn PeerPnrpUnregister(
        hRegistration: *mut ()  // void*
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("P2P.dll")]
public static extern int PeerPnrpUnregister(IntPtr hRegistration);
"@
$api = Add-Type -MemberDefinition $sig -Name 'P2P_PeerPnrpUnregister' -Namespace Win32 -PassThru
# $api::PeerPnrpUnregister(hRegistration)
#uselib "P2P.dll"
#func global PeerPnrpUnregister "PeerPnrpUnregister" sptr
; PeerPnrpUnregister hRegistration   ; 戻り値は stat
; hRegistration : void* -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "P2P.dll"
#cfunc global PeerPnrpUnregister "PeerPnrpUnregister" sptr
; res = PeerPnrpUnregister(hRegistration)
; hRegistration : void* -> "sptr"
; HRESULT PeerPnrpUnregister(void* hRegistration)
#uselib "P2P.dll"
#cfunc global PeerPnrpUnregister "PeerPnrpUnregister" intptr
; res = PeerPnrpUnregister(hRegistration)
; hRegistration : void* -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	p2p = windows.NewLazySystemDLL("P2P.dll")
	procPeerPnrpUnregister = p2p.NewProc("PeerPnrpUnregister")
)

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