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

CLUSTER_HEALTH_FAULT

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

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

フィールド

フィールドサイズx64x86説明
IdLPWSTR8/4+0+0障害(フォールト)を一意に識別するIDを示すワイド文字列ポインターである。
ErrorTypeDWORD4+8+4障害の種類を示すコード値である。
ErrorCodeDWORD4+12+8障害に対応するエラーコードである。
DescriptionLPWSTR8/4+16+12障害内容の説明を示すワイド文字列ポインターである。
ProviderLPWSTR8/4+24+16障害を報告したプロバイダー名を示すワイド文字列ポインターである。
FlagsDWORD4+32+20障害の属性を示すフラグである。
ReservedDWORD4+36+24予約フィールドである。将来の拡張用で通常は0である。

各言語での定義

#include <windows.h>

// CLUSTER_HEALTH_FAULT  (x64 40 / x86 28 バイト)
typedef struct CLUSTER_HEALTH_FAULT {
    LPWSTR Id;
    DWORD ErrorType;
    DWORD ErrorCode;
    LPWSTR Description;
    LPWSTR Provider;
    DWORD Flags;
    DWORD Reserved;
} CLUSTER_HEALTH_FAULT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLUSTER_HEALTH_FAULT
{
    public IntPtr Id;
    public uint ErrorType;
    public uint ErrorCode;
    public IntPtr Description;
    public IntPtr Provider;
    public uint Flags;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLUSTER_HEALTH_FAULT
    Public Id As IntPtr
    Public ErrorType As UInteger
    Public ErrorCode As UInteger
    Public Description As IntPtr
    Public Provider As IntPtr
    Public Flags As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class CLUSTER_HEALTH_FAULT(ctypes.Structure):
    _fields_ = [
        ("Id", ctypes.c_void_p),
        ("ErrorType", wintypes.DWORD),
        ("ErrorCode", wintypes.DWORD),
        ("Description", ctypes.c_void_p),
        ("Provider", ctypes.c_void_p),
        ("Flags", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct CLUSTER_HEALTH_FAULT {
    pub Id: *mut core::ffi::c_void,
    pub ErrorType: u32,
    pub ErrorCode: u32,
    pub Description: *mut core::ffi::c_void,
    pub Provider: *mut core::ffi::c_void,
    pub Flags: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type CLUSTER_HEALTH_FAULT struct {
	Id uintptr
	ErrorType uint32
	ErrorCode uint32
	Description uintptr
	Provider uintptr
	Flags uint32
	Reserved uint32
}
type
  CLUSTER_HEALTH_FAULT = record
    Id: Pointer;
    ErrorType: DWORD;
    ErrorCode: DWORD;
    Description: Pointer;
    Provider: Pointer;
    Flags: DWORD;
    Reserved: DWORD;
  end;
const CLUSTER_HEALTH_FAULT = extern struct {
    Id: ?*anyopaque,
    ErrorType: u32,
    ErrorCode: u32,
    Description: ?*anyopaque,
    Provider: ?*anyopaque,
    Flags: u32,
    Reserved: u32,
};
type
  CLUSTER_HEALTH_FAULT {.bycopy.} = object
    Id: pointer
    ErrorType: uint32
    ErrorCode: uint32
    Description: pointer
    Provider: pointer
    Flags: uint32
    Reserved: uint32
struct CLUSTER_HEALTH_FAULT
{
    void* Id;
    uint ErrorType;
    uint ErrorCode;
    void* Description;
    void* Provider;
    uint Flags;
    uint Reserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; CLUSTER_HEALTH_FAULT サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; Id : LPWSTR (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; ErrorType : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; ErrorCode : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Description : LPWSTR (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Provider : LPWSTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Flags : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; Reserved : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLUSTER_HEALTH_FAULT サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Id : LPWSTR (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; ErrorType : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; ErrorCode : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Description : LPWSTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Provider : LPWSTR (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; Flags : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; Reserved : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CLUSTER_HEALTH_FAULT
    #field intptr Id
    #field int ErrorType
    #field int ErrorCode
    #field intptr Description
    #field intptr Provider
    #field int Flags
    #field int Reserved
#endstruct

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