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

DVD_STRUCTURE_LIST_ENTRY

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

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

フィールド

フィールドサイズx64x86説明
FormatCodeBYTE1+0+0構造体フォーマットコードを示す1バイト値。
_bitfieldBYTE1+1+1読み取り可否や書き込み可否等のフラグを格納するビットフィールド。
FormatLengthBYTE2+2+2当該フォーマット構造の長さをバイト配列で示す。

各言語での定義

#include <windows.h>

// DVD_STRUCTURE_LIST_ENTRY  (x64 4 / x86 4 バイト)
typedef struct DVD_STRUCTURE_LIST_ENTRY {
    BYTE FormatCode;
    BYTE _bitfield;
    BYTE FormatLength[2];
} DVD_STRUCTURE_LIST_ENTRY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DVD_STRUCTURE_LIST_ENTRY
{
    public byte FormatCode;
    public byte _bitfield;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2)] public byte[] FormatLength;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DVD_STRUCTURE_LIST_ENTRY
    Public FormatCode As Byte
    Public _bitfield As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2)> Public FormatLength() As Byte
End Structure
import ctypes
from ctypes import wintypes

class DVD_STRUCTURE_LIST_ENTRY(ctypes.Structure):
    _fields_ = [
        ("FormatCode", ctypes.c_ubyte),
        ("_bitfield", ctypes.c_ubyte),
        ("FormatLength", ctypes.c_ubyte * 2),
    ]
#[repr(C)]
pub struct DVD_STRUCTURE_LIST_ENTRY {
    pub FormatCode: u8,
    pub _bitfield: u8,
    pub FormatLength: [u8; 2],
}
import "golang.org/x/sys/windows"

type DVD_STRUCTURE_LIST_ENTRY struct {
	FormatCode byte
	_bitfield byte
	FormatLength [2]byte
}
type
  DVD_STRUCTURE_LIST_ENTRY = record
    FormatCode: Byte;
    _bitfield: Byte;
    FormatLength: array[0..1] of Byte;
  end;
const DVD_STRUCTURE_LIST_ENTRY = extern struct {
    FormatCode: u8,
    _bitfield: u8,
    FormatLength: [2]u8,
};
type
  DVD_STRUCTURE_LIST_ENTRY {.bycopy.} = object
    FormatCode: uint8
    _bitfield: uint8
    FormatLength: array[2, uint8]
struct DVD_STRUCTURE_LIST_ENTRY
{
    ubyte FormatCode;
    ubyte _bitfield;
    ubyte[2] FormatLength;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DVD_STRUCTURE_LIST_ENTRY サイズ: 4 バイト(x64)
dim st, 1    ; 4byte整数×1(構造体サイズ 4 / 4 切り上げ)
; FormatCode : BYTE (+0, 1byte)  poke st,0,値  /  値 = peek(st,0)
; _bitfield : BYTE (+1, 1byte)  poke st,1,値  /  値 = peek(st,1)
; FormatLength : BYTE (+2, 2byte)  varptr(st)+2 を基点に操作(2byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DVD_STRUCTURE_LIST_ENTRY
    #field byte FormatCode
    #field byte _bitfield
    #field byte FormatLength 2
#endstruct

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