ホーム › System.SystemServices › TAPE_GET_DRIVE_PARAMETERS
TAPE_GET_DRIVE_PARAMETERS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ECC | BOOLEAN | 1 | +0 | +0 | このメンバーが TRUE の場合、デバイスはハードウェアによるエラー訂正をサポートします。それ以外の場合はサポートしません。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Compression | BOOLEAN | 1 | +1 | +1 | このメンバーが TRUE の場合、ハードウェアによるデータ圧縮が有効です。それ以外の場合は無効です。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DataPadding | BOOLEAN | 1 | +2 | +2 | このメンバーが TRUE の場合、データパディングが有効です。それ以外の場合は無効です。データパディングは、テープを一定の速度で走行させ続けます。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ReportSetmarks | BOOLEAN | 1 | +3 | +3 | このメンバーが TRUE の場合、セットマークの報告が有効です。それ以外の場合は無効です。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| DefaultBlockSize | DWORD | 4 | +4 | +4 | デバイスの既定の固定ブロックサイズ (バイト単位)。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MaximumBlockSize | DWORD | 4 | +8 | +8 | デバイスの最大ブロックサイズ (バイト単位)。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MinimumBlockSize | DWORD | 4 | +12 | +12 | デバイスの最小ブロックサイズ (バイト単位)。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| MaximumPartitionCount | DWORD | 4 | +16 | +16 | デバイス上に作成できるパーティションの最大数。 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FeaturesLow | DWORD | 4 | +20 | +20 | デバイスの機能フラグの下位ビットです。このメンバーには、次の値の 1 つ以上を指定できます。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| FeaturesHigh | TAPE_GET_DRIVE_PARAMETERS_FEATURES_HIGH | 4 | +24 | +24 | デバイスの機能フラグの上位ビットです。このメンバーには、次の値の 1 つ以上を指定できます。
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| EOTWarningZoneSize | DWORD | 4 | +28 | +28 | テープ終端警告位置からテープの物理的な終端までのバイト数を示します。 |
公式ドキュメント
TAPE_GET_DRIVE_PARAMETERS 構造体は、テープドライブについて記述します。この構造体は GetTapeParameters 関数で使用されます。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// TAPE_GET_DRIVE_PARAMETERS (x64 32 / x86 32 バイト)
typedef struct TAPE_GET_DRIVE_PARAMETERS {
BOOLEAN ECC;
BOOLEAN Compression;
BOOLEAN DataPadding;
BOOLEAN ReportSetmarks;
DWORD DefaultBlockSize;
DWORD MaximumBlockSize;
DWORD MinimumBlockSize;
DWORD MaximumPartitionCount;
DWORD FeaturesLow;
TAPE_GET_DRIVE_PARAMETERS_FEATURES_HIGH FeaturesHigh;
DWORD EOTWarningZoneSize;
} TAPE_GET_DRIVE_PARAMETERS;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct TAPE_GET_DRIVE_PARAMETERS
{
[MarshalAs(UnmanagedType.U1)] public bool ECC;
[MarshalAs(UnmanagedType.U1)] public bool Compression;
[MarshalAs(UnmanagedType.U1)] public bool DataPadding;
[MarshalAs(UnmanagedType.U1)] public bool ReportSetmarks;
public uint DefaultBlockSize;
public uint MaximumBlockSize;
public uint MinimumBlockSize;
public uint MaximumPartitionCount;
public uint FeaturesLow;
public uint FeaturesHigh;
public uint EOTWarningZoneSize;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure TAPE_GET_DRIVE_PARAMETERS
<MarshalAs(UnmanagedType.U1)> Public ECC As Boolean
<MarshalAs(UnmanagedType.U1)> Public Compression As Boolean
<MarshalAs(UnmanagedType.U1)> Public DataPadding As Boolean
<MarshalAs(UnmanagedType.U1)> Public ReportSetmarks As Boolean
Public DefaultBlockSize As UInteger
Public MaximumBlockSize As UInteger
Public MinimumBlockSize As UInteger
Public MaximumPartitionCount As UInteger
Public FeaturesLow As UInteger
Public FeaturesHigh As UInteger
Public EOTWarningZoneSize As UInteger
End Structureimport ctypes
from ctypes import wintypes
class TAPE_GET_DRIVE_PARAMETERS(ctypes.Structure):
_fields_ = [
("ECC", ctypes.c_byte),
("Compression", ctypes.c_byte),
("DataPadding", ctypes.c_byte),
("ReportSetmarks", ctypes.c_byte),
("DefaultBlockSize", wintypes.DWORD),
("MaximumBlockSize", wintypes.DWORD),
("MinimumBlockSize", wintypes.DWORD),
("MaximumPartitionCount", wintypes.DWORD),
("FeaturesLow", wintypes.DWORD),
("FeaturesHigh", wintypes.DWORD),
("EOTWarningZoneSize", wintypes.DWORD),
]#[repr(C)]
pub struct TAPE_GET_DRIVE_PARAMETERS {
pub ECC: u8,
pub Compression: u8,
pub DataPadding: u8,
pub ReportSetmarks: u8,
pub DefaultBlockSize: u32,
pub MaximumBlockSize: u32,
pub MinimumBlockSize: u32,
pub MaximumPartitionCount: u32,
pub FeaturesLow: u32,
pub FeaturesHigh: u32,
pub EOTWarningZoneSize: u32,
}import "golang.org/x/sys/windows"
type TAPE_GET_DRIVE_PARAMETERS struct {
ECC byte
Compression byte
DataPadding byte
ReportSetmarks byte
DefaultBlockSize uint32
MaximumBlockSize uint32
MinimumBlockSize uint32
MaximumPartitionCount uint32
FeaturesLow uint32
FeaturesHigh uint32
EOTWarningZoneSize uint32
}type
TAPE_GET_DRIVE_PARAMETERS = record
ECC: ByteBool;
Compression: ByteBool;
DataPadding: ByteBool;
ReportSetmarks: ByteBool;
DefaultBlockSize: DWORD;
MaximumBlockSize: DWORD;
MinimumBlockSize: DWORD;
MaximumPartitionCount: DWORD;
FeaturesLow: DWORD;
FeaturesHigh: DWORD;
EOTWarningZoneSize: DWORD;
end;const TAPE_GET_DRIVE_PARAMETERS = extern struct {
ECC: u8,
Compression: u8,
DataPadding: u8,
ReportSetmarks: u8,
DefaultBlockSize: u32,
MaximumBlockSize: u32,
MinimumBlockSize: u32,
MaximumPartitionCount: u32,
FeaturesLow: u32,
FeaturesHigh: u32,
EOTWarningZoneSize: u32,
};type
TAPE_GET_DRIVE_PARAMETERS {.bycopy.} = object
ECC: uint8
Compression: uint8
DataPadding: uint8
ReportSetmarks: uint8
DefaultBlockSize: uint32
MaximumBlockSize: uint32
MinimumBlockSize: uint32
MaximumPartitionCount: uint32
FeaturesLow: uint32
FeaturesHigh: uint32
EOTWarningZoneSize: uint32struct TAPE_GET_DRIVE_PARAMETERS
{
ubyte ECC;
ubyte Compression;
ubyte DataPadding;
ubyte ReportSetmarks;
uint DefaultBlockSize;
uint MaximumBlockSize;
uint MinimumBlockSize;
uint MaximumPartitionCount;
uint FeaturesLow;
uint FeaturesHigh;
uint EOTWarningZoneSize;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; TAPE_GET_DRIVE_PARAMETERS サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; ECC : BOOLEAN (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; Compression : BOOLEAN (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; DataPadding : BOOLEAN (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; ReportSetmarks : BOOLEAN (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; DefaultBlockSize : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; MaximumBlockSize : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; MinimumBlockSize : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; MaximumPartitionCount : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; FeaturesLow : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; FeaturesHigh : TAPE_GET_DRIVE_PARAMETERS_FEATURES_HIGH (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; EOTWarningZoneSize : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global TAPE_GET_DRIVE_PARAMETERS
#field bool1 ECC
#field bool1 Compression
#field bool1 DataPadding
#field bool1 ReportSetmarks
#field int DefaultBlockSize
#field int MaximumBlockSize
#field int MinimumBlockSize
#field int MaximumPartitionCount
#field int FeaturesLow
#field int FeaturesHigh
#field int EOTWarningZoneSize
#endstruct
stdim st, TAPE_GET_DRIVE_PARAMETERS ; NSTRUCT 変数を確保
st->ECC = 100
mes "ECC=" + st->ECC