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

RemoveClusterGroupSetDependencyEx

関数
理由を付与してグループセット間の依存関係を削除する。
DLLCLUSAPI.dll呼出規約winapi

シグネチャ

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

DWORD RemoveClusterGroupSetDependencyEx(
    HGROUPSET hGroupSet,
    HGROUPSET hDependsOn,
    LPCWSTR lpszReason   // optional
);

パラメーター

名前方向
hGroupSetHGROUPSETin
hDependsOnHGROUPSETin
lpszReasonLPCWSTRinoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

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

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

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

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procRemoveClusterGroupSetDependencyEx = clusapi.NewProc("RemoveClusterGroupSetDependencyEx")
)

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