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

CLUSTER_RESOURCE_ENUM_ITEM

構造体
サイズx64: 96 バイト / x86: 52 バイト

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

フィールド

フィールドサイズx64x86説明
dwVersionDWORD4+0+0この構造体のバージョンです。
cbIdDWORD4+4+4lpszId フィールドのサイズ (バイト単位) です。
lpszIdLPWSTR8/4+8+8クラスターリソースの ID です。
cbNameDWORD4+16+12IpszName フィールドのサイズ (バイト単位) です。
lpszNameLPWSTR8/4+24+16クラスターリソースの名前です。
cbOwnerGroupNameDWORD4+32+20IpszOwnerNode フィールドのサイズ (バイト単位) です。
lpszOwnerGroupNameLPWSTR8/4+40+24グループをホストするクラスターリソースの名前です。
cbOwnerGroupIdDWORD4+48+28lpszOwnerGroupId フィールドのサイズ (バイト単位) です。
lpszOwnerGroupIdLPWSTR8/4+56+32リソースが属するクラスターグループのグループ ID です。
cbPropertiesDWORD4+64+36pProperties フィールドのサイズ (バイト単位) です。
pPropertiesvoid*8/4+72+40共通プロパティの名前の一覧へのポインターです。
cbRoPropertiesDWORD4+80+44pRoProperties フィールドのサイズ (バイト単位) です。
pRoPropertiesvoid*8/4+88+48読み取り専用の共通プロパティの名前の一覧へのポインターです。

公式ドキュメント

クラスターリソースのプロパティを表します。この構造体は、ClusterResourceEnumEx 関数でクラスターリソースを列挙するために使用されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// CLUSTER_RESOURCE_ENUM_ITEM  (x64 96 / x86 52 バイト)
typedef struct CLUSTER_RESOURCE_ENUM_ITEM {
    DWORD dwVersion;
    DWORD cbId;
    LPWSTR lpszId;
    DWORD cbName;
    LPWSTR lpszName;
    DWORD cbOwnerGroupName;
    LPWSTR lpszOwnerGroupName;
    DWORD cbOwnerGroupId;
    LPWSTR lpszOwnerGroupId;
    DWORD cbProperties;
    void* pProperties;
    DWORD cbRoProperties;
    void* pRoProperties;
} CLUSTER_RESOURCE_ENUM_ITEM;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSTER_RESOURCE_ENUM_ITEM
{
    public uint dwVersion;
    public uint cbId;
    public IntPtr lpszId;
    public uint cbName;
    public IntPtr lpszName;
    public uint cbOwnerGroupName;
    public IntPtr lpszOwnerGroupName;
    public uint cbOwnerGroupId;
    public IntPtr lpszOwnerGroupId;
    public uint cbProperties;
    public IntPtr pProperties;
    public uint cbRoProperties;
    public IntPtr pRoProperties;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSTER_RESOURCE_ENUM_ITEM
    Public dwVersion As UInteger
    Public cbId As UInteger
    Public lpszId As IntPtr
    Public cbName As UInteger
    Public lpszName As IntPtr
    Public cbOwnerGroupName As UInteger
    Public lpszOwnerGroupName As IntPtr
    Public cbOwnerGroupId As UInteger
    Public lpszOwnerGroupId As IntPtr
    Public cbProperties As UInteger
    Public pProperties As IntPtr
    Public cbRoProperties As UInteger
    Public pRoProperties As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class CLUSTER_RESOURCE_ENUM_ITEM(ctypes.Structure):
    _fields_ = [
        ("dwVersion", wintypes.DWORD),
        ("cbId", wintypes.DWORD),
        ("lpszId", ctypes.c_void_p),
        ("cbName", wintypes.DWORD),
        ("lpszName", ctypes.c_void_p),
        ("cbOwnerGroupName", wintypes.DWORD),
        ("lpszOwnerGroupName", ctypes.c_void_p),
        ("cbOwnerGroupId", wintypes.DWORD),
        ("lpszOwnerGroupId", ctypes.c_void_p),
        ("cbProperties", wintypes.DWORD),
        ("pProperties", ctypes.c_void_p),
        ("cbRoProperties", wintypes.DWORD),
        ("pRoProperties", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct CLUSTER_RESOURCE_ENUM_ITEM {
    pub dwVersion: u32,
    pub cbId: u32,
    pub lpszId: *mut core::ffi::c_void,
    pub cbName: u32,
    pub lpszName: *mut core::ffi::c_void,
    pub cbOwnerGroupName: u32,
    pub lpszOwnerGroupName: *mut core::ffi::c_void,
    pub cbOwnerGroupId: u32,
    pub lpszOwnerGroupId: *mut core::ffi::c_void,
    pub cbProperties: u32,
    pub pProperties: *mut core::ffi::c_void,
    pub cbRoProperties: u32,
    pub pRoProperties: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type CLUSTER_RESOURCE_ENUM_ITEM struct {
	dwVersion uint32
	cbId uint32
	lpszId uintptr
	cbName uint32
	lpszName uintptr
	cbOwnerGroupName uint32
	lpszOwnerGroupName uintptr
	cbOwnerGroupId uint32
	lpszOwnerGroupId uintptr
	cbProperties uint32
	pProperties uintptr
	cbRoProperties uint32
	pRoProperties uintptr
}
type
  CLUSTER_RESOURCE_ENUM_ITEM = record
    dwVersion: DWORD;
    cbId: DWORD;
    lpszId: Pointer;
    cbName: DWORD;
    lpszName: Pointer;
    cbOwnerGroupName: DWORD;
    lpszOwnerGroupName: Pointer;
    cbOwnerGroupId: DWORD;
    lpszOwnerGroupId: Pointer;
    cbProperties: DWORD;
    pProperties: Pointer;
    cbRoProperties: DWORD;
    pRoProperties: Pointer;
  end;
const CLUSTER_RESOURCE_ENUM_ITEM = extern struct {
    dwVersion: u32,
    cbId: u32,
    lpszId: ?*anyopaque,
    cbName: u32,
    lpszName: ?*anyopaque,
    cbOwnerGroupName: u32,
    lpszOwnerGroupName: ?*anyopaque,
    cbOwnerGroupId: u32,
    lpszOwnerGroupId: ?*anyopaque,
    cbProperties: u32,
    pProperties: ?*anyopaque,
    cbRoProperties: u32,
    pRoProperties: ?*anyopaque,
};
type
  CLUSTER_RESOURCE_ENUM_ITEM {.bycopy.} = object
    dwVersion: uint32
    cbId: uint32
    lpszId: pointer
    cbName: uint32
    lpszName: pointer
    cbOwnerGroupName: uint32
    lpszOwnerGroupName: pointer
    cbOwnerGroupId: uint32
    lpszOwnerGroupId: pointer
    cbProperties: uint32
    pProperties: pointer
    cbRoProperties: uint32
    pRoProperties: pointer
struct CLUSTER_RESOURCE_ENUM_ITEM
{
    uint dwVersion;
    uint cbId;
    void* lpszId;
    uint cbName;
    void* lpszName;
    uint cbOwnerGroupName;
    void* lpszOwnerGroupName;
    uint cbOwnerGroupId;
    void* lpszOwnerGroupId;
    uint cbProperties;
    void* pProperties;
    uint cbRoProperties;
    void* pRoProperties;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CLUSTER_RESOURCE_ENUM_ITEM サイズ: 52 バイト(x86)
dim st, 13    ; 4byte整数×13(構造体サイズ 52 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cbId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; lpszId : LPWSTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cbName : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; lpszName : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; cbOwnerGroupName : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; lpszOwnerGroupName : LPWSTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; cbOwnerGroupId : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; lpszOwnerGroupId : LPWSTR (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; cbProperties : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; pProperties : void* (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; cbRoProperties : DWORD (+44, 4byte)  st.11 = 値  /  値 = st.11   (lpoke/lpeek も可)
; pRoProperties : void* (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLUSTER_RESOURCE_ENUM_ITEM サイズ: 96 バイト(x64)
dim st, 24    ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; dwVersion : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; cbId : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; lpszId : LPWSTR (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; cbName : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lpszName : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; cbOwnerGroupName : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; lpszOwnerGroupName : LPWSTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; cbOwnerGroupId : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; lpszOwnerGroupId : LPWSTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; cbProperties : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; pProperties : void* (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; cbRoProperties : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; pRoProperties : void* (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CLUSTER_RESOURCE_ENUM_ITEM
    #field int dwVersion
    #field int cbId
    #field intptr lpszId
    #field int cbName
    #field intptr lpszName
    #field int cbOwnerGroupName
    #field intptr lpszOwnerGroupName
    #field int cbOwnerGroupId
    #field intptr lpszOwnerGroupId
    #field int cbProperties
    #field intptr pProperties
    #field int cbRoProperties
    #field intptr pRoProperties
#endstruct

stdim st, CLUSTER_RESOURCE_ENUM_ITEM        ; NSTRUCT 変数を確保
st->dwVersion = 100
mes "dwVersion=" + st->dwVersion