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

DVD_COPYRIGHT_DESCRIPTOR

構造体
サイズx64: 4 バイト / x86: 4 バイトパッキング1

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

フィールド

フィールドサイズx64x86説明
CopyrightProtectionTypeBYTE1+0+0著作権保護方式の種別を示す1バイト値。CSS等を表す。
RegionManagementInformationBYTE1+1+1リージョン管理情報(再生可能地域)を示す1バイト値。
ReservedWORD2+2+2予約領域。将来の拡張用で通常は0。

各言語での定義

#include <windows.h>

// DVD_COPYRIGHT_DESCRIPTOR  (x64 4 / x86 4 バイト)
#pragma pack(push, 1)
typedef struct DVD_COPYRIGHT_DESCRIPTOR {
    BYTE CopyrightProtectionType;
    BYTE RegionManagementInformation;
    WORD Reserved;
} DVD_COPYRIGHT_DESCRIPTOR;
#pragma pack(pop)
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct DVD_COPYRIGHT_DESCRIPTOR
{
    public byte CopyrightProtectionType;
    public byte RegionManagementInformation;
    public ushort Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure DVD_COPYRIGHT_DESCRIPTOR
    Public CopyrightProtectionType As Byte
    Public RegionManagementInformation As Byte
    Public Reserved As UShort
End Structure
import ctypes
from ctypes import wintypes

class DVD_COPYRIGHT_DESCRIPTOR(ctypes.Structure):
    _pack_ = 1
    _fields_ = [
        ("CopyrightProtectionType", ctypes.c_ubyte),
        ("RegionManagementInformation", ctypes.c_ubyte),
        ("Reserved", ctypes.c_ushort),
    ]
#[repr(C, packed(1))]
pub struct DVD_COPYRIGHT_DESCRIPTOR {
    pub CopyrightProtectionType: u8,
    pub RegionManagementInformation: u8,
    pub Reserved: u16,
}
import "golang.org/x/sys/windows"

type DVD_COPYRIGHT_DESCRIPTOR struct {
	CopyrightProtectionType byte
	RegionManagementInformation byte
	Reserved uint16
}
type
  DVD_COPYRIGHT_DESCRIPTOR = packed record
    CopyrightProtectionType: Byte;
    RegionManagementInformation: Byte;
    Reserved: Word;
  end;
const DVD_COPYRIGHT_DESCRIPTOR = extern struct {
    CopyrightProtectionType: u8,
    RegionManagementInformation: u8,
    Reserved: u16,
};
type
  DVD_COPYRIGHT_DESCRIPTOR {.packed.} = object
    CopyrightProtectionType: uint8
    RegionManagementInformation: uint8
    Reserved: uint16
align(1)
struct DVD_COPYRIGHT_DESCRIPTOR
{
    ubyte CopyrightProtectionType;
    ubyte RegionManagementInformation;
    ushort Reserved;
}

HSP用 定義

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

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

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