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

CREATE_CLUSTER_CONFIG

構造体
サイズx64: 88 バイト / x86: 48 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
dwVersionDWORD4+0+0本構造体のバージョン番号。
lpszClusterNameLPWSTR8/4+8+4作成するクラスタの名前文字列。
cNodesDWORD4+16+8ppszNodeNames配列のノード数。
ppszNodeNamesLPWSTR*8/4+24+12クラスタを構成するノード名文字列配列へのポインタ。
cIpEntriesDWORD4+32+16pIpEntries配列のIPエントリ数。
pIpEntriesCLUSTER_IP_ENTRY*8/4+40+20クラスタのIPアドレスエントリ配列(CLUSTER_IP_ENTRY)へのポインタ。
fEmptyClusterBOOLEAN1+48+24TRUEなら空のクラスタ(ノードなし)を作成することを示す論理値。
managementPointTypeCLUSTER_MGMT_POINT_TYPE4+52+28管理ポイントの種別を示すCLUSTER_MGMT_POINT_TYPE。
managementPointResTypeCLUSTER_MGMT_POINT_RESTYPE4+56+32管理ポイントリソースの種別を示すCLUSTER_MGMT_POINT_RESTYPE。
pszUserNameLPWSTR8/4+64+36クラスタ作成に使用するユーザ名文字列。
pszPasswordLPWSTR8/4+72+40クラスタ作成に使用するパスワード文字列。
pszDomainLPWSTR8/4+80+44クラスタ作成に使用するドメイン名文字列。

各言語での定義

#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 Structure
import 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: pointer
struct 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