ホーム › System.Ioctl › REPAIR_COPIES_INPUT
REPAIR_COPIES_INPUT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| Size | DWORD | 4 | +0 | +0 | この入力構造体のサイズ(バイト)。 |
| Flags | DWORD | 4 | +4 | +4 | 修復動作を制御するフラグ。 |
| FileOffset | LONGLONG | 8 | +8 | +8 | 修復対象の開始ファイルオフセット(バイト)。 |
| Length | DWORD | 4 | +16 | +16 | 修復対象範囲の長さ(バイト)。 |
| SourceCopy | DWORD | 4 | +20 | +20 | 正データとして使用するコピー(プレックス)の番号。 |
| NumberOfRepairCopies | DWORD | 4 | +24 | +24 | 修復対象とするコピーの数。 |
| RepairCopies | DWORD | 4 | +28 | +28 | 修復対象とするコピー番号の配列の先頭。 |
各言語での定義
#include <windows.h>
// REPAIR_COPIES_INPUT (x64 32 / x86 32 バイト)
typedef struct REPAIR_COPIES_INPUT {
DWORD Size;
DWORD Flags;
LONGLONG FileOffset;
DWORD Length;
DWORD SourceCopy;
DWORD NumberOfRepairCopies;
DWORD RepairCopies[1];
} REPAIR_COPIES_INPUT;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct REPAIR_COPIES_INPUT
{
public uint Size;
public uint Flags;
public long FileOffset;
public uint Length;
public uint SourceCopy;
public uint NumberOfRepairCopies;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public uint[] RepairCopies;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure REPAIR_COPIES_INPUT
Public Size As UInteger
Public Flags As UInteger
Public FileOffset As Long
Public Length As UInteger
Public SourceCopy As UInteger
Public NumberOfRepairCopies As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public RepairCopies() As UInteger
End Structureimport ctypes
from ctypes import wintypes
class REPAIR_COPIES_INPUT(ctypes.Structure):
_fields_ = [
("Size", wintypes.DWORD),
("Flags", wintypes.DWORD),
("FileOffset", ctypes.c_longlong),
("Length", wintypes.DWORD),
("SourceCopy", wintypes.DWORD),
("NumberOfRepairCopies", wintypes.DWORD),
("RepairCopies", wintypes.DWORD * 1),
]#[repr(C)]
pub struct REPAIR_COPIES_INPUT {
pub Size: u32,
pub Flags: u32,
pub FileOffset: i64,
pub Length: u32,
pub SourceCopy: u32,
pub NumberOfRepairCopies: u32,
pub RepairCopies: [u32; 1],
}import "golang.org/x/sys/windows"
type REPAIR_COPIES_INPUT struct {
Size uint32
Flags uint32
FileOffset int64
Length uint32
SourceCopy uint32
NumberOfRepairCopies uint32
RepairCopies [1]uint32
}type
REPAIR_COPIES_INPUT = record
Size: DWORD;
Flags: DWORD;
FileOffset: Int64;
Length: DWORD;
SourceCopy: DWORD;
NumberOfRepairCopies: DWORD;
RepairCopies: array[0..0] of DWORD;
end;const REPAIR_COPIES_INPUT = extern struct {
Size: u32,
Flags: u32,
FileOffset: i64,
Length: u32,
SourceCopy: u32,
NumberOfRepairCopies: u32,
RepairCopies: [1]u32,
};type
REPAIR_COPIES_INPUT {.bycopy.} = object
Size: uint32
Flags: uint32
FileOffset: int64
Length: uint32
SourceCopy: uint32
NumberOfRepairCopies: uint32
RepairCopies: array[1, uint32]struct REPAIR_COPIES_INPUT
{
uint Size;
uint Flags;
long FileOffset;
uint Length;
uint SourceCopy;
uint NumberOfRepairCopies;
uint[1] RepairCopies;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; REPAIR_COPIES_INPUT サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; Size : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; Flags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; FileOffset : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Length : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; SourceCopy : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; NumberOfRepairCopies : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; RepairCopies : DWORD (+28, 4byte) varptr(st)+28 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global REPAIR_COPIES_INPUT
#field int Size
#field int Flags
#field int64 FileOffset
#field int Length
#field int SourceCopy
#field int NumberOfRepairCopies
#field int RepairCopies 1
#endstruct
stdim st, REPAIR_COPIES_INPUT ; NSTRUCT 変数を確保
st->Size = 100
mes "Size=" + st->Size