ホーム › Storage.FileSystem › VOLUME_ALLOCATE_BC_STREAM_INPUT
VOLUME_ALLOCATE_BC_STREAM_INPUT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Version | DWORD | 4 | +0 | +0 | 本構造体のバージョン。 |
| RequestsPerPeriod | DWORD | 4 | +4 | +4 | 1周期あたりに発行する要求数。 |
| Period | DWORD | 4 | +8 | +8 | 周期時間。ミリ秒単位。 |
| RetryFailures | BOOLEAN | 1 | +12 | +12 | 失敗時に再試行するかを示すブール値。 |
| Discardable | BOOLEAN | 1 | +13 | +13 | 破棄可能なストリームかを示すブール値。 |
| Reserved1 | BOOLEAN | 2 | +14 | +14 | 予約フィールド。0を指定する。 |
| LowestByteOffset | ULONGLONG | 8 | +16 | +16 | ストリームの最小バイトオフセット。 |
| HighestByteOffset | ULONGLONG | 8 | +24 | +24 | ストリームの最大バイトオフセット。 |
| AccessType | DWORD | 4 | +32 | +32 | アクセス種別を示す値。読み取り/書き込み。 |
| AccessMode | DWORD | 4 | +36 | +36 | アクセスモードを示す値。シーケンシャル/ランダム。 |
各言語での定義
#include <windows.h>
// VOLUME_ALLOCATE_BC_STREAM_INPUT (x64 40 / x86 40 バイト)
typedef struct VOLUME_ALLOCATE_BC_STREAM_INPUT {
DWORD Version;
DWORD RequestsPerPeriod;
DWORD Period;
BOOLEAN RetryFailures;
BOOLEAN Discardable;
BOOLEAN Reserved1[2];
ULONGLONG LowestByteOffset;
ULONGLONG HighestByteOffset;
DWORD AccessType;
DWORD AccessMode;
} VOLUME_ALLOCATE_BC_STREAM_INPUT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VOLUME_ALLOCATE_BC_STREAM_INPUT
{
public uint Version;
public uint RequestsPerPeriod;
public uint Period;
[MarshalAs(UnmanagedType.U1)] public bool RetryFailures;
[MarshalAs(UnmanagedType.U1)] public bool Discardable;
[MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.U1, SizeConst = 2)] public bool[] Reserved1;
public ulong LowestByteOffset;
public ulong HighestByteOffset;
public uint AccessType;
public uint AccessMode;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VOLUME_ALLOCATE_BC_STREAM_INPUT
Public Version As UInteger
Public RequestsPerPeriod As UInteger
Public Period As UInteger
<MarshalAs(UnmanagedType.U1)> Public RetryFailures As Boolean
<MarshalAs(UnmanagedType.U1)> Public Discardable As Boolean
<MarshalAs(UnmanagedType.ByValArray, ArraySubType:=UnmanagedType.U1, SizeConst:=2)> Public Reserved1() As Boolean
Public LowestByteOffset As ULong
Public HighestByteOffset As ULong
Public AccessType As UInteger
Public AccessMode As UInteger
End Structureimport ctypes
from ctypes import wintypes
class VOLUME_ALLOCATE_BC_STREAM_INPUT(ctypes.Structure):
_fields_ = [
("Version", wintypes.DWORD),
("RequestsPerPeriod", wintypes.DWORD),
("Period", wintypes.DWORD),
("RetryFailures", ctypes.c_byte),
("Discardable", ctypes.c_byte),
("Reserved1", ctypes.c_byte * 2),
("LowestByteOffset", ctypes.c_ulonglong),
("HighestByteOffset", ctypes.c_ulonglong),
("AccessType", wintypes.DWORD),
("AccessMode", wintypes.DWORD),
]#[repr(C)]
pub struct VOLUME_ALLOCATE_BC_STREAM_INPUT {
pub Version: u32,
pub RequestsPerPeriod: u32,
pub Period: u32,
pub RetryFailures: u8,
pub Discardable: u8,
pub Reserved1: [u8; 2],
pub LowestByteOffset: u64,
pub HighestByteOffset: u64,
pub AccessType: u32,
pub AccessMode: u32,
}import "golang.org/x/sys/windows"
type VOLUME_ALLOCATE_BC_STREAM_INPUT struct {
Version uint32
RequestsPerPeriod uint32
Period uint32
RetryFailures byte
Discardable byte
Reserved1 [2]byte
LowestByteOffset uint64
HighestByteOffset uint64
AccessType uint32
AccessMode uint32
}type
VOLUME_ALLOCATE_BC_STREAM_INPUT = record
Version: DWORD;
RequestsPerPeriod: DWORD;
Period: DWORD;
RetryFailures: ByteBool;
Discardable: ByteBool;
Reserved1: array[0..1] of ByteBool;
LowestByteOffset: UInt64;
HighestByteOffset: UInt64;
AccessType: DWORD;
AccessMode: DWORD;
end;const VOLUME_ALLOCATE_BC_STREAM_INPUT = extern struct {
Version: u32,
RequestsPerPeriod: u32,
Period: u32,
RetryFailures: u8,
Discardable: u8,
Reserved1: [2]u8,
LowestByteOffset: u64,
HighestByteOffset: u64,
AccessType: u32,
AccessMode: u32,
};type
VOLUME_ALLOCATE_BC_STREAM_INPUT {.bycopy.} = object
Version: uint32
RequestsPerPeriod: uint32
Period: uint32
RetryFailures: uint8
Discardable: uint8
Reserved1: array[2, uint8]
LowestByteOffset: uint64
HighestByteOffset: uint64
AccessType: uint32
AccessMode: uint32struct VOLUME_ALLOCATE_BC_STREAM_INPUT
{
uint Version;
uint RequestsPerPeriod;
uint Period;
ubyte RetryFailures;
ubyte Discardable;
ubyte[2] Reserved1;
ulong LowestByteOffset;
ulong HighestByteOffset;
uint AccessType;
uint AccessMode;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; VOLUME_ALLOCATE_BC_STREAM_INPUT サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; Version : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; RequestsPerPeriod : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Period : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; RetryFailures : BOOLEAN (+12, 1byte) poke st,12,値 / 値 = peek(st,12)
; Discardable : BOOLEAN (+13, 1byte) poke st,13,値 / 値 = peek(st,13)
; Reserved1 : BOOLEAN (+14, 2byte) varptr(st)+14 を基点に操作(2byte:入れ子/配列)
; LowestByteOffset : ULONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; HighestByteOffset : ULONGLONG (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; AccessType : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; AccessMode : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global VOLUME_ALLOCATE_BC_STREAM_INPUT
#field int Version
#field int RequestsPerPeriod
#field int Period
#field bool1 RetryFailures
#field bool1 Discardable
#field bool1 Reserved1 2
#field int64 LowestByteOffset
#field int64 HighestByteOffset
#field int AccessType
#field int AccessMode
#endstruct
stdim st, VOLUME_ALLOCATE_BC_STREAM_INPUT ; NSTRUCT 変数を確保
st->Version = 100
mes "Version=" + st->Version