CREATE_CLUSTER_CONFIG
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwVersion | DWORD | 4 | +0 | +0 | バージョンです。CLUSAPI_VERSION を設定します。 |
| lpszClusterName | LPWSTR | 8/4 | +8 | +4 | クラスターの名前です。 |
| cNodes | DWORD | 4 | +16 | +8 | ppszNodeNames メンバーが指す配列内のノードの数です。 |
| ppszNodeNames | LPWSTR* | 8/4 | +24 | +12 | 文字列へのポインターの配列のアドレスです。各文字列は、新しいクラスターに追加するノードの名前を表します。 |
| cIpEntries | DWORD | 4 | +32 | +16 | pIpEntries メンバーが指す配列内のノードの数です。0 の場合、 IP Address リソースおよび Network Name リソースは作成されません。 |
| pIpEntries | CLUSTER_IP_ENTRY* | 8/4 | +40 | +20 | CLUSTER_IP_ENTRY 構造体へのポインターの配列のアドレスです。各構造体は、新しいクラスターに追加するノードの名前を指定します。各エントリは個別の IP Address リソースの構成に使用されます。また、 Network Name リソースが作成され、このリソースは論理的な OR の形で、これらすべての IP Address リソースに 依存します。 |
| fEmptyCluster | BOOLEAN | 1 | +48 | +24 | TRUE の場合、クラスターはノードを持たずに作成されます。このとき cIpEntries メンバーは 0 でなければならず、pIpEntries メンバーは NULL でなければなりません。 FALSE の場合、クラスターは 1 つ以上のノードを伴って作成されます。このとき cIpEntries メンバーは 1 以上でなければならず、 pIpEntries メンバーは NULL であってはならず、 cNodes メンバーは 1 以上でなければならず、ppszNodeNames メンバーは NULL であってはならず、lpszClusterName メンバーも NULL であってはなりません。 |
| managementPointType | CLUSTER_MGMT_POINT_TYPE | 4 | +52 | +28 | 管理ポイントの種類を指定する CLUSTER_MGMT_POINT_TYPE 値です。この構造体の fEmptyCluster メンバーの値が TRUE の場合、このメンバーは無視され、このメンバーに CLUSTER_MGMT_POINT_TYPE_NONE が設定されているものとして構造体が扱われます。この構造体の dwVersion メンバーに CLUSAPI_VERSION_WINDOWSBLUE より小さい値が設定されている場合、このメンバーの値は無視され、このメンバーに CLUSTER_MGMT_POINT_TYPE_CNO が設定されているものとして構造体が扱われます。 Windows Server 2012、Windows Server 2008 R2 および Windows Server 2008: このメンバーは Windows Server 2012 R2 より前ではサポートされません。 |
| managementPointResType | CLUSTER_MGMT_POINT_RESTYPE | 4 | +56 | +32 | 管理ポイントリソースの種別を示すCLUSTER_MGMT_POINT_RESTYPE。 |
| pszUserName | LPWSTR | 8/4 | +64 | +36 | クラスタ作成に使用するユーザ名文字列。 |
| pszPassword | LPWSTR | 8/4 | +72 | +40 | クラスタ作成に使用するパスワード文字列。 |
| pszDomain | LPWSTR | 8/4 | +80 | +44 | クラスタ作成に使用するドメイン名文字列。 |
公式ドキュメント
初期クラスター構成を定義します。この構造体は pConfig パラメーターとして CreateCluster 関数に渡されます。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// CREATE_CLUSTER_CONFIG (x64 88 / x86 48 バイト)
typedef struct CREATE_CLUSTER_CONFIG {
DWORD dwVersion;
LPWSTR lpszClusterName;
DWORD cNodes;
LPWSTR* ppszNodeNames;
DWORD cIpEntries;
CLUSTER_IP_ENTRY* pIpEntries;
BOOLEAN fEmptyCluster;
CLUSTER_MGMT_POINT_TYPE managementPointType;
CLUSTER_MGMT_POINT_RESTYPE managementPointResType;
LPWSTR pszUserName;
LPWSTR pszPassword;
LPWSTR pszDomain;
} CREATE_CLUSTER_CONFIG;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CREATE_CLUSTER_CONFIG
{
public uint dwVersion;
public IntPtr lpszClusterName;
public uint cNodes;
public IntPtr ppszNodeNames;
public uint cIpEntries;
public IntPtr pIpEntries;
[MarshalAs(UnmanagedType.U1)] public bool fEmptyCluster;
public int managementPointType;
public int managementPointResType;
public IntPtr pszUserName;
public IntPtr pszPassword;
public IntPtr pszDomain;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CREATE_CLUSTER_CONFIG
Public dwVersion As UInteger
Public lpszClusterName As IntPtr
Public cNodes As UInteger
Public ppszNodeNames As IntPtr
Public cIpEntries As UInteger
Public pIpEntries As IntPtr
<MarshalAs(UnmanagedType.U1)> Public fEmptyCluster As Boolean
Public managementPointType As Integer
Public managementPointResType As Integer
Public pszUserName As IntPtr
Public pszPassword As IntPtr
Public pszDomain As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class CREATE_CLUSTER_CONFIG(ctypes.Structure):
_fields_ = [
("dwVersion", wintypes.DWORD),
("lpszClusterName", ctypes.c_void_p),
("cNodes", wintypes.DWORD),
("ppszNodeNames", ctypes.c_void_p),
("cIpEntries", wintypes.DWORD),
("pIpEntries", ctypes.c_void_p),
("fEmptyCluster", ctypes.c_byte),
("managementPointType", ctypes.c_int),
("managementPointResType", ctypes.c_int),
("pszUserName", ctypes.c_void_p),
("pszPassword", ctypes.c_void_p),
("pszDomain", ctypes.c_void_p),
]#[repr(C)]
pub struct CREATE_CLUSTER_CONFIG {
pub dwVersion: u32,
pub lpszClusterName: *mut core::ffi::c_void,
pub cNodes: u32,
pub ppszNodeNames: *mut core::ffi::c_void,
pub cIpEntries: u32,
pub pIpEntries: *mut core::ffi::c_void,
pub fEmptyCluster: u8,
pub managementPointType: i32,
pub managementPointResType: i32,
pub pszUserName: *mut core::ffi::c_void,
pub pszPassword: *mut core::ffi::c_void,
pub pszDomain: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type CREATE_CLUSTER_CONFIG struct {
dwVersion uint32
lpszClusterName uintptr
cNodes uint32
ppszNodeNames uintptr
cIpEntries uint32
pIpEntries uintptr
fEmptyCluster byte
managementPointType int32
managementPointResType int32
pszUserName uintptr
pszPassword uintptr
pszDomain uintptr
}type
CREATE_CLUSTER_CONFIG = record
dwVersion: DWORD;
lpszClusterName: Pointer;
cNodes: DWORD;
ppszNodeNames: Pointer;
cIpEntries: DWORD;
pIpEntries: Pointer;
fEmptyCluster: ByteBool;
managementPointType: Integer;
managementPointResType: Integer;
pszUserName: Pointer;
pszPassword: Pointer;
pszDomain: Pointer;
end;const CREATE_CLUSTER_CONFIG = extern struct {
dwVersion: u32,
lpszClusterName: ?*anyopaque,
cNodes: u32,
ppszNodeNames: ?*anyopaque,
cIpEntries: u32,
pIpEntries: ?*anyopaque,
fEmptyCluster: u8,
managementPointType: i32,
managementPointResType: i32,
pszUserName: ?*anyopaque,
pszPassword: ?*anyopaque,
pszDomain: ?*anyopaque,
};type
CREATE_CLUSTER_CONFIG {.bycopy.} = object
dwVersion: uint32
lpszClusterName: pointer
cNodes: uint32
ppszNodeNames: pointer
cIpEntries: uint32
pIpEntries: pointer
fEmptyCluster: uint8
managementPointType: int32
managementPointResType: int32
pszUserName: pointer
pszPassword: pointer
pszDomain: pointerstruct CREATE_CLUSTER_CONFIG
{
uint dwVersion;
void* lpszClusterName;
uint cNodes;
void* ppszNodeNames;
uint cIpEntries;
void* pIpEntries;
ubyte fEmptyCluster;
int managementPointType;
int managementPointResType;
void* pszUserName;
void* pszPassword;
void* pszDomain;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CREATE_CLUSTER_CONFIG サイズ: 48 バイト(x86)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpszClusterName : LPWSTR (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; cNodes : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ppszNodeNames : LPWSTR* (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; cIpEntries : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; pIpEntries : CLUSTER_IP_ENTRY* (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; fEmptyCluster : BOOLEAN (+24, 1byte) poke st,24,値 / 値 = peek(st,24)
; managementPointType : CLUSTER_MGMT_POINT_TYPE (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; managementPointResType : CLUSTER_MGMT_POINT_RESTYPE (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pszUserName : LPWSTR (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; pszPassword : LPWSTR (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; pszDomain : LPWSTR (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CREATE_CLUSTER_CONFIG サイズ: 88 バイト(x64)
dim st, 22 ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; lpszClusterName : LPWSTR (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cNodes : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ppszNodeNames : LPWSTR* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cIpEntries : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; pIpEntries : CLUSTER_IP_ENTRY* (+40, 8byte) varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; fEmptyCluster : BOOLEAN (+48, 1byte) poke st,48,値 / 値 = peek(st,48)
; managementPointType : CLUSTER_MGMT_POINT_TYPE (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; managementPointResType : CLUSTER_MGMT_POINT_RESTYPE (+56, 4byte) st.14 = 値 / 値 = st.14 (lpoke/lpeek も可)
; pszUserName : LPWSTR (+64, 8byte) qpoke st,64,値 / qpeek(st,64) ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; pszPassword : LPWSTR (+72, 8byte) qpoke st,72,値 / qpeek(st,72) ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; pszDomain : LPWSTR (+80, 8byte) qpoke st,80,値 / qpeek(st,80) ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CREATE_CLUSTER_CONFIG
#field int dwVersion
#field intptr lpszClusterName
#field int cNodes
#field intptr ppszNodeNames
#field int cIpEntries
#field intptr pIpEntries
#field bool1 fEmptyCluster
#field int managementPointType
#field int managementPointResType
#field intptr pszUserName
#field intptr pszPassword
#field intptr pszDomain
#endstruct
stdim st, CREATE_CLUSTER_CONFIG ; NSTRUCT 変数を確保
st->dwVersion = 100
mes "dwVersion=" + st->dwVersion