ホーム › System.SystemServices › SCRUB_DATA_INPUT
SCRUB_DATA_INPUT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | 本構造体のサイズをバイト単位で示す。 |
| Flags | DWORD | 4 | +4 | +4 | スクラブ操作の動作を制御するフラグ。 |
| MaximumIos | DWORD | 4 | +8 | +8 | 操作中に許可する最大I/O数。 |
| ObjectId | DWORD | 16 | +12 | +12 | 対象オブジェクトの識別子。 |
| StartingByteOffset | ULONGLONG | 8 | +32 | +32 | スクラブ開始位置のバイトオフセット。 |
| ByteCount | ULONGLONG | 8 | +40 | +40 | スクラブ対象のバイト数。 |
| Reserved | DWORD | 144 | +48 | +48 | 将来用の予約フィールド。 |
| ResumeContext | BYTE | 1040 | +192 | +192 | 中断した操作を再開するためのコンテキストデータの先頭(可変長)。 |
各言語での定義
#include <windows.h>
// SCRUB_DATA_INPUT (x64 1232 / x86 1232 バイト)
typedef struct SCRUB_DATA_INPUT {
DWORD Size;
DWORD Flags;
DWORD MaximumIos;
DWORD ObjectId[4];
ULONGLONG StartingByteOffset;
ULONGLONG ByteCount;
DWORD Reserved[36];
BYTE ResumeContext[1040];
} SCRUB_DATA_INPUT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct SCRUB_DATA_INPUT
{
public uint Size;
public uint Flags;
public uint MaximumIos;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public uint[] ObjectId;
public ulong StartingByteOffset;
public ulong ByteCount;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 36)] public uint[] Reserved;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1040)] public byte[] ResumeContext;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure SCRUB_DATA_INPUT
Public Size As UInteger
Public Flags As UInteger
Public MaximumIos As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public ObjectId() As UInteger
Public StartingByteOffset As ULong
Public ByteCount As ULong
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=36)> Public Reserved() As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1040)> Public ResumeContext() As Byte
End Structureimport ctypes
from ctypes import wintypes
class SCRUB_DATA_INPUT(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Flags", wintypes.DWORD),
("MaximumIos", wintypes.DWORD),
("ObjectId", wintypes.DWORD * 4),
("StartingByteOffset", ctypes.c_ulonglong),
("ByteCount", ctypes.c_ulonglong),
("Reserved", wintypes.DWORD * 36),
("ResumeContext", ctypes.c_ubyte * 1040),
]#[repr(C)]
pub struct SCRUB_DATA_INPUT {
pub Size: u32,
pub Flags: u32,
pub MaximumIos: u32,
pub ObjectId: [u32; 4],
pub StartingByteOffset: u64,
pub ByteCount: u64,
pub Reserved: [u32; 36],
pub ResumeContext: [u8; 1040],
}import "golang.org/x/sys/windows"
type SCRUB_DATA_INPUT struct {
Size uint32
Flags uint32
MaximumIos uint32
ObjectId [4]uint32
StartingByteOffset uint64
ByteCount uint64
Reserved [36]uint32
ResumeContext [1040]byte
}type
SCRUB_DATA_INPUT = record
Size: DWORD;
Flags: DWORD;
MaximumIos: DWORD;
ObjectId: array[0..3] of DWORD;
StartingByteOffset: UInt64;
ByteCount: UInt64;
Reserved: array[0..35] of DWORD;
ResumeContext: array[0..1039] of Byte;
end;const SCRUB_DATA_INPUT = extern struct {
Size: u32,
Flags: u32,
MaximumIos: u32,
ObjectId: [4]u32,
StartingByteOffset: u64,
ByteCount: u64,
Reserved: [36]u32,
ResumeContext: [1040]u8,
};type
SCRUB_DATA_INPUT {.bycopy.} = object
Size: uint32
Flags: uint32
MaximumIos: uint32
ObjectId: array[4, uint32]
StartingByteOffset: uint64
ByteCount: uint64
Reserved: array[36, uint32]
ResumeContext: array[1040, uint8]struct SCRUB_DATA_INPUT
{
uint Size;
uint Flags;
uint MaximumIos;
uint[4] ObjectId;
ulong StartingByteOffset;
ulong ByteCount;
uint[36] Reserved;
ubyte[1040] ResumeContext;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; SCRUB_DATA_INPUT サイズ: 1232 バイト(x64)
dim st, 308 ; 4byte整数×308(構造体サイズ 1232 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; MaximumIos : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ObjectId : DWORD (+12, 16byte) varptr(st)+12 を基点に操作(16byte:入れ子/配列)
; StartingByteOffset : ULONGLONG (+32, 8byte) qpoke st,32,値 / qpeek(st,32) ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; ByteCount : ULONGLONG (+40, 8byte) qpoke st,40,値 / qpeek(st,40) ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; Reserved : DWORD (+48, 144byte) varptr(st)+48 を基点に操作(144byte:入れ子/配列)
; ResumeContext : BYTE (+192, 1040byte) varptr(st)+192 を基点に操作(1040byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global SCRUB_DATA_INPUT
#field int Size
#field int Flags
#field int MaximumIos
#field int ObjectId 4
#field int64 StartingByteOffset
#field int64 ByteCount
#field int Reserved 36
#field byte ResumeContext 1040
#endstruct
stdim st, SCRUB_DATA_INPUT ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size