ホーム › System.Ioctl › STORAGE_PREDICT_FAILURE
STORAGE_PREDICT_FAILURE
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| PredictFailure | DWORD | 4 | +0 | +0 | 障害が予測されるかを示す値。非0で近い将来の故障が予測される(SMART)。 |
| VendorSpecific | BYTE | 512 | +4 | +4 | ベンダー固有のSMART属性データを格納するバイト配列(512バイト)。 |
各言語での定義
#include <windows.h>
// STORAGE_PREDICT_FAILURE (x64 516 / x86 516 バイト)
typedef struct STORAGE_PREDICT_FAILURE {
DWORD PredictFailure;
BYTE VendorSpecific[512];
} STORAGE_PREDICT_FAILURE;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct STORAGE_PREDICT_FAILURE
{
public uint PredictFailure;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 512)] public byte[] VendorSpecific;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure STORAGE_PREDICT_FAILURE
Public PredictFailure As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=512)> Public VendorSpecific() As Byte
End Structureimport ctypes
from ctypes import wintypes
class STORAGE_PREDICT_FAILURE(ctypes.Structure):
_fields_ = [
("PredictFailure", wintypes.DWORD),
("VendorSpecific", ctypes.c_ubyte * 512),
]#[repr(C)]
pub struct STORAGE_PREDICT_FAILURE {
pub PredictFailure: u32,
pub VendorSpecific: [u8; 512],
}import "golang.org/x/sys/windows"
type STORAGE_PREDICT_FAILURE struct {
PredictFailure uint32
VendorSpecific [512]byte
}type
STORAGE_PREDICT_FAILURE = record
PredictFailure: DWORD;
VendorSpecific: array[0..511] of Byte;
end;const STORAGE_PREDICT_FAILURE = extern struct {
PredictFailure: u32,
VendorSpecific: [512]u8,
};type
STORAGE_PREDICT_FAILURE {.bycopy.} = object
PredictFailure: uint32
VendorSpecific: array[512, uint8]struct STORAGE_PREDICT_FAILURE
{
uint PredictFailure;
ubyte[512] VendorSpecific;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; STORAGE_PREDICT_FAILURE サイズ: 516 バイト(x64)
dim st, 129 ; 4byte整数×129(構造体サイズ 516 / 4 切り上げ)
; PredictFailure : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; VendorSpecific : BYTE (+4, 512byte) varptr(st)+4 を基点に操作(512byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global STORAGE_PREDICT_FAILURE
#field int PredictFailure
#field byte VendorSpecific 512
#endstruct
stdim st, STORAGE_PREDICT_FAILURE ; NSTRUCT 変数を確保
st->PredictFailure = 100
mes "PredictFailure=" + st->PredictFailure