ホーム › Storage.FileSystem › WIN32_STREAM_ID
WIN32_STREAM_ID
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwStreamId | WIN_STREAM_ID | 4 | +0 | +0 | バックアップストリームの種類(データ/EA/ACL等のWIN_STREAM_ID)。 |
| dwStreamAttributes | DWORD | 4 | +4 | +4 | ストリームの属性を示すビットマスク。 |
| Size | LONGLONG | 8 | +8 | +8 | ストリームデータのバイトサイズ。 |
| dwStreamNameSize | DWORD | 4 | +16 | +16 | cStreamNameのバイト長。 |
| cStreamName | WCHAR | 2 | +20 | +20 | ストリーム名(可変長WCHAR配列)。 |
各言語での定義
#include <windows.h>
// WIN32_STREAM_ID (x64 24 / x86 24 バイト)
typedef struct WIN32_STREAM_ID {
WIN_STREAM_ID dwStreamId;
DWORD dwStreamAttributes;
LONGLONG Size;
DWORD dwStreamNameSize;
WCHAR cStreamName[1];
} WIN32_STREAM_ID;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WIN32_STREAM_ID
{
public uint dwStreamId;
public uint dwStreamAttributes;
public long Size;
public uint dwStreamNameSize;
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 1)] public string cStreamName;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WIN32_STREAM_ID
Public dwStreamId As UInteger
Public dwStreamAttributes As UInteger
Public Size As Long
Public dwStreamNameSize As UInteger
<MarshalAs(UnmanagedType.ByValTStr, SizeConst:=1)> Public cStreamName As String
End Structureimport ctypes
from ctypes import wintypes
class WIN32_STREAM_ID(ctypes.Structure):
_fields_ = [
("dwStreamId", wintypes.DWORD),
("dwStreamAttributes", wintypes.DWORD),
("Size", ctypes.c_longlong),
("dwStreamNameSize", wintypes.DWORD),
("cStreamName", ctypes.c_wchar * 1),
]#[repr(C)]
pub struct WIN32_STREAM_ID {
pub dwStreamId: u32,
pub dwStreamAttributes: u32,
pub Size: i64,
pub dwStreamNameSize: u32,
pub cStreamName: [u16; 1],
}import "golang.org/x/sys/windows"
type WIN32_STREAM_ID struct {
dwStreamId uint32
dwStreamAttributes uint32
Size int64
dwStreamNameSize uint32
cStreamName [1]uint16
}type
WIN32_STREAM_ID = record
dwStreamId: DWORD;
dwStreamAttributes: DWORD;
Size: Int64;
dwStreamNameSize: DWORD;
cStreamName: array[0..0] of WideChar;
end;const WIN32_STREAM_ID = extern struct {
dwStreamId: u32,
dwStreamAttributes: u32,
Size: i64,
dwStreamNameSize: u32,
cStreamName: [1]u16,
};type
WIN32_STREAM_ID {.bycopy.} = object
dwStreamId: uint32
dwStreamAttributes: uint32
Size: int64
dwStreamNameSize: uint32
cStreamName: array[1, uint16]struct WIN32_STREAM_ID
{
uint dwStreamId;
uint dwStreamAttributes;
long Size;
uint dwStreamNameSize;
wchar[1] cStreamName;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; WIN32_STREAM_ID サイズ: 24 バイト(x64)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; dwStreamId : WIN_STREAM_ID (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwStreamAttributes : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; Size : LONGLONG (+8, 8byte) qpoke st,8,値 / qpeek(st,8) ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; dwStreamNameSize : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; cStreamName : WCHAR (+20, 2byte) varptr(st)+20 を基点に操作(2byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global WIN32_STREAM_ID
#field int dwStreamId
#field int dwStreamAttributes
#field int64 Size
#field int dwStreamNameSize
#field wchar cStreamName 1
#endstruct
stdim st, WIN32_STREAM_ID ; NSTRUCT 変数を確保
st->dwStreamId = 100
mes "dwStreamId=" + st->dwStreamId