Win32 API 日本語リファレンス
ホームDevices.Dvd › DVD_FULL_LAYER_DESCRIPTOR

DVD_FULL_LAYER_DESCRIPTOR

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

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

フィールド

フィールドサイズx64x86説明
commonHeaderDVD_LAYER_DESCRIPTOR17+0+0レイヤ記述の共通ヘッダ部分を保持するDVD_LAYER_DESCRIPTOR。
MediaSpecificBYTE2031+17+17メディア固有の追加情報を保持するバイト配列。

各言語での定義

#include <windows.h>

// DVD_LAYER_DESCRIPTOR  (x64 17 / x86 17 バイト)
#pragma pack(push, 1)
typedef struct DVD_LAYER_DESCRIPTOR {
    BYTE _bitfield1;
    BYTE _bitfield2;
    BYTE _bitfield3;
    BYTE _bitfield4;
    DWORD StartingDataSector;
    DWORD EndDataSector;
    DWORD EndLayerZeroSector;
    BYTE _bitfield5;
} DVD_LAYER_DESCRIPTOR;
#pragma pack(pop)

// DVD_FULL_LAYER_DESCRIPTOR  (x64 2048 / x86 2048 バイト)
typedef struct DVD_FULL_LAYER_DESCRIPTOR {
    DVD_LAYER_DESCRIPTOR commonHeader;
    BYTE MediaSpecific[2031];
} DVD_FULL_LAYER_DESCRIPTOR;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct DVD_LAYER_DESCRIPTOR
{
    public byte _bitfield1;
    public byte _bitfield2;
    public byte _bitfield3;
    public byte _bitfield4;
    public uint StartingDataSector;
    public uint EndDataSector;
    public uint EndLayerZeroSector;
    public byte _bitfield5;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DVD_FULL_LAYER_DESCRIPTOR
{
    public DVD_LAYER_DESCRIPTOR commonHeader;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2031)] public byte[] MediaSpecific;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure DVD_LAYER_DESCRIPTOR
    Public _bitfield1 As Byte
    Public _bitfield2 As Byte
    Public _bitfield3 As Byte
    Public _bitfield4 As Byte
    Public StartingDataSector As UInteger
    Public EndDataSector As UInteger
    Public EndLayerZeroSector As UInteger
    Public _bitfield5 As Byte
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DVD_FULL_LAYER_DESCRIPTOR
    Public commonHeader As DVD_LAYER_DESCRIPTOR
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2031)> Public MediaSpecific() As Byte
End Structure
import ctypes
from ctypes import wintypes

class DVD_LAYER_DESCRIPTOR(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("_bitfield1", ctypes.c_ubyte),
        ("_bitfield2", ctypes.c_ubyte),
        ("_bitfield3", ctypes.c_ubyte),
        ("_bitfield4", ctypes.c_ubyte),
        ("StartingDataSector", wintypes.DWORD),
        ("EndDataSector", wintypes.DWORD),
        ("EndLayerZeroSector", wintypes.DWORD),
        ("_bitfield5", ctypes.c_ubyte),
    ]

class DVD_FULL_LAYER_DESCRIPTOR(ctypes.Structure):
    _fields_ = [
        ("commonHeader", DVD_LAYER_DESCRIPTOR),
        ("MediaSpecific", ctypes.c_ubyte * 2031),
    ]
#[repr(C, packed(1))]
pub struct DVD_LAYER_DESCRIPTOR {
    pub _bitfield1: u8,
    pub _bitfield2: u8,
    pub _bitfield3: u8,
    pub _bitfield4: u8,
    pub StartingDataSector: u32,
    pub EndDataSector: u32,
    pub EndLayerZeroSector: u32,
    pub _bitfield5: u8,
}

#[repr(C)]
pub struct DVD_FULL_LAYER_DESCRIPTOR {
    pub commonHeader: DVD_LAYER_DESCRIPTOR,
    pub MediaSpecific: [u8; 2031],
}
import "golang.org/x/sys/windows"

type DVD_LAYER_DESCRIPTOR struct {
	_bitfield1 byte
	_bitfield2 byte
	_bitfield3 byte
	_bitfield4 byte
	StartingDataSector uint32
	EndDataSector uint32
	EndLayerZeroSector uint32
	_bitfield5 byte
}

type DVD_FULL_LAYER_DESCRIPTOR struct {
	commonHeader DVD_LAYER_DESCRIPTOR
	MediaSpecific [2031]byte
}
type
  DVD_LAYER_DESCRIPTOR = packed record
    _bitfield1: Byte;
    _bitfield2: Byte;
    _bitfield3: Byte;
    _bitfield4: Byte;
    StartingDataSector: DWORD;
    EndDataSector: DWORD;
    EndLayerZeroSector: DWORD;
    _bitfield5: Byte;
  end;

  DVD_FULL_LAYER_DESCRIPTOR = record
    commonHeader: DVD_LAYER_DESCRIPTOR;
    MediaSpecific: array[0..2030] of Byte;
  end;
const DVD_LAYER_DESCRIPTOR = extern struct {
    _bitfield1: u8,
    _bitfield2: u8,
    _bitfield3: u8,
    _bitfield4: u8,
    StartingDataSector: u32,
    EndDataSector: u32,
    EndLayerZeroSector: u32,
    _bitfield5: u8,
};

const DVD_FULL_LAYER_DESCRIPTOR = extern struct {
    commonHeader: DVD_LAYER_DESCRIPTOR,
    MediaSpecific: [2031]u8,
};
type
  DVD_LAYER_DESCRIPTOR {.packed.} = object
    _bitfield1: uint8
    _bitfield2: uint8
    _bitfield3: uint8
    _bitfield4: uint8
    StartingDataSector: uint32
    EndDataSector: uint32
    EndLayerZeroSector: uint32
    _bitfield5: uint8

  DVD_FULL_LAYER_DESCRIPTOR {.bycopy.} = object
    commonHeader: DVD_LAYER_DESCRIPTOR
    MediaSpecific: array[2031, uint8]
align(1)
struct DVD_LAYER_DESCRIPTOR
{
    ubyte _bitfield1;
    ubyte _bitfield2;
    ubyte _bitfield3;
    ubyte _bitfield4;
    uint StartingDataSector;
    uint EndDataSector;
    uint EndLayerZeroSector;
    ubyte _bitfield5;
}

struct DVD_FULL_LAYER_DESCRIPTOR
{
    DVD_LAYER_DESCRIPTOR commonHeader;
    ubyte[2031] MediaSpecific;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DVD_FULL_LAYER_DESCRIPTOR サイズ: 2048 バイト(x64)
dim st, 512    ; 4byte整数×512(構造体サイズ 2048 / 4 切り上げ)
; commonHeader : DVD_LAYER_DESCRIPTOR (+0, 17byte)  varptr(st)+0 を基点に操作(17byte:入れ子/配列)
; MediaSpecific : BYTE (+17, 2031byte)  varptr(st)+17 を基点に操作(2031byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DVD_LAYER_DESCRIPTOR, pack=1
    #field byte _bitfield1
    #field byte _bitfield2
    #field byte _bitfield3
    #field byte _bitfield4
    #field int StartingDataSector
    #field int EndDataSector
    #field int EndLayerZeroSector
    #field byte _bitfield5
#endstruct

#defstruct global DVD_FULL_LAYER_DESCRIPTOR
    #field DVD_LAYER_DESCRIPTOR commonHeader
    #field byte MediaSpecific 2031
#endstruct

stdim st, DVD_FULL_LAYER_DESCRIPTOR        ; NSTRUCT 変数を確保