ホーム › Networking.Clustering › CLUS_MAINTENANCE_MODE_INFOEX
CLUS_MAINTENANCE_MODE_INFOEX
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| InMaintenance | BOOL | 4 | +0 | +0 | リソースを保守モードにするかを示すBOOL値である。TRUEで保守モード。 |
| MaintainenceModeType | MAINTENANCE_MODE_TYPE_ENUM | 4 | +4 | +4 | 保守モードの種別を示すMAINTENANCE_MODE_TYPE_ENUM列挙値である。 |
| InternalState | CLUSTER_RESOURCE_STATE | 4 | +8 | +8 | リソースの内部状態を示すCLUSTER_RESOURCE_STATE列挙値である。 |
| Signature | DWORD | 4 | +12 | +12 | 対象ディスクの署名値である。 |
各言語での定義
#include <windows.h>
// CLUS_MAINTENANCE_MODE_INFOEX (x64 16 / x86 16 バイト)
typedef struct CLUS_MAINTENANCE_MODE_INFOEX {
BOOL InMaintenance;
MAINTENANCE_MODE_TYPE_ENUM MaintainenceModeType;
CLUSTER_RESOURCE_STATE InternalState;
DWORD Signature;
} CLUS_MAINTENANCE_MODE_INFOEX;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUS_MAINTENANCE_MODE_INFOEX
{
[MarshalAs(UnmanagedType.Bool)] public bool InMaintenance;
public int MaintainenceModeType;
public int InternalState;
public uint Signature;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUS_MAINTENANCE_MODE_INFOEX
<MarshalAs(UnmanagedType.Bool)> Public InMaintenance As Boolean
Public MaintainenceModeType As Integer
Public InternalState As Integer
Public Signature As UInteger
End Structureimport ctypes
from ctypes import wintypes
class CLUS_MAINTENANCE_MODE_INFOEX(ctypes.Structure):
_fields_ = [
("InMaintenance", wintypes.BOOL),
("MaintainenceModeType", ctypes.c_int),
("InternalState", ctypes.c_int),
("Signature", wintypes.DWORD),
]#[repr(C)]
pub struct CLUS_MAINTENANCE_MODE_INFOEX {
pub InMaintenance: i32,
pub MaintainenceModeType: i32,
pub InternalState: i32,
pub Signature: u32,
}import "golang.org/x/sys/windows"
type CLUS_MAINTENANCE_MODE_INFOEX struct {
InMaintenance int32
MaintainenceModeType int32
InternalState int32
Signature uint32
}type
CLUS_MAINTENANCE_MODE_INFOEX = record
InMaintenance: BOOL;
MaintainenceModeType: Integer;
InternalState: Integer;
Signature: DWORD;
end;const CLUS_MAINTENANCE_MODE_INFOEX = extern struct {
InMaintenance: i32,
MaintainenceModeType: i32,
InternalState: i32,
Signature: u32,
};type
CLUS_MAINTENANCE_MODE_INFOEX {.bycopy.} = object
InMaintenance: int32
MaintainenceModeType: int32
InternalState: int32
Signature: uint32struct CLUS_MAINTENANCE_MODE_INFOEX
{
int InMaintenance;
int MaintainenceModeType;
int InternalState;
uint Signature;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLUS_MAINTENANCE_MODE_INFOEX サイズ: 16 バイト(x64)
dim st, 4 ; 4byte整数×4(構造体サイズ 16 / 4 切り上げ)
; InMaintenance : BOOL (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; MaintainenceModeType : MAINTENANCE_MODE_TYPE_ENUM (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; InternalState : CLUSTER_RESOURCE_STATE (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; Signature : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CLUS_MAINTENANCE_MODE_INFOEX
#field bool InMaintenance
#field int MaintainenceModeType
#field int InternalState
#field int Signature
#endstruct
stdim st, CLUS_MAINTENANCE_MODE_INFOEX ; NSTRUCT 変数を確保
st->InMaintenance = 100
mes "InMaintenance=" + st->InMaintenance