ホーム › Devices.Dvd › DVD_REGION
DVD_REGION
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| CopySystem | BYTE | 1 | +0 | +0 | ディスクのコピー保護システム種別を示す1バイト値。 |
| RegionData | BYTE | 1 | +1 | +1 | ディスクのリージョンデータを示す1バイト値。 |
| SystemRegion | BYTE | 1 | +2 | +2 | ドライブの現在のシステムリージョン設定を示す1バイト値。 |
| ResetCount | BYTE | 1 | +3 | +3 | リージョン設定の残り変更可能回数を示す1バイト値。 |
各言語での定義
#include <windows.h>
// DVD_REGION (x64 4 / x86 4 バイト)
typedef struct DVD_REGION {
BYTE CopySystem;
BYTE RegionData;
BYTE SystemRegion;
BYTE ResetCount;
} DVD_REGION;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DVD_REGION
{
public byte CopySystem;
public byte RegionData;
public byte SystemRegion;
public byte ResetCount;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DVD_REGION
Public CopySystem As Byte
Public RegionData As Byte
Public SystemRegion As Byte
Public ResetCount As Byte
End Structureimport ctypes
from ctypes import wintypes
class DVD_REGION(ctypes.Structure):
_fields_ = [
("CopySystem", ctypes.c_ubyte),
("RegionData", ctypes.c_ubyte),
("SystemRegion", ctypes.c_ubyte),
("ResetCount", ctypes.c_ubyte),
]#[repr(C)]
pub struct DVD_REGION {
pub CopySystem: u8,
pub RegionData: u8,
pub SystemRegion: u8,
pub ResetCount: u8,
}import "golang.org/x/sys/windows"
type DVD_REGION struct {
CopySystem byte
RegionData byte
SystemRegion byte
ResetCount byte
}type
DVD_REGION = record
CopySystem: Byte;
RegionData: Byte;
SystemRegion: Byte;
ResetCount: Byte;
end;const DVD_REGION = extern struct {
CopySystem: u8,
RegionData: u8,
SystemRegion: u8,
ResetCount: u8,
};type
DVD_REGION {.bycopy.} = object
CopySystem: uint8
RegionData: uint8
SystemRegion: uint8
ResetCount: uint8struct DVD_REGION
{
ubyte CopySystem;
ubyte RegionData;
ubyte SystemRegion;
ubyte ResetCount;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DVD_REGION サイズ: 4 バイト(x64)
dim st, 1 ; 4byte整数×1(構造体サイズ 4 / 4 切り上げ)
; CopySystem : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; RegionData : BYTE (+1, 1byte) poke st,1,値 / 値 = peek(st,1)
; SystemRegion : BYTE (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; ResetCount : BYTE (+3, 1byte) poke st,3,値 / 値 = peek(st,3)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DVD_REGION
#field byte CopySystem
#field byte RegionData
#field byte SystemRegion
#field byte ResetCount
#endstruct
stdim st, DVD_REGION ; NSTRUCT 変数を確保
st->CopySystem = 100
mes "CopySystem=" + st->CopySystem