ホーム › Devices.Dvd › DVD_DISC_CONTROL_BLOCK_HEADER
DVD_DISC_CONTROL_BLOCK_HEADER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| ContentDescriptor | BYTE | 4 | +0 | +0 | DCBの内容種別を示すコンテンツディスクリプタのバイト配列。 |
| ProhibitedActions | _ProhibitedActions_e__Union | 8/4 | +8 | +4 | 禁止されている操作を示す無名共用体。 |
| VendorId | BYTE | 32 | +16 | +8 | ベンダ識別子を示すバイト配列。 |
共用体: _ProhibitedActions_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| Anonymous | _Anonymous_e__Struct | 8/4 | +0 | +0 |
| AsByte | BYTE | 4 | +0 | +0 |
各言語での定義
#include <windows.h>
// DVD_DISC_CONTROL_BLOCK_HEADER (x64 48 / x86 40 バイト)
typedef struct DVD_DISC_CONTROL_BLOCK_HEADER {
BYTE ContentDescriptor[4];
_ProhibitedActions_e__Union ProhibitedActions;
BYTE VendorId[32];
} DVD_DISC_CONTROL_BLOCK_HEADER;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DVD_DISC_CONTROL_BLOCK_HEADER
{
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] ContentDescriptor;
public _ProhibitedActions_e__Union ProhibitedActions;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 32)] public byte[] VendorId;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DVD_DISC_CONTROL_BLOCK_HEADER
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public ContentDescriptor() As Byte
Public ProhibitedActions As _ProhibitedActions_e__Union
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=32)> Public VendorId() As Byte
End Structureimport ctypes
from ctypes import wintypes
class DVD_DISC_CONTROL_BLOCK_HEADER(ctypes.Structure):
_fields_ = [
("ContentDescriptor", ctypes.c_ubyte * 4),
("ProhibitedActions", _ProhibitedActions_e__Union),
("VendorId", ctypes.c_ubyte * 32),
]#[repr(C)]
pub struct DVD_DISC_CONTROL_BLOCK_HEADER {
pub ContentDescriptor: [u8; 4],
pub ProhibitedActions: _ProhibitedActions_e__Union,
pub VendorId: [u8; 32],
}import "golang.org/x/sys/windows"
type DVD_DISC_CONTROL_BLOCK_HEADER struct {
ContentDescriptor [4]byte
ProhibitedActions _ProhibitedActions_e__Union
VendorId [32]byte
}type
DVD_DISC_CONTROL_BLOCK_HEADER = record
ContentDescriptor: array[0..3] of Byte;
ProhibitedActions: _ProhibitedActions_e__Union;
VendorId: array[0..31] of Byte;
end;const DVD_DISC_CONTROL_BLOCK_HEADER = extern struct {
ContentDescriptor: [4]u8,
ProhibitedActions: _ProhibitedActions_e__Union,
VendorId: [32]u8,
};type
DVD_DISC_CONTROL_BLOCK_HEADER {.bycopy.} = object
ContentDescriptor: array[4, uint8]
ProhibitedActions: _ProhibitedActions_e__Union
VendorId: array[32, uint8]struct DVD_DISC_CONTROL_BLOCK_HEADER
{
ubyte[4] ContentDescriptor;
_ProhibitedActions_e__Union ProhibitedActions;
ubyte[32] VendorId;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DVD_DISC_CONTROL_BLOCK_HEADER サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; ContentDescriptor : BYTE (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; ProhibitedActions : _ProhibitedActions_e__Union (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; VendorId : BYTE (+8, 32byte) varptr(st)+8 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DVD_DISC_CONTROL_BLOCK_HEADER サイズ: 48 バイト(x64)
dim st, 12 ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; ContentDescriptor : BYTE (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; ProhibitedActions : _ProhibitedActions_e__Union (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; VendorId : BYTE (+16, 32byte) varptr(st)+16 を基点に操作(32byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DVD_DISC_CONTROL_BLOCK_HEADER
#field byte ContentDescriptor 4
#field byte ProhibitedActions 8
#field byte VendorId 32
#endstruct
stdim st, DVD_DISC_CONTROL_BLOCK_HEADER ; NSTRUCT 変数を確保
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。