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

AddClusterGroupToGroupSetDependency

関数
グループからグループセットへの依存関係を追加する。
DLLCLUSAPI.dll呼出規約winapi対応OSwindowsserver2016

シグネチャ

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

DWORD AddClusterGroupToGroupSetDependency(
    HGROUP hDependentGroup,
    HGROUPSET hProviderGroupSet
);

パラメーター

名前方向
hDependentGroupHGROUPin
hProviderGroupSetHGROUPSETin

戻り値の型: DWORD

各言語での呼び出し定義

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

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

AddClusterGroupToGroupSetDependency = ctypes.windll.clusapi.AddClusterGroupToGroupSetDependency
AddClusterGroupToGroupSetDependency.restype = wintypes.DWORD
AddClusterGroupToGroupSetDependency.argtypes = [
    ctypes.c_ssize_t,  # hDependentGroup : HGROUP
    ctypes.c_ssize_t,  # hProviderGroupSet : HGROUPSET
]
require 'fiddle'
require 'fiddle/import'

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

var (
	clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
	procAddClusterGroupToGroupSetDependency = clusapi.NewProc("AddClusterGroupToGroupSetDependency")
)

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