ホーム › Storage.FileSystem › CLS_ARCHIVE_DESCRIPTOR
CLS_ARCHIVE_DESCRIPTOR
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| coffLow | ULONGLONG | 8 | +0 | +0 | アーカイブ範囲の下限オフセット。バイト単位。 |
| coffHigh | ULONGLONG | 8 | +8 | +8 | アーカイブ範囲の上限オフセット。バイト単位。 |
| infoContainer | CLS_CONTAINER_INFORMATION | 576 | +16 | +16 | 対象コンテナの情報。 |
各言語での定義
#include <windows.h>
// CLS_CONTAINER_INFORMATION (x64 576 / x86 576 バイト)
typedef struct CLS_CONTAINER_INFORMATION {
DWORD FileAttributes;
ULONGLONG CreationTime;
ULONGLONG LastAccessTime;
ULONGLONG LastWriteTime;
LONGLONG ContainerSize;
DWORD FileNameActualLength;
DWORD FileNameLength;
WCHAR FileName[256];
DWORD State;
DWORD PhysicalContainerId;
DWORD LogicalContainerId;
} CLS_CONTAINER_INFORMATION;
// CLS_ARCHIVE_DESCRIPTOR (x64 592 / x86 592 バイト)
typedef struct CLS_ARCHIVE_DESCRIPTOR {
ULONGLONG coffLow;
ULONGLONG coffHigh;
CLS_CONTAINER_INFORMATION infoContainer;
} CLS_ARCHIVE_DESCRIPTOR;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLS_CONTAINER_INFORMATION
{
public uint FileAttributes;
public ulong CreationTime;
public ulong LastAccessTime;
public ulong LastWriteTime;
public long ContainerSize;
public uint FileNameActualLength;
public uint FileNameLength;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 256)] public string FileName;
public uint State;
public uint PhysicalContainerId;
public uint LogicalContainerId;
}
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct CLS_ARCHIVE_DESCRIPTOR
{
public ulong coffLow;
public ulong coffHigh;
public CLS_CONTAINER_INFORMATION infoContainer;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLS_CONTAINER_INFORMATION
Public FileAttributes As UInteger
Public CreationTime As ULong
Public LastAccessTime As ULong
Public LastWriteTime As ULong
Public ContainerSize As Long
Public FileNameActualLength As UInteger
Public FileNameLength As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=256)> Public FileName As String
Public State As UInteger
Public PhysicalContainerId As UInteger
Public LogicalContainerId As UInteger
End Structure
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure CLS_ARCHIVE_DESCRIPTOR
Public coffLow As ULong
Public coffHigh As ULong
Public infoContainer As CLS_CONTAINER_INFORMATION
End Structureimport ctypes
from ctypes import wintypes
class CLS_CONTAINER_INFORMATION(ctypes.Structure):
_fields_ = [
("FileAttributes", wintypes.DWORD),
("CreationTime", ctypes.c_ulonglong),
("LastAccessTime", ctypes.c_ulonglong),
("LastWriteTime", ctypes.c_ulonglong),
("ContainerSize", ctypes.c_longlong),
("FileNameActualLength", wintypes.DWORD),
("FileNameLength", wintypes.DWORD),
("FileName", ctypes.c_wchar * 256),
("State", wintypes.DWORD),
("PhysicalContainerId", wintypes.DWORD),
("LogicalContainerId", wintypes.DWORD),
]
class CLS_ARCHIVE_DESCRIPTOR(ctypes.Structure):
_fields_ = [
("coffLow", ctypes.c_ulonglong),
("coffHigh", ctypes.c_ulonglong),
("infoContainer", CLS_CONTAINER_INFORMATION),
]#[repr(C)]
pub struct CLS_CONTAINER_INFORMATION {
pub FileAttributes: u32,
pub CreationTime: u64,
pub LastAccessTime: u64,
pub LastWriteTime: u64,
pub ContainerSize: i64,
pub FileNameActualLength: u32,
pub FileNameLength: u32,
pub FileName: [u16; 256],
pub State: u32,
pub PhysicalContainerId: u32,
pub LogicalContainerId: u32,
}
#[repr(C)]
pub struct CLS_ARCHIVE_DESCRIPTOR {
pub coffLow: u64,
pub coffHigh: u64,
pub infoContainer: CLS_CONTAINER_INFORMATION,
}import "golang.org/x/sys/windows"
type CLS_CONTAINER_INFORMATION struct {
FileAttributes uint32
CreationTime uint64
LastAccessTime uint64
LastWriteTime uint64
ContainerSize int64
FileNameActualLength uint32
FileNameLength uint32
FileName [256]uint16
State uint32
PhysicalContainerId uint32
LogicalContainerId uint32
}
type CLS_ARCHIVE_DESCRIPTOR struct {
coffLow uint64
coffHigh uint64
infoContainer CLS_CONTAINER_INFORMATION
}type
CLS_CONTAINER_INFORMATION = record
FileAttributes: DWORD;
CreationTime: UInt64;
LastAccessTime: UInt64;
LastWriteTime: UInt64;
ContainerSize: Int64;
FileNameActualLength: DWORD;
FileNameLength: DWORD;
FileName: array[0..255] of WideChar;
State: DWORD;
PhysicalContainerId: DWORD;
LogicalContainerId: DWORD;
end;
CLS_ARCHIVE_DESCRIPTOR = record
coffLow: UInt64;
coffHigh: UInt64;
infoContainer: CLS_CONTAINER_INFORMATION;
end;const CLS_CONTAINER_INFORMATION = extern struct {
FileAttributes: u32,
CreationTime: u64,
LastAccessTime: u64,
LastWriteTime: u64,
ContainerSize: i64,
FileNameActualLength: u32,
FileNameLength: u32,
FileName: [256]u16,
State: u32,
PhysicalContainerId: u32,
LogicalContainerId: u32,
};
const CLS_ARCHIVE_DESCRIPTOR = extern struct {
coffLow: u64,
coffHigh: u64,
infoContainer: CLS_CONTAINER_INFORMATION,
};type
CLS_CONTAINER_INFORMATION {.bycopy.} = object
FileAttributes: uint32
CreationTime: uint64
LastAccessTime: uint64
LastWriteTime: uint64
ContainerSize: int64
FileNameActualLength: uint32
FileNameLength: uint32
FileName: array[256, uint16]
State: uint32
PhysicalContainerId: uint32
LogicalContainerId: uint32
CLS_ARCHIVE_DESCRIPTOR {.bycopy.} = object
coffLow: uint64
coffHigh: uint64
infoContainer: CLS_CONTAINER_INFORMATIONstruct CLS_CONTAINER_INFORMATION
{
uint FileAttributes;
ulong CreationTime;
ulong LastAccessTime;
ulong LastWriteTime;
long ContainerSize;
uint FileNameActualLength;
uint FileNameLength;
wchar[256] FileName;
uint State;
uint PhysicalContainerId;
uint LogicalContainerId;
}
struct CLS_ARCHIVE_DESCRIPTOR
{
ulong coffLow;
ulong coffHigh;
CLS_CONTAINER_INFORMATION infoContainer;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; CLS_ARCHIVE_DESCRIPTOR サイズ: 592 バイト(x64)
dim st, 148 ; 4byte整数×148(構造体サイズ 592 / 4 切り上げ)
; coffLow : ULONGLONG (+0, 8byte) qpoke st,0,値 / qpeek(st,0) ※IronHSPのみ。3.7/3.8は lpoke st,0,下位 : lpoke st,4,上位
; coffHigh : ULONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; infoContainer : CLS_CONTAINER_INFORMATION (+16, 576byte) varptr(st)+16 を基点に操作(576byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global CLS_CONTAINER_INFORMATION
#field int FileAttributes
#field int64 CreationTime
#field int64 LastAccessTime
#field int64 LastWriteTime
#field int64 ContainerSize
#field int FileNameActualLength
#field int FileNameLength
#field wchar FileName 256
#field int State
#field int PhysicalContainerId
#field int LogicalContainerId
#endstruct
#defstruct global CLS_ARCHIVE_DESCRIPTOR
#field int64 coffLow
#field int64 coffHigh
#field CLS_CONTAINER_INFORMATION infoContainer
#endstruct
stdim st, CLS_ARCHIVE_DESCRIPTOR ; NSTRUCT 変数を確保
st->coffLow = 100
mes "coffLow=" + st->coffLow