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

CLUSPROP_RESOURCE_CLASS

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

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

フィールド

フィールドサイズx64x86説明
BaseCLUSPROP_VALUE8+0+0プロパティ値ヘッダー。構文と値サイズを保持するCLUSPROP_VALUE構造体である。
rcCLUSTER_RESOURCE_CLASS4+8+8リソースのクラスを示すCLUSTER_RESOURCE_CLASS列挙値である。ストレージ等の種別を表す。

各言語での定義

#include <windows.h>

// CLUSPROP_SYNTAX  (x64 4 / x86 4 バイト)
typedef struct CLUSPROP_SYNTAX {
    DWORD dw;
    _Anonymous_e__Struct Anonymous;
} CLUSPROP_SYNTAX;

// CLUSPROP_VALUE  (x64 8 / x86 8 バイト)
typedef struct CLUSPROP_VALUE {
    CLUSPROP_SYNTAX Syntax;
    DWORD cbLength;
} CLUSPROP_VALUE;

// CLUSPROP_RESOURCE_CLASS  (x64 12 / x86 12 バイト)
typedef struct CLUSPROP_RESOURCE_CLASS {
    CLUSPROP_VALUE Base;
    CLUSTER_RESOURCE_CLASS rc;
} CLUSPROP_RESOURCE_CLASS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSPROP_SYNTAX
{
    public uint dw;
    public _Anonymous_e__Struct Anonymous;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSPROP_VALUE
{
    public CLUSPROP_SYNTAX Syntax;
    public uint cbLength;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSPROP_RESOURCE_CLASS
{
    public CLUSPROP_VALUE Base;
    public int rc;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSPROP_SYNTAX
    Public dw As UInteger
    Public Anonymous As _Anonymous_e__Struct
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSPROP_VALUE
    Public Syntax As CLUSPROP_SYNTAX
    Public cbLength As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSPROP_RESOURCE_CLASS
    Public Base As CLUSPROP_VALUE
    Public rc As Integer
End Structure
import ctypes
from ctypes import wintypes

class CLUSPROP_SYNTAX(ctypes.Structure):
    _fields_ = [
        ("dw", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Struct),
    ]

class CLUSPROP_VALUE(ctypes.Structure):
    _fields_ = [
        ("Syntax", CLUSPROP_SYNTAX),
        ("cbLength", wintypes.DWORD),
    ]

class CLUSPROP_RESOURCE_CLASS(ctypes.Structure):
    _fields_ = [
        ("Base", CLUSPROP_VALUE),
        ("rc", ctypes.c_int),
    ]
#[repr(C)]
pub struct CLUSPROP_SYNTAX {
    pub dw: u32,
    pub Anonymous: _Anonymous_e__Struct,
}

#[repr(C)]
pub struct CLUSPROP_VALUE {
    pub Syntax: CLUSPROP_SYNTAX,
    pub cbLength: u32,
}

#[repr(C)]
pub struct CLUSPROP_RESOURCE_CLASS {
    pub Base: CLUSPROP_VALUE,
    pub rc: i32,
}
import "golang.org/x/sys/windows"

type CLUSPROP_SYNTAX struct {
	dw uint32
	Anonymous _Anonymous_e__Struct
}

type CLUSPROP_VALUE struct {
	Syntax CLUSPROP_SYNTAX
	cbLength uint32
}

type CLUSPROP_RESOURCE_CLASS struct {
	Base CLUSPROP_VALUE
	rc int32
}
type
  CLUSPROP_SYNTAX = record
    dw: DWORD;
    Anonymous: _Anonymous_e__Struct;
  end;

  CLUSPROP_VALUE = record
    Syntax: CLUSPROP_SYNTAX;
    cbLength: DWORD;
  end;

  CLUSPROP_RESOURCE_CLASS = record
    Base: CLUSPROP_VALUE;
    rc: Integer;
  end;
const CLUSPROP_SYNTAX = extern struct {
    dw: u32,
    Anonymous: _Anonymous_e__Struct,
};

const CLUSPROP_VALUE = extern struct {
    Syntax: CLUSPROP_SYNTAX,
    cbLength: u32,
};

const CLUSPROP_RESOURCE_CLASS = extern struct {
    Base: CLUSPROP_VALUE,
    rc: i32,
};
type
  CLUSPROP_SYNTAX {.bycopy.} = object
    dw: uint32
    Anonymous: _Anonymous_e__Struct

  CLUSPROP_VALUE {.bycopy.} = object
    Syntax: CLUSPROP_SYNTAX
    cbLength: uint32

  CLUSPROP_RESOURCE_CLASS {.bycopy.} = object
    Base: CLUSPROP_VALUE
    rc: int32
struct CLUSPROP_SYNTAX
{
    uint dw;
    _Anonymous_e__Struct Anonymous;
}

struct CLUSPROP_VALUE
{
    CLUSPROP_SYNTAX Syntax;
    uint cbLength;
}

struct CLUSPROP_RESOURCE_CLASS
{
    CLUSPROP_VALUE Base;
    int rc;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLUSPROP_RESOURCE_CLASS サイズ: 12 バイト(x64)
dim st, 3    ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; Base : CLUSPROP_VALUE (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; rc : CLUSTER_RESOURCE_CLASS (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CLUSPROP_VALUE
    #field byte Syntax 4
    #field int cbLength
#endstruct

#defstruct global CLUSPROP_RESOURCE_CLASS
    #field CLUSPROP_VALUE Base
    #field int rc
#endstruct

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