Win32 API 日本語リファレンス
ホームStorage.IscsiDisc › HYBRID_INFORMATION

HYBRID_INFORMATION

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

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

フィールド

フィールドサイズx64x86説明
VersionDWORD4+0+0この構造体のバージョン番号。
SizeDWORD4+4+4この構造体のバイトサイズ。
HybridSupportedBOOLEAN1+8+8ハイブリッドディスク機能がサポートされていればTRUE。
StatusNVCACHE_STATUS4+12+12NVキャッシュの状態(NVCACHE_STATUS)。
CacheTypeEffectiveNVCACHE_TYPE4+16+16現在有効なキャッシュの種類(NVCACHE_TYPE)。
CacheTypeDefaultNVCACHE_TYPE4+20+20既定のキャッシュの種類(NVCACHE_TYPE)。
FractionBaseDWORD4+24+24割合フィールドの分母となる基準値。
CacheSizeULONGLONG8+32+32キャッシュのサイズ(論理ブロック数)。
Attributes_Attributes_e__Struct4+40+40キャッシュ属性を表す内部構造体。
Priorities_Priorities_e__Struct48/40+48+44優先度レベル情報を表す内部構造体。

構造体: _Attributes_e__Struct x64 4B / x86 4B

フィールドサイズx64x86
_bitfieldDWORD4+0+0

構造体: _Priorities_e__Struct x64 48B / x86 40B

フィールドサイズx64x86
PriorityLevelCountBYTE1+0+0
MaxPriorityBehaviorBOOLEAN1+1+1
OptimalWriteGranularityBYTE1+2+2
ReservedBYTE1+3+3
DirtyThresholdLowDWORD4+4+4
DirtyThresholdHighDWORD4+8+8
SupportedCommands_SupportedCommands_e__Struct8/4+16+12
PriorityNVCACHE_PRIORITY_LEVEL_DESCRIPTOR24+24+16

各言語での定義

#include <windows.h>

// HYBRID_INFORMATION  (x64 96 / x86 88 バイト)
typedef struct HYBRID_INFORMATION {
    DWORD Version;
    DWORD Size;
    BOOLEAN HybridSupported;
    NVCACHE_STATUS Status;
    NVCACHE_TYPE CacheTypeEffective;
    NVCACHE_TYPE CacheTypeDefault;
    DWORD FractionBase;
    ULONGLONG CacheSize;
    _Attributes_e__Struct Attributes;
    _Priorities_e__Struct Priorities;
} HYBRID_INFORMATION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct HYBRID_INFORMATION
{
    public uint Version;
    public uint Size;
    [MarshalAs(UnmanagedType.U1)] public bool HybridSupported;
    public int Status;
    public int CacheTypeEffective;
    public int CacheTypeDefault;
    public uint FractionBase;
    public ulong CacheSize;
    public _Attributes_e__Struct Attributes;
    public _Priorities_e__Struct Priorities;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure HYBRID_INFORMATION
    Public Version As UInteger
    Public Size As UInteger
    <MarshalAs(UnmanagedType.U1)> Public HybridSupported As Boolean
    Public Status As Integer
    Public CacheTypeEffective As Integer
    Public CacheTypeDefault As Integer
    Public FractionBase As UInteger
    Public CacheSize As ULong
    Public Attributes As _Attributes_e__Struct
    Public Priorities As _Priorities_e__Struct
End Structure
import ctypes
from ctypes import wintypes

class HYBRID_INFORMATION(ctypes.Structure):
    _fields_ = [
        ("Version", wintypes.DWORD),
        ("Size", wintypes.DWORD),
        ("HybridSupported", ctypes.c_byte),
        ("Status", ctypes.c_int),
        ("CacheTypeEffective", ctypes.c_int),
        ("CacheTypeDefault", ctypes.c_int),
        ("FractionBase", wintypes.DWORD),
        ("CacheSize", ctypes.c_ulonglong),
        ("Attributes", _Attributes_e__Struct),
        ("Priorities", _Priorities_e__Struct),
    ]
#[repr(C)]
pub struct HYBRID_INFORMATION {
    pub Version: u32,
    pub Size: u32,
    pub HybridSupported: u8,
    pub Status: i32,
    pub CacheTypeEffective: i32,
    pub CacheTypeDefault: i32,
    pub FractionBase: u32,
    pub CacheSize: u64,
    pub Attributes: _Attributes_e__Struct,
    pub Priorities: _Priorities_e__Struct,
}
import "golang.org/x/sys/windows"

type HYBRID_INFORMATION struct {
	Version uint32
	Size uint32
	HybridSupported byte
	Status int32
	CacheTypeEffective int32
	CacheTypeDefault int32
	FractionBase uint32
	CacheSize uint64
	Attributes _Attributes_e__Struct
	Priorities _Priorities_e__Struct
}
type
  HYBRID_INFORMATION = record
    Version: DWORD;
    Size: DWORD;
    HybridSupported: ByteBool;
    Status: Integer;
    CacheTypeEffective: Integer;
    CacheTypeDefault: Integer;
    FractionBase: DWORD;
    CacheSize: UInt64;
    Attributes: _Attributes_e__Struct;
    Priorities: _Priorities_e__Struct;
  end;
const HYBRID_INFORMATION = extern struct {
    Version: u32,
    Size: u32,
    HybridSupported: u8,
    Status: i32,
    CacheTypeEffective: i32,
    CacheTypeDefault: i32,
    FractionBase: u32,
    CacheSize: u64,
    Attributes: _Attributes_e__Struct,
    Priorities: _Priorities_e__Struct,
};
type
  HYBRID_INFORMATION {.bycopy.} = object
    Version: uint32
    Size: uint32
    HybridSupported: uint8
    Status: int32
    CacheTypeEffective: int32
    CacheTypeDefault: int32
    FractionBase: uint32
    CacheSize: uint64
    Attributes: _Attributes_e__Struct
    Priorities: _Priorities_e__Struct
struct HYBRID_INFORMATION
{
    uint Version;
    uint Size;
    ubyte HybridSupported;
    int Status;
    int CacheTypeEffective;
    int CacheTypeDefault;
    uint FractionBase;
    ulong CacheSize;
    _Attributes_e__Struct Attributes;
    _Priorities_e__Struct Priorities;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; HYBRID_INFORMATION サイズ: 88 バイト(x86)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; HybridSupported : BOOLEAN (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; Status : NVCACHE_STATUS (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; CacheTypeEffective : NVCACHE_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; CacheTypeDefault : NVCACHE_TYPE (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; FractionBase : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; CacheSize : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; Attributes : _Attributes_e__Struct (+40, 4byte)  varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; Priorities : _Priorities_e__Struct (+44, 40byte)  varptr(st)+44 を基点に操作(40byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; HYBRID_INFORMATION サイズ: 96 バイト(x64)
dim st, 24    ; 4byte整数×24(構造体サイズ 96 / 4 切り上げ)
; Version : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; HybridSupported : BOOLEAN (+8, 1byte)  poke st,8,値  /  値 = peek(st,8)
; Status : NVCACHE_STATUS (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; CacheTypeEffective : NVCACHE_TYPE (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; CacheTypeDefault : NVCACHE_TYPE (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; FractionBase : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; CacheSize : ULONGLONG (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; Attributes : _Attributes_e__Struct (+40, 4byte)  varptr(st)+40 を基点に操作(4byte:入れ子/配列)
; Priorities : _Priorities_e__Struct (+48, 48byte)  varptr(st)+48 を基点に操作(48byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global HYBRID_INFORMATION
    #field int Version
    #field int Size
    #field bool1 HybridSupported
    #field int Status
    #field int CacheTypeEffective
    #field int CacheTypeDefault
    #field int FractionBase
    #field int64 CacheSize
    #field _Attributes_e__Struct Attributes
    #field _Priorities_e__Struct Priorities
#endstruct

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