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

DeleteClusterGroupSetEx

関数
理由を付与してクラスターグループセットを削除する。
DLLCLUSAPI.dll呼出規約winapi

シグネチャ

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

DWORD DeleteClusterGroupSetEx(
    HGROUPSET hGroupSet,
    LPCWSTR lpszReason   // optional
);

パラメーター

名前方向
hGroupSetHGROUPSETin
lpszReasonLPCWSTRinoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

DWORD DeleteClusterGroupSetEx(
    HGROUPSET hGroupSet,
    LPCWSTR lpszReason   // optional
);
[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern uint DeleteClusterGroupSetEx(
    IntPtr hGroupSet,   // HGROUPSET
    [MarshalAs(UnmanagedType.LPWStr)] string lpszReason   // LPCWSTR optional
);
<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function DeleteClusterGroupSetEx(
    hGroupSet As IntPtr,   ' HGROUPSET
    <MarshalAs(UnmanagedType.LPWStr)> lpszReason As String   ' LPCWSTR optional
) As UInteger
End Function
' hGroupSet : HGROUPSET
' lpszReason : LPCWSTR optional
Declare PtrSafe Function DeleteClusterGroupSetEx Lib "clusapi" ( _
    ByVal hGroupSet 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

DeleteClusterGroupSetEx = ctypes.windll.clusapi.DeleteClusterGroupSetEx
DeleteClusterGroupSetEx.restype = wintypes.DWORD
DeleteClusterGroupSetEx.argtypes = [
    ctypes.c_ssize_t,  # hGroupSet : HGROUPSET
    wintypes.LPCWSTR,  # lpszReason : LPCWSTR optional
]
require 'fiddle'
require 'fiddle/import'

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

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procDeleteClusterGroupSetEx = clusapi.NewProc("DeleteClusterGroupSetEx")
)

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