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