Win32 API 日本語リファレンス
ホームStorage.DataDeduplication › DEDUP_CONTAINER_EXTENT

DEDUP_CONTAINER_EXTENT

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

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

フィールド

フィールドサイズx64x86説明
ContainerIndexDWORD4+0+0データを格納するコンテナのインデックスを表す。
StartOffsetLONGLONG8+8+8コンテナ内のデータ開始オフセットをバイトで表す。
LengthLONGLONG8+16+16データ範囲の長さをバイトで表す。

各言語での定義

#include <windows.h>

// DEDUP_CONTAINER_EXTENT  (x64 24 / x86 24 バイト)
typedef struct DEDUP_CONTAINER_EXTENT {
    DWORD ContainerIndex;
    LONGLONG StartOffset;
    LONGLONG Length;
} DEDUP_CONTAINER_EXTENT;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DEDUP_CONTAINER_EXTENT
{
    public uint ContainerIndex;
    public long StartOffset;
    public long Length;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DEDUP_CONTAINER_EXTENT
    Public ContainerIndex As UInteger
    Public StartOffset As Long
    Public Length As Long
End Structure
import ctypes
from ctypes import wintypes

class DEDUP_CONTAINER_EXTENT(ctypes.Structure):
    _fields_ = [
        ("ContainerIndex", wintypes.DWORD),
        ("StartOffset", ctypes.c_longlong),
        ("Length", ctypes.c_longlong),
    ]
#[repr(C)]
pub struct DEDUP_CONTAINER_EXTENT {
    pub ContainerIndex: u32,
    pub StartOffset: i64,
    pub Length: i64,
}
import "golang.org/x/sys/windows"

type DEDUP_CONTAINER_EXTENT struct {
	ContainerIndex uint32
	StartOffset int64
	Length int64
}
type
  DEDUP_CONTAINER_EXTENT = record
    ContainerIndex: DWORD;
    StartOffset: Int64;
    Length: Int64;
  end;
const DEDUP_CONTAINER_EXTENT = extern struct {
    ContainerIndex: u32,
    StartOffset: i64,
    Length: i64,
};
type
  DEDUP_CONTAINER_EXTENT {.bycopy.} = object
    ContainerIndex: uint32
    StartOffset: int64
    Length: int64
struct DEDUP_CONTAINER_EXTENT
{
    uint ContainerIndex;
    long StartOffset;
    long Length;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DEDUP_CONTAINER_EXTENT サイズ: 24 バイト(x64)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; ContainerIndex : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; StartOffset : LONGLONG (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; Length : LONGLONG (+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 DEDUP_CONTAINER_EXTENT
    #field int ContainerIndex
    #field int64 StartOffset
    #field int64 Length
#endstruct

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