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

RemoveClusterNameAccount

関数
クラスタ名アカウントとコンピュータオブジェクトを削除する。
DLLCLUSAPI.dll呼出規約winapi

シグネチャ

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

DWORD RemoveClusterNameAccount(
    HCLUSTER hCluster,
    BOOL bDeleteComputerObjects
);

パラメーター

名前方向
hClusterHCLUSTERin
bDeleteComputerObjectsBOOLin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

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

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

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procRemoveClusterNameAccount = clusapi.NewProc("RemoveClusterNameAccount")
)

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