ホーム › Networking.Clustering › CLUSPROP_REQUIRED_DEPENDENCY
CLUSPROP_REQUIRED_DEPENDENCY
共用体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Value | CLUSPROP_VALUE | 8 | +0 | +0 | 汎用プロパティ値としてアクセスするためのCLUSPROP_VALUE共用体メンバーである。 |
| ResClass | CLUSPROP_RESOURCE_CLASS | 12 | +0 | +0 | 依存先をリソースクラスで指定するCLUSPROP_RESOURCE_CLASSメンバーである。 |
| ResTypeName | CLUSPROP_SZ | 12 | +0 | +0 | 依存先をリソース種別名で指定するCLUSPROP_SZ(文字列)メンバーである。 |
各言語での定義
#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;
// CLUSPROP_SZ (x64 12 / x86 12 バイト)
typedef struct CLUSPROP_SZ {
CLUSPROP_VALUE Base;
WCHAR sz[1];
} CLUSPROP_SZ;
// CLUSPROP_REQUIRED_DEPENDENCY (x64 12 / x86 12 バイト)
typedef struct CLUSPROP_REQUIRED_DEPENDENCY {
CLUSPROP_VALUE Value;
CLUSPROP_RESOURCE_CLASS ResClass;
CLUSPROP_SZ ResTypeName;
} CLUSPROP_REQUIRED_DEPENDENCY;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;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSPROP_SZ
{
public CLUSPROP_VALUE Base;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)] public string sz;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSPROP_REQUIRED_DEPENDENCY
{
public CLUSPROP_VALUE Value;
public CLUSPROP_RESOURCE_CLASS ResClass;
public CLUSPROP_SZ ResTypeName;
}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
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSPROP_SZ
Public Base As CLUSPROP_VALUE
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=1)> Public sz As String
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSPROP_REQUIRED_DEPENDENCY
Public Value As CLUSPROP_VALUE
Public ResClass As CLUSPROP_RESOURCE_CLASS
Public ResTypeName As CLUSPROP_SZ
End Structureimport 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),
]
class CLUSPROP_SZ(ctypes.Structure):
_fields_ = [
("Base", CLUSPROP_VALUE),
("sz", ctypes.c_wchar * 1),
]
class CLUSPROP_REQUIRED_DEPENDENCY(ctypes.Structure):
_fields_ = [
("Value", CLUSPROP_VALUE),
("ResClass", CLUSPROP_RESOURCE_CLASS),
("ResTypeName", CLUSPROP_SZ),
]#[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,
}
#[repr(C)]
pub struct CLUSPROP_SZ {
pub Base: CLUSPROP_VALUE,
pub sz: [u16; 1],
}
#[repr(C)]
pub struct CLUSPROP_REQUIRED_DEPENDENCY {
pub Value: CLUSPROP_VALUE,
pub ResClass: CLUSPROP_RESOURCE_CLASS,
pub ResTypeName: CLUSPROP_SZ,
}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_SZ struct {
Base CLUSPROP_VALUE
sz [1]uint16
}
type CLUSPROP_REQUIRED_DEPENDENCY struct {
Value CLUSPROP_VALUE
ResClass CLUSPROP_RESOURCE_CLASS
ResTypeName CLUSPROP_SZ
}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;
CLUSPROP_SZ = record
Base: CLUSPROP_VALUE;
sz: array[0..0] of WideChar;
end;
CLUSPROP_REQUIRED_DEPENDENCY = record
Value: CLUSPROP_VALUE;
ResClass: CLUSPROP_RESOURCE_CLASS;
ResTypeName: CLUSPROP_SZ;
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,
};
const CLUSPROP_SZ = extern struct {
Base: CLUSPROP_VALUE,
sz: [1]u16,
};
const CLUSPROP_REQUIRED_DEPENDENCY = extern struct {
Value: CLUSPROP_VALUE,
ResClass: CLUSPROP_RESOURCE_CLASS,
ResTypeName: CLUSPROP_SZ,
};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
CLUSPROP_SZ {.bycopy.} = object
Base: CLUSPROP_VALUE
sz: array[1, uint16]
CLUSPROP_REQUIRED_DEPENDENCY {.bycopy.} = object
Value: CLUSPROP_VALUE
ResClass: CLUSPROP_RESOURCE_CLASS
ResTypeName: CLUSPROP_SZstruct 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;
}
struct CLUSPROP_SZ
{
CLUSPROP_VALUE Base;
wchar[1] sz;
}
struct CLUSPROP_REQUIRED_DEPENDENCY
{
CLUSPROP_VALUE Value;
CLUSPROP_RESOURCE_CLASS ResClass;
CLUSPROP_SZ ResTypeName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLUSPROP_REQUIRED_DEPENDENCY サイズ: 12 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 12 / 4 切り上げ)
; Value : CLUSPROP_VALUE (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; ResClass : CLUSPROP_RESOURCE_CLASS (+0, 12byte) varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; ResTypeName : CLUSPROP_SZ (+0, 12byte) varptr(st)+0 を基点に操作(12byte:入れ子/配列)
; ※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
#defstruct global CLUSPROP_SZ
#field CLUSPROP_VALUE Base
#field wchar sz 1
#endstruct
#defstruct global CLUSPROP_REQUIRED_DEPENDENCY
#field CLUSPROP_VALUE Value
#field CLUSPROP_RESOURCE_CLASS ResClass
#field CLUSPROP_SZ ResTypeName
#endstruct
stdim st, CLUSPROP_REQUIRED_DEPENDENCY ; NSTRUCT 変数を確保