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

RemoveClusterGroupDependencyEx

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

シグネチャ

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

DWORD RemoveClusterGroupDependencyEx(
    HGROUP hGroup,
    HGROUP hDependsOn,
    LPCWSTR lpszReason   // optional
);

パラメーター

名前方向
hGroupHGROUPin
hDependsOnHGROUPin
lpszReasonLPCWSTRinoptional

戻り値の型: DWORD

各言語での呼び出し定義

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

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

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

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

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procRemoveClusterGroupDependencyEx = clusapi.NewProc("RemoveClusterGroupDependencyEx")
)

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