ホーム › Devices.Cdrom › CDROM_SET_STREAMING
CDROM_SET_STREAMING
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| RequestType | CDROM_SPEED_REQUEST | 4 | +0 | +0 | ストリーミング設定要求の種類を示す列挙値。 |
| ReadSize | DWORD | 4 | +4 | +4 | 読み取りパフォーマンス基準となるデータサイズをKB単位で示す。 |
| ReadTime | DWORD | 4 | +8 | +8 | ReadSize分を読むのに要する目標時間をミリ秒で示す。 |
| WriteSize | DWORD | 4 | +12 | +12 | 書き込みパフォーマンス基準となるデータサイズをKB単位で示す。 |
| WriteTime | DWORD | 4 | +16 | +16 | WriteSize分を書くのに要する目標時間をミリ秒で示す。 |
| StartLba | DWORD | 4 | +20 | +20 | ストリーミング設定を適用する開始論理ブロックアドレス。 |
| EndLba | DWORD | 4 | +24 | +24 | ストリーミング設定を適用する終了論理ブロックアドレス。 |
| RotationControl | WRITE_ROTATION | 4 | +28 | +28 | ディスク回転制御方式を示す列挙値。CAVやCLVを表す。 |
| RestoreDefaults | BOOLEAN | 1 | +32 | +32 | 既定値に戻すかを示すBOOLEAN値。TRUEで初期化。 |
| SetExact | BOOLEAN | 1 | +33 | +33 | 指定速度を厳密に適用するかを示すBOOLEAN値。 |
| RandomAccess | BOOLEAN | 1 | +34 | +34 | ランダムアクセス最適化を行うかを示すBOOLEAN値。 |
| Persistent | BOOLEAN | 1 | +35 | +35 | 設定をメディア入れ替え後も保持するかを示すBOOLEAN値。 |
各言語での定義
#include <windows.h>
// CDROM_SET_STREAMING (x64 36 / x86 36 バイト)
typedef struct CDROM_SET_STREAMING {
CDROM_SPEED_REQUEST RequestType;
DWORD ReadSize;
DWORD ReadTime;
DWORD WriteSize;
DWORD WriteTime;
DWORD StartLba;
DWORD EndLba;
WRITE_ROTATION RotationControl;
BOOLEAN RestoreDefaults;
BOOLEAN SetExact;
BOOLEAN RandomAccess;
BOOLEAN Persistent;
} CDROM_SET_STREAMING;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CDROM_SET_STREAMING
{
public int RequestType;
public uint ReadSize;
public uint ReadTime;
public uint WriteSize;
public uint WriteTime;
public uint StartLba;
public uint EndLba;
public int RotationControl;
[MarshalAs(UnmanagedType.U1)] public bool RestoreDefaults;
[MarshalAs(UnmanagedType.U1)] public bool SetExact;
[MarshalAs(UnmanagedType.U1)] public bool RandomAccess;
[MarshalAs(UnmanagedType.U1)] public bool Persistent;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CDROM_SET_STREAMING
Public RequestType As Integer
Public ReadSize As UInteger
Public ReadTime As UInteger
Public WriteSize As UInteger
Public WriteTime As UInteger
Public StartLba As UInteger
Public EndLba As UInteger
Public RotationControl As Integer
<MarshalAs(UnmanagedType.U1)> Public RestoreDefaults As Boolean
<MarshalAs(UnmanagedType.U1)> Public SetExact As Boolean
<MarshalAs(UnmanagedType.U1)> Public RandomAccess As Boolean
<MarshalAs(UnmanagedType.U1)> Public Persistent As Boolean
End Structureimport ctypes
from ctypes import wintypes
class CDROM_SET_STREAMING(ctypes.Structure):
_fields_ = [
("RequestType", ctypes.c_int),
("ReadSize", wintypes.DWORD),
("ReadTime", wintypes.DWORD),
("WriteSize", wintypes.DWORD),
("WriteTime", wintypes.DWORD),
("StartLba", wintypes.DWORD),
("EndLba", wintypes.DWORD),
("RotationControl", ctypes.c_int),
("RestoreDefaults", ctypes.c_byte),
("SetExact", ctypes.c_byte),
("RandomAccess", ctypes.c_byte),
("Persistent", ctypes.c_byte),
]#[repr(C)]
pub struct CDROM_SET_STREAMING {
pub RequestType: i32,
pub ReadSize: u32,
pub ReadTime: u32,
pub WriteSize: u32,
pub WriteTime: u32,
pub StartLba: u32,
pub EndLba: u32,
pub RotationControl: i32,
pub RestoreDefaults: u8,
pub SetExact: u8,
pub RandomAccess: u8,
pub Persistent: u8,
}import "golang.org/x/sys/windows"
type CDROM_SET_STREAMING struct {
RequestType int32
ReadSize uint32
ReadTime uint32
WriteSize uint32
WriteTime uint32
StartLba uint32
EndLba uint32
RotationControl int32
RestoreDefaults byte
SetExact byte
RandomAccess byte
Persistent byte
}type
CDROM_SET_STREAMING = record
RequestType: Integer;
ReadSize: DWORD;
ReadTime: DWORD;
WriteSize: DWORD;
WriteTime: DWORD;
StartLba: DWORD;
EndLba: DWORD;
RotationControl: Integer;
RestoreDefaults: ByteBool;
SetExact: ByteBool;
RandomAccess: ByteBool;
Persistent: ByteBool;
end;const CDROM_SET_STREAMING = extern struct {
RequestType: i32,
ReadSize: u32,
ReadTime: u32,
WriteSize: u32,
WriteTime: u32,
StartLba: u32,
EndLba: u32,
RotationControl: i32,
RestoreDefaults: u8,
SetExact: u8,
RandomAccess: u8,
Persistent: u8,
};type
CDROM_SET_STREAMING {.bycopy.} = object
RequestType: int32
ReadSize: uint32
ReadTime: uint32
WriteSize: uint32
WriteTime: uint32
StartLba: uint32
EndLba: uint32
RotationControl: int32
RestoreDefaults: uint8
SetExact: uint8
RandomAccess: uint8
Persistent: uint8struct CDROM_SET_STREAMING
{
int RequestType;
uint ReadSize;
uint ReadTime;
uint WriteSize;
uint WriteTime;
uint StartLba;
uint EndLba;
int RotationControl;
ubyte RestoreDefaults;
ubyte SetExact;
ubyte RandomAccess;
ubyte Persistent;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CDROM_SET_STREAMING サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; RequestType : CDROM_SPEED_REQUEST (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; ReadSize : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; ReadTime : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; WriteSize : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; WriteTime : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; StartLba : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; EndLba : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; RotationControl : WRITE_ROTATION (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; RestoreDefaults : BOOLEAN (+32, 1byte) poke st,32,値 / 値 = peek(st,32)
; SetExact : BOOLEAN (+33, 1byte) poke st,33,値 / 値 = peek(st,33)
; RandomAccess : BOOLEAN (+34, 1byte) poke st,34,値 / 値 = peek(st,34)
; Persistent : BOOLEAN (+35, 1byte) poke st,35,値 / 値 = peek(st,35)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global CDROM_SET_STREAMING
#field int RequestType
#field int ReadSize
#field int ReadTime
#field int WriteSize
#field int WriteTime
#field int StartLba
#field int EndLba
#field int RotationControl
#field bool1 RestoreDefaults
#field bool1 SetExact
#field bool1 RandomAccess
#field bool1 Persistent
#endstruct
stdim st, CDROM_SET_STREAMING ; NSTRUCT 変数を確保
st->RequestType = 100
mes "RequestType=" + st->RequestType