Win32 API 日本語リファレンス
ホームNetworking.Clustering › CloseClusterNode

CloseClusterNode

関数
クラスターノードのハンドルを閉じる。
DLLCLUSAPI.dll呼出規約winapiSetLastErrorあり対応OSwindowsserver2008

シグネチャ

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

BOOL CloseClusterNode(
    HNODE hNode
);

パラメーター

名前方向
hNodeHNODEin

戻り値の型: BOOL

各言語での呼び出し定義

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

BOOL CloseClusterNode(
    HNODE hNode
);
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CLUSAPI.dll", SetLastError = true, ExactSpelling = true)]
static extern bool CloseClusterNode(
    IntPtr hNode   // HNODE
);
<DllImport("CLUSAPI.dll", SetLastError:=True, ExactSpelling:=True)>
Public Shared Function CloseClusterNode(
    hNode As IntPtr   ' HNODE
) As Boolean
End Function
' hNode : HNODE
Declare PtrSafe Function CloseClusterNode Lib "clusapi" ( _
    ByVal hNode As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

CloseClusterNode = ctypes.windll.clusapi.CloseClusterNode
CloseClusterNode.restype = wintypes.BOOL
CloseClusterNode.argtypes = [
    ctypes.c_ssize_t,  # hNode : HNODE
]
# GetLastError: use ctypes.GetLastError() (or ctypes.WinDLL(use_last_error=True))
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CLUSAPI.dll')
CloseClusterNode = Fiddle::Function.new(
  lib['CloseClusterNode'],
  [
    Fiddle::TYPE_INTPTR_T,  # hNode : HNODE
  ],
  Fiddle::TYPE_INT)
#[link(name = "clusapi")]
extern "system" {
    fn CloseClusterNode(
        hNode: isize  // HNODE
    ) -> 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 CloseClusterNode(IntPtr hNode);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_CloseClusterNode' -Namespace Win32 -PassThru
# $api::CloseClusterNode(hNode)
#uselib "CLUSAPI.dll"
#func global CloseClusterNode "CloseClusterNode" sptr
; CloseClusterNode hNode   ; 戻り値は stat
; hNode : HNODE -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "CLUSAPI.dll"
#cfunc global CloseClusterNode "CloseClusterNode" sptr
; res = CloseClusterNode(hNode)
; hNode : HNODE -> "sptr"
; BOOL CloseClusterNode(HNODE hNode)
#uselib "CLUSAPI.dll"
#cfunc global CloseClusterNode "CloseClusterNode" intptr
; res = CloseClusterNode(hNode)
; hNode : HNODE -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procCloseClusterNode = clusapi.NewProc("CloseClusterNode")
)

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