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