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