Win32 API 日本語リファレンス
ホームGraphics.Imaging › WICMetadataHeader

WICMetadataHeader

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

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

フィールド

フィールドサイズx64x86説明
PositionULONGLONG8+0+0メタデータヘッダを書き込むストリーム内の位置(バイトオフセット)。
LengthDWORD4+8+8Headerが指すヘッダデータのバイト長。
HeaderBYTE*8/4+16+12メタデータブロックのヘッダバイト列へのポインタ。
DataOffsetULONGLONG8+24+16ヘッダに続くメタデータ本体のバイトオフセット。

各言語での定義

#include <windows.h>

// WICMetadataHeader  (x64 32 / x86 24 バイト)
typedef struct WICMetadataHeader {
    ULONGLONG Position;
    DWORD Length;
    BYTE* Header;
    ULONGLONG DataOffset;
} WICMetadataHeader;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct WICMetadataHeader
{
    public ulong Position;
    public uint Length;
    public IntPtr Header;
    public ulong DataOffset;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure WICMetadataHeader
    Public Position As ULong
    Public Length As UInteger
    Public Header As IntPtr
    Public DataOffset As ULong
End Structure
import ctypes
from ctypes import wintypes

class WICMetadataHeader(ctypes.Structure):
    _fields_ = [
        ("Position", ctypes.c_ulonglong),
        ("Length", wintypes.DWORD),
        ("Header", ctypes.c_void_p),
        ("DataOffset", ctypes.c_ulonglong),
    ]
#[repr(C)]
pub struct WICMetadataHeader {
    pub Position: u64,
    pub Length: u32,
    pub Header: *mut core::ffi::c_void,
    pub DataOffset: u64,
}
import "golang.org/x/sys/windows"

type WICMetadataHeader struct {
	Position uint64
	Length uint32
	Header uintptr
	DataOffset uint64
}
type
  WICMetadataHeader = record
    Position: UInt64;
    Length: DWORD;
    Header: Pointer;
    DataOffset: UInt64;
  end;
const WICMetadataHeader = extern struct {
    Position: u64,
    Length: u32,
    Header: ?*anyopaque,
    DataOffset: u64,
};
type
  WICMetadataHeader {.bycopy.} = object
    Position: uint64
    Length: uint32
    Header: pointer
    DataOffset: uint64
struct WICMetadataHeader
{
    ulong Position;
    uint Length;
    void* Header;
    ulong DataOffset;
}

HSP用 定義

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

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

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