ホーム › Networking.Clustering › AddClusterGroupSetDependency
AddClusterGroupSetDependency
関数グループセット間の依存関係を追加する。
シグネチャ
// CLUSAPI.dll
#include <windows.h>
DWORD AddClusterGroupSetDependency(
HGROUPSET hDependentGroupSet,
HGROUPSET hProviderGroupSet
);パラメーター
| 名前 | 型 | 方向 |
|---|---|---|
| hDependentGroupSet | HGROUPSET | in |
| hProviderGroupSet | HGROUPSET | in |
戻り値の型: DWORD
各言語での呼び出し定義
// CLUSAPI.dll
#include <windows.h>
DWORD AddClusterGroupSetDependency(
HGROUPSET hDependentGroupSet,
HGROUPSET hProviderGroupSet
);[DllImport("CLUSAPI.dll", ExactSpelling = true)]
static extern uint AddClusterGroupSetDependency(
IntPtr hDependentGroupSet, // HGROUPSET
IntPtr hProviderGroupSet // HGROUPSET
);<DllImport("CLUSAPI.dll", ExactSpelling:=True)>
Public Shared Function AddClusterGroupSetDependency(
hDependentGroupSet As IntPtr, ' HGROUPSET
hProviderGroupSet As IntPtr ' HGROUPSET
) As UInteger
End Function' hDependentGroupSet : HGROUPSET
' hProviderGroupSet : HGROUPSET
Declare PtrSafe Function AddClusterGroupSetDependency Lib "clusapi" ( _
ByVal hDependentGroupSet 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
AddClusterGroupSetDependency = ctypes.windll.clusapi.AddClusterGroupSetDependency
AddClusterGroupSetDependency.restype = wintypes.DWORD
AddClusterGroupSetDependency.argtypes = [
ctypes.c_ssize_t, # hDependentGroupSet : HGROUPSET
ctypes.c_ssize_t, # hProviderGroupSet : HGROUPSET
]require 'fiddle'
require 'fiddle/import'
lib = Fiddle.dlopen('CLUSAPI.dll')
AddClusterGroupSetDependency = Fiddle::Function.new(
lib['AddClusterGroupSetDependency'],
[
Fiddle::TYPE_INTPTR_T, # hDependentGroupSet : HGROUPSET
Fiddle::TYPE_INTPTR_T, # hProviderGroupSet : HGROUPSET
],
-Fiddle::TYPE_INT)#[link(name = "clusapi")]
extern "system" {
fn AddClusterGroupSetDependency(
hDependentGroupSet: isize, // HGROUPSET
hProviderGroupSet: isize // HGROUPSET
) -> u32;
}
// crates: windows-sys provides ready-made bindings for this API.$sig = @"
[DllImport("CLUSAPI.dll")]
public static extern uint AddClusterGroupSetDependency(IntPtr hDependentGroupSet, IntPtr hProviderGroupSet);
"@
$api = Add-Type -MemberDefinition $sig -Name 'CLUSAPI_AddClusterGroupSetDependency' -Namespace Win32 -PassThru
# $api::AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)#uselib "CLUSAPI.dll"
#func global AddClusterGroupSetDependency "AddClusterGroupSetDependency" sptr, sptr
; AddClusterGroupSetDependency hDependentGroupSet, hProviderGroupSet ; 戻り値は stat
; hDependentGroupSet : HGROUPSET -> "sptr"
; hProviderGroupSet : HGROUPSET -> "sptr"
; ※HSP3.7は #func のため戻り値はシステム変数 stat に格納されます。#uselib "CLUSAPI.dll"
#cfunc global AddClusterGroupSetDependency "AddClusterGroupSetDependency" sptr, sptr
; res = AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
; hDependentGroupSet : HGROUPSET -> "sptr"
; hProviderGroupSet : HGROUPSET -> "sptr"; DWORD AddClusterGroupSetDependency(HGROUPSET hDependentGroupSet, HGROUPSET hProviderGroupSet)
#uselib "CLUSAPI.dll"
#cfunc global AddClusterGroupSetDependency "AddClusterGroupSetDependency" intptr, intptr
; res = AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
; hDependentGroupSet : HGROUPSET -> "intptr"
; hProviderGroupSet : HGROUPSET -> "intptr"import (
"golang.org/x/sys/windows"
"unsafe"
)
var (
clusapi = windows.NewLazySystemDLL("CLUSAPI.dll")
procAddClusterGroupSetDependency = clusapi.NewProc("AddClusterGroupSetDependency")
)
// hDependentGroupSet (HGROUPSET), hProviderGroupSet (HGROUPSET)
r1, _, err := procAddClusterGroupSetDependency.Call(
uintptr(hDependentGroupSet),
uintptr(hProviderGroupSet),
)
_ = err // syscall.Errno (valid when the call sets last-error)
_ = r1 // DWORDfunction AddClusterGroupSetDependency(
hDependentGroupSet: NativeInt; // HGROUPSET
hProviderGroupSet: NativeInt // HGROUPSET
): DWORD; stdcall;
external 'CLUSAPI.dll' name 'AddClusterGroupSetDependency';result := DllCall("CLUSAPI\AddClusterGroupSetDependency"
, "Ptr", hDependentGroupSet ; HGROUPSET
, "Ptr", hProviderGroupSet ; HGROUPSET
, "UInt") ; return: DWORD●AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet) = DLL("CLUSAPI.dll", "dword AddClusterGroupSetDependency(int, int)")
# 呼び出し: AddClusterGroupSetDependency(hDependentGroupSet, hProviderGroupSet)
# hDependentGroupSet : HGROUPSET -> "int"
# hProviderGroupSet : HGROUPSET -> "int"
# なでしこ1は32bit・ANSI(Shift_JIS)。文字列=char*(ANSI)、ポインタ/ハンドル=void*(4byte)。