ホーム › Storage.IscsiDisc › NV_SEP_CACHE_PARAMETER
NV_SEP_CACHE_PARAMETER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | この構造体のバージョン番号。 |
| Size | DWORD | 4 | +4 | +4 | この構造体のバイトサイズ。 |
| Flags | _Flags_e__Union | 8/4 | +8 | +8 | キャッシュパラメータの動作フラグを保持する共用体。 |
| WriteCacheType | BYTE | 1 | +16 | +12 | 設定する書き込みキャッシュの種類。 |
| WriteCacheTypeEffective | BYTE | 1 | +17 | +13 | 実際に有効となっている書き込みキャッシュの種類。 |
| ParameterReserve1 | BYTE | 3 | +18 | +14 | 予約パラメータ1。 |
共用体: _Flags_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| CacheFlags | _CacheFlags_e__Struct | 8/4 | +0 | +0 |
| CacheFlagsSet | BYTE | 1 | +0 | +0 |
各言語での定義
#include <windows.h>
// NV_SEP_CACHE_PARAMETER (x64 24 / x86 20 バイト)
typedef struct NV_SEP_CACHE_PARAMETER {
DWORD Version;
DWORD Size;
_Flags_e__Union Flags;
BYTE WriteCacheType;
BYTE WriteCacheTypeEffective;
BYTE ParameterReserve1[3];
} NV_SEP_CACHE_PARAMETER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct NV_SEP_CACHE_PARAMETER
{
public uint Version;
public uint Size;
public _Flags_e__Union Flags;
public byte WriteCacheType;
public byte WriteCacheTypeEffective;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] ParameterReserve1;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure NV_SEP_CACHE_PARAMETER
Public Version As UInteger
Public Size As UInteger
Public Flags As _Flags_e__Union
Public WriteCacheType As Byte
Public WriteCacheTypeEffective As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public ParameterReserve1() As Byte
End Structureimport ctypes
from ctypes import wintypes
class NV_SEP_CACHE_PARAMETER(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("Size", wintypes.DWORD),
("Flags", _Flags_e__Union),
("WriteCacheType", ctypes.c_ubyte),
("WriteCacheTypeEffective", ctypes.c_ubyte),
("ParameterReserve1", ctypes.c_ubyte * 3),
]#[repr(C)]
pub struct NV_SEP_CACHE_PARAMETER {
pub Version: u32,
pub Size: u32,
pub Flags: _Flags_e__Union,
pub WriteCacheType: u8,
pub WriteCacheTypeEffective: u8,
pub ParameterReserve1: [u8; 3],
}import "golang.org/x/sys/windows"
type NV_SEP_CACHE_PARAMETER struct {
Version uint32
Size uint32
Flags _Flags_e__Union
WriteCacheType byte
WriteCacheTypeEffective byte
ParameterReserve1 [3]byte
}type
NV_SEP_CACHE_PARAMETER = record
Version: DWORD;
Size: DWORD;
Flags: _Flags_e__Union;
WriteCacheType: Byte;
WriteCacheTypeEffective: Byte;
ParameterReserve1: array[0..2] of Byte;
end;const NV_SEP_CACHE_PARAMETER = extern struct {
Version: u32,
Size: u32,
Flags: _Flags_e__Union,
WriteCacheType: u8,
WriteCacheTypeEffective: u8,
ParameterReserve1: [3]u8,
};type
NV_SEP_CACHE_PARAMETER {.bycopy.} = object
Version: uint32
Size: uint32
Flags: _Flags_e__Union
WriteCacheType: uint8
WriteCacheTypeEffective: uint8
ParameterReserve1: array[3, uint8]struct NV_SEP_CACHE_PARAMETER
{
uint Version;
uint Size;
_Flags_e__Union Flags;
ubyte WriteCacheType;
ubyte WriteCacheTypeEffective;
ubyte[3] ParameterReserve1;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; NV_SEP_CACHE_PARAMETER サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Flags : _Flags_e__Union (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; WriteCacheType : BYTE (+12, 1byte) poke st,12,値 / 値 = peek(st,12)
; WriteCacheTypeEffective : BYTE (+13, 1byte) poke st,13,値 / 値 = peek(st,13)
; ParameterReserve1 : BYTE (+14, 3byte) varptr(st)+14 を基点に操作(3byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; NV_SEP_CACHE_PARAMETER サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Size : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Flags : _Flags_e__Union (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; WriteCacheType : BYTE (+16, 1byte) poke st,16,値 / 値 = peek(st,16)
; WriteCacheTypeEffective : BYTE (+17, 1byte) poke st,17,値 / 値 = peek(st,17)
; ParameterReserve1 : BYTE (+18, 3byte) varptr(st)+18 を基点に操作(3byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global NV_SEP_CACHE_PARAMETER
#field int Version
#field int Size
#field byte Flags 8
#field byte WriteCacheType
#field byte WriteCacheTypeEffective
#field byte ParameterReserve1 3
#endstruct
stdim st, NV_SEP_CACHE_PARAMETER ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。