ホーム › System.Ioctl › DISK_RECORD
DISK_RECORD
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ByteOffset | LONGLONG | 8 | +0 | +0 | I/O対象のバイトオフセット。 |
| StartTime | LONGLONG | 8 | +8 | +8 | I/O開始時刻。 |
| EndTime | LONGLONG | 8 | +16 | +16 | I/O終了時刻。 |
| VirtualAddress | void* | 8/4 | +24 | +24 | データ転送に使用された仮想アドレス。 |
| NumberOfBytes | DWORD | 4 | +32 | +28 | 転送されたバイト数。 |
| DeviceNumber | BYTE | 1 | +36 | +32 | 対象デバイスの番号。 |
| ReadRequest | BOOLEAN | 1 | +37 | +33 | 読み取り要求かどうかを示す真偽値。FALSEは書き込み。 |
各言語での定義
#include <windows.h>
// DISK_RECORD (x64 40 / x86 40 バイト)
typedef struct DISK_RECORD {
LONGLONG ByteOffset;
LONGLONG StartTime;
LONGLONG EndTime;
void* VirtualAddress;
DWORD NumberOfBytes;
BYTE DeviceNumber;
BOOLEAN ReadRequest;
} DISK_RECORD;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DISK_RECORD
{
public long ByteOffset;
public long StartTime;
public long EndTime;
public IntPtr VirtualAddress;
public uint NumberOfBytes;
public byte DeviceNumber;
[MarshalAs(UnmanagedType.U1)] public bool ReadRequest;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DISK_RECORD
Public ByteOffset As Long
Public StartTime As Long
Public EndTime As Long
Public VirtualAddress As IntPtr
Public NumberOfBytes As UInteger
Public DeviceNumber As Byte
<MarshalAs(UnmanagedType.U1)> Public ReadRequest As Boolean
End Structureimport ctypes
from ctypes import wintypes
class DISK_RECORD(ctypes.Structure):
_fields_ = [
("ByteOffset", ctypes.c_longlong),
("StartTime", ctypes.c_longlong),
("EndTime", ctypes.c_longlong),
("VirtualAddress", ctypes.c_void_p),
("NumberOfBytes", wintypes.DWORD),
("DeviceNumber", ctypes.c_ubyte),
("ReadRequest", ctypes.c_byte),
]#[repr(C)]
pub struct DISK_RECORD {
pub ByteOffset: i64,
pub StartTime: i64,
pub EndTime: i64,
pub VirtualAddress: *mut core::ffi::c_void,
pub NumberOfBytes: u32,
pub DeviceNumber: u8,
pub ReadRequest: u8,
}import "golang.org/x/sys/windows"
type DISK_RECORD struct {
ByteOffset int64
StartTime int64
EndTime int64
VirtualAddress uintptr
NumberOfBytes uint32
DeviceNumber byte
ReadRequest byte
}type
DISK_RECORD = record
ByteOffset: Int64;
StartTime: Int64;
EndTime: Int64;
VirtualAddress: Pointer;
NumberOfBytes: DWORD;
DeviceNumber: Byte;
ReadRequest: ByteBool;
end;const DISK_RECORD = extern struct {
ByteOffset: i64,
StartTime: i64,
EndTime: i64,
VirtualAddress: ?*anyopaque,
NumberOfBytes: u32,
DeviceNumber: u8,
ReadRequest: u8,
};type
DISK_RECORD {.bycopy.} = object
ByteOffset: int64
StartTime: int64
EndTime: int64
VirtualAddress: pointer
NumberOfBytes: uint32
DeviceNumber: uint8
ReadRequest: uint8struct DISK_RECORD
{
long ByteOffset;
long StartTime;
long EndTime;
void* VirtualAddress;
uint NumberOfBytes;
ubyte DeviceNumber;
ubyte ReadRequest;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DISK_RECORD サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; ByteOffset : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; StartTime : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; EndTime : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; VirtualAddress : void* (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; NumberOfBytes : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; DeviceNumber : BYTE (+32, 1byte) poke st,32,値 / 値 = peek(st,32)
; ReadRequest : BOOLEAN (+33, 1byte) poke st,33,値 / 値 = peek(st,33)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DISK_RECORD サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; ByteOffset : LONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; StartTime : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; EndTime : LONGLONG (+16, 8byte) qpoke st,16,値 / qpeek(st,16) ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; VirtualAddress : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; NumberOfBytes : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; DeviceNumber : BYTE (+36, 1byte) poke st,36,値 / 値 = peek(st,36)
; ReadRequest : BOOLEAN (+37, 1byte) poke st,37,値 / 値 = peek(st,37)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DISK_RECORD
#field int64 ByteOffset
#field int64 StartTime
#field int64 EndTime
#field intptr VirtualAddress
#field int NumberOfBytes
#field byte DeviceNumber
#field bool1 ReadRequest
#endstruct
stdim st, DISK_RECORD ; NSTRUCT 変数を確保
st->ByteOffset = 100
mes "ByteOffset=" + st->ByteOffset