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

PeerGraphClose

関数
開いているピアグラフを閉じる。
DLLP2PGRAPH.dll呼出規約winapi対応OSWindows XP 以降

シグネチャ

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

HRESULT PeerGraphClose(
    void* hGraph
);

パラメーター

名前方向
hGraphvoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

PeerGraphClose = ctypes.windll.p2pgraph.PeerGraphClose
PeerGraphClose.restype = ctypes.c_int
PeerGraphClose.argtypes = [
    ctypes.POINTER(None),  # hGraph : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	p2pgraph = windows.NewLazySystemDLL("P2PGRAPH.dll")
	procPeerGraphClose = p2pgraph.NewProc("PeerGraphClose")
)

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