Win32 API 日本語リファレンス
ホームSystem.Ioctl › DEVICE_DATA_SET_SCRUB_OUTPUT

DEVICE_DATA_SET_SCRUB_OUTPUT

構造体
サイズx64: 24 バイト / x86: 24 バイト

サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。

フィールド

フィールドサイズx64x86説明
BytesProcessedULONGLONG8+0+0スクラブ処理されたデータ量をバイト単位で示す。
BytesRepairedULONGLONG8+8+8スクラブで修復されたデータ量をバイト単位で示す。
BytesFailedULONGLONG8+16+16スクラブで修復できなかったデータ量をバイト単位で示す。

各言語での定義

#include <windows.h>

// DEVICE_DATA_SET_SCRUB_OUTPUT  (x64 24 / x86 24 バイト)
typedef struct DEVICE_DATA_SET_SCRUB_OUTPUT {
    ULONGLONG BytesProcessed;
    ULONGLONG BytesRepaired;
    ULONGLONG BytesFailed;
} DEVICE_DATA_SET_SCRUB_OUTPUT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEVICE_DATA_SET_SCRUB_OUTPUT
{
    public ulong BytesProcessed;
    public ulong BytesRepaired;
    public ulong BytesFailed;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEVICE_DATA_SET_SCRUB_OUTPUT
    Public BytesProcessed As ULong
    Public BytesRepaired As ULong
    Public BytesFailed As ULong
End Structure
import ctypes
from ctypes import wintypes

class DEVICE_DATA_SET_SCRUB_OUTPUT(ctypes.Structure):
    _fields_ = [
        ("BytesProcessed", ctypes.c_ulonglong),
        ("BytesRepaired", ctypes.c_ulonglong),
        ("BytesFailed", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct DEVICE_DATA_SET_SCRUB_OUTPUT {
    pub BytesProcessed: u64,
    pub BytesRepaired: u64,
    pub BytesFailed: u64,
}
import "golang.org/x/sys/windows"

type DEVICE_DATA_SET_SCRUB_OUTPUT struct {
	BytesProcessed uint64
	BytesRepaired uint64
	BytesFailed uint64
}
type
  DEVICE_DATA_SET_SCRUB_OUTPUT = record
    BytesProcessed: UInt64;
    BytesRepaired: UInt64;
    BytesFailed: UInt64;
  end;
const DEVICE_DATA_SET_SCRUB_OUTPUT = extern struct {
    BytesProcessed: u64,
    BytesRepaired: u64,
    BytesFailed: u64,
};
type
  DEVICE_DATA_SET_SCRUB_OUTPUT {.bycopy.} = object
    BytesProcessed: uint64
    BytesRepaired: uint64
    BytesFailed: uint64
struct DEVICE_DATA_SET_SCRUB_OUTPUT
{
    ulong BytesProcessed;
    ulong BytesRepaired;
    ulong BytesFailed;
}

HSP用 定義

HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEVICE_DATA_SET_SCRUB_OUTPUT サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; BytesProcessed : ULONGLONG (+0, 8byte)  qpoke st,0,値 / qpeek(st,0)  ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; BytesRepaired : ULONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; BytesFailed : ULONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DEVICE_DATA_SET_SCRUB_OUTPUT
    #field int64 BytesProcessed
    #field int64 BytesRepaired
    #field int64 BytesFailed
#endstruct

stdim st, DEVICE_DATA_SET_SCRUB_OUTPUT        ; NSTRUCT 変数を確保
st->BytesProcessed = 100
mes "BytesProcessed=" + st->BytesProcessed