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

CloseCluster

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

シグネチャ

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

BOOL CloseCluster(
    HCLUSTER hCluster
);

パラメーター

名前方向
hClusterHCLUSTERin

戻り値の型: BOOL

各言語での呼び出し定義

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

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

CloseCluster = ctypes.windll.clusapi.CloseCluster
CloseCluster.restype = wintypes.BOOL
CloseCluster.argtypes = [
    ctypes.c_ssize_t,  # hCluster : HCLUSTER
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CLUSAPI.dll')
CloseCluster = Fiddle::Function.new(
  lib['CloseCluster'],
  [
    Fiddle::TYPE_INTPTR_T,  # hCluster : HCLUSTER
  ],
  Fiddle::TYPE_INT)
#[link(name = "clusapi")]
extern "system" {
    fn CloseCluster(
        hCluster: isize  // HCLUSTER
    ) -> i32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[return: MarshalAs(UnmanagedType.Bool)]
[DllImport("CLUSAPI.dll")]
public static extern bool CloseCluster(IntPtr hCluster);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_CloseCluster' -Namespace Win32 -PassThru
# $api::CloseCluster(hCluster)
#uselib "CLUSAPI.dll"
#func global CloseCluster "CloseCluster" sptr
; CloseCluster hCluster   ; 戻り値は stat
; hCluster : HCLUSTER -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "CLUSAPI.dll"
#cfunc global CloseCluster "CloseCluster" sptr
; res = CloseCluster(hCluster)
; hCluster : HCLUSTER -> "sptr"
; BOOL CloseCluster(HCLUSTER hCluster)
#uselib "CLUSAPI.dll"
#cfunc global CloseCluster "CloseCluster" intptr
; res = CloseCluster(hCluster)
; hCluster : HCLUSTER -> "intptr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procCloseCluster = clusapi.NewProc("CloseCluster")
)

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