Win32 API 日本語リファレンス
ホームSystem.HostComputeNetwork › HcnCloseEndpoint

HcnCloseEndpoint

関数
エンドポイントハンドルを閉じる。
DLLcomputenetwork.dll呼出規約winapi

シグネチャ

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

HRESULT HcnCloseEndpoint(
    void* Endpoint
);

パラメーター

名前方向
Endpointvoid*in

戻り値の型: HRESULT

各言語での呼び出し定義

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

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

HcnCloseEndpoint = ctypes.windll.computenetwork.HcnCloseEndpoint
HcnCloseEndpoint.restype = ctypes.c_int
HcnCloseEndpoint.argtypes = [
    ctypes.POINTER(None),  # Endpoint : void*
]
require 'fiddle'
require 'fiddle/import'

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

var (
	computenetwork = windows.NewLazySystemDLL("computenetwork.dll")
	procHcnCloseEndpoint = computenetwork.NewProc("HcnCloseEndpoint")
)

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