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

DestroyClusterGroupEx

関数
理由付きでクラスターグループとその内容を破棄する。
DLLCLUSAPI.dll呼出規約winapi

シグネチャ

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

DWORD DestroyClusterGroupEx(
    HGROUP hGroup,
    LPCWSTR lpszReason   // optional
);

パラメーター

名前方向
hGroupHGROUPin
lpszReasonLPCWSTRinoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD DestroyClusterGroupEx(
    HGROUP hGroup,
    LPCWSTR lpszReason   // optional
);
[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern uint DestroyClusterGroupEx(
    IntPtr hGroup,   // HGROUP
    [MarshalAs(UnmanagedType.LPWStr)] string lpszReason   // LPCWSTR optional
);
<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function DestroyClusterGroupEx(
    hGroup As IntPtr,   ' HGROUP
    <MarshalAs(UnmanagedType.LPWStr)> lpszReason As String   ' LPCWSTR optional
) As UInteger
End Function
' hGroup : HGROUP
' lpszReason : LPCWSTR optional
Declare PtrSafe Function DestroyClusterGroupEx Lib "clusapi" ( _
    ByVal hGroup As LongPtr, _
    ByVal lpszReason As LongPtr) As Long
' VBA7前提(PtrSafe)。32bit Office では LongPtr→Long。Integer=16bit / Long=32bit / LongLong=64bit。
import ctypes
from ctypes import wintypes

DestroyClusterGroupEx = ctypes.windll.clusapi.DestroyClusterGroupEx
DestroyClusterGroupEx.restype = wintypes.DWORD
DestroyClusterGroupEx.argtypes = [
    ctypes.c_ssize_t,  # hGroup : HGROUP
    wintypes.LPCWSTR,  # lpszReason : LPCWSTR optional
]
require 'fiddle'
require 'fiddle/import'

lib = Fiddle.dlopen('CLUSAPI.dll')
DestroyClusterGroupEx = Fiddle::Function.new(
  lib['DestroyClusterGroupEx'],
  [
    Fiddle::TYPE_INTPTR_T,  # hGroup : HGROUP
    Fiddle::TYPE_VOIDP,  # lpszReason : LPCWSTR optional
  ],
  -Fiddle::TYPE_INT)
#[link(name = "clusapi")]
extern "system" {
    fn DestroyClusterGroupEx(
        hGroup: isize,  // HGROUP
        lpszReason: *const u16  // LPCWSTR optional
    ) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.
$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern uint DestroyClusterGroupEx(IntPtr hGroup, [MarshalAs(UnmanagedType.LPWStr)] string lpszReason);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_DestroyClusterGroupEx' -Namespace Win32 -PassThru
# $api::DestroyClusterGroupEx(hGroup, lpszReason)
#uselib "CLUSAPI.dll"
#func global DestroyClusterGroupEx "DestroyClusterGroupEx" sptr, sptr
; DestroyClusterGroupEx hGroup, lpszReason   ; 戻り値は stat
; hGroup : HGROUP -> "sptr"
; lpszReason : LPCWSTR optional -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。
#uselib "CLUSAPI.dll"
#cfunc global DestroyClusterGroupEx "DestroyClusterGroupEx" sptr, wstr
; res = DestroyClusterGroupEx(hGroup, lpszReason)
; hGroup : HGROUP -> "sptr"
; lpszReason : LPCWSTR optional -> "wstr"
; DWORD DestroyClusterGroupEx(HGROUP hGroup, LPCWSTR lpszReason)
#uselib "CLUSAPI.dll"
#cfunc global DestroyClusterGroupEx "DestroyClusterGroupEx" intptr, wstr
; res = DestroyClusterGroupEx(hGroup, lpszReason)
; hGroup : HGROUP -> "intptr"
; lpszReason : LPCWSTR optional -> "wstr"
import (
	"golang.org/x/sys/windows"
	"unsafe"
)

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procDestroyClusterGroupEx = clusapi.NewProc("DestroyClusterGroupEx")
)

// hGroup (HGROUP), lpszReason (LPCWSTR optional)
r1, _, err := procDestroyClusterGroupEx.Call(
	uintptr(hGroup),
	uintptr(unsafe.Pointer(windows.StringToUTF16Ptr(lpszReason))),
)
_ = err  // syscall.Errno (valid when the call sets last-error)
_ = r1   // DWORD
function DestroyClusterGroupEx(
  hGroup: NativeInt;   // HGROUP
  lpszReason: PWideChar   // LPCWSTR optional
): DWORD; stdcall;
  external 'CLUSAPI.dll' name 'DestroyClusterGroupEx';
result := DllCall("CLUSAPI\DestroyClusterGroupEx"
    , "Ptr", hGroup   ; HGROUP
    , "WStr", lpszReason   ; LPCWSTR optional
    , "UInt")   ; return: DWORD
●DestroyClusterGroupEx(hGroup, lpszReason) = DLL("CLUSAPI.dll", "dword DestroyClusterGroupEx(int, char*)")
# 呼び出し: DestroyClusterGroupEx(hGroup, lpszReason)
# hGroup : HGROUP -> "int"
# lpszReason : LPCWSTR optional -> "char*"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。