ホーム › Networking.Clustering › CloseClusterNetInterface
CloseClusterNetInterface
関数クラスターネットワークインターフェイスのハンドルを閉じる。
シグネチャ
// CLUSAPI.dll
#include <windows.h>
BOOL CloseClusterNetInterface(
HNETINTERFACE hNetInterface
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hNetInterface | HNETINTERFACE | in |
戻り値の型: BOOL
各言語での呼び出し定義
// CLUSAPI.dll
#include <windows.h>
BOOL CloseClusterNetInterface(
HNETINTERFACE hNetInterface
);[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CLUSAPI.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CloseClusterNetInterface(
IntPtr hNetInterface // HNETINTERFACE
);<DllImport("CLUSAPI.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function CloseClusterNetInterface(
hNetInterface As IntPtr ' HNETINTERFACE
) As Boolean
End Function' hNetInterface : HNETINTERFACE
Declare PtrSafe Function CloseClusterNetInterface Lib "clusapi" ( _
ByVal hNetInterface As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。import ctypes
from ctypes import wintypes
CloseClusterNetInterface = ctypes.windll.clusapi.CloseClusterNetInterface
CloseClusterNetInterface.restype = wintypes.BOOL
CloseClusterNetInterface.argtypes = [
ctypes.c_ssize_t, # hNetInterface : HNETINTERFACE
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CLUSAPI.dll')
CloseClusterNetInterface = Fiddle::Function.new(
lib['CloseClusterNetInterface'],
[
Fiddle::TYPE_INTPTR_T, # hNetInterface : HNETINTERFACE
],
Fiddle::TYPE_INT)#[link(name = "clusapi")]
extern "system" {
fn CloseClusterNetInterface(
hNetInterface: isize // HNETINTERFACE
) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CLUSAPI.dll", SetLastError = true)]
public static extern bool CloseClusterNetInterface(IntPtr hNetInterface);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_CloseClusterNetInterface' -Namespace Win32 -PassThru
# $api::CloseClusterNetInterface(hNetInterface)#uselib "CLUSAPI.dll"
#func global CloseClusterNetInterface "CloseClusterNetInterface" sptr
; CloseClusterNetInterface hNetInterface ; 戻り値は stat
; hNetInterface : HNETINTERFACE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "CLUSAPI.dll"
#cfunc global CloseClusterNetInterface "CloseClusterNetInterface" sptr
; res = CloseClusterNetInterface(hNetInterface)
; hNetInterface : HNETINTERFACE -> "sptr"; BOOL CloseClusterNetInterface(HNETINTERFACE hNetInterface)
#uselib "CLUSAPI.dll"
#cfunc global CloseClusterNetInterface "CloseClusterNetInterface" intptr
; res = CloseClusterNetInterface(hNetInterface)
; hNetInterface : HNETINTERFACE -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
procCloseClusterNetInterface = clusapi.NewProc("CloseClusterNetInterface")
)
// hNetInterface (HNETINTERFACE)
r1, _, err := procCloseClusterNetInterface.Call(
uintptr(hNetInterface),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // BOOLfunction CloseClusterNetInterface(
hNetInterface: NativeInt // HNETINTERFACE
): BOOL; stdcall;
external 'CLUSAPI.dll' name 'CloseClusterNetInterface';result := DllCall("CLUSAPI\CloseClusterNetInterface"
, "Ptr", hNetInterface ; HNETINTERFACE
, "Int") ; return: BOOL●CloseClusterNetInterface(hNetInterface) = DLL("CLUSAPI.dll", "bool CloseClusterNetInterface(int)")
# 呼び出し: CloseClusterNetInterface(hNetInterface)
# hNetInterface : HNETINTERFACE -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。