Win32 API 日本語リファレンス
ホームMedia.KernelStreaming › KS_DVDCOPY_BUSKEY

KS_DVDCOPY_BUSKEY

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

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

フィールド

フィールドサイズx64x86説明
BusKeyBYTE5+0+0DVD CSS認証のバスキーを格納するバイト配列である。
ReservedBYTE1+5+5予約バイト配列で、0を設定する。

各言語での定義

#include <windows.h>

// KS_DVDCOPY_BUSKEY  (x64 6 / x86 6 バイト)
typedef struct KS_DVDCOPY_BUSKEY {
    BYTE BusKey[5];
    BYTE Reserved[1];
} KS_DVDCOPY_BUSKEY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KS_DVDCOPY_BUSKEY
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 5)] public byte[] BusKey;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KS_DVDCOPY_BUSKEY
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=5)> Public BusKey() As Byte
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public Reserved() As Byte
End Structure
import ctypes
from ctypes import wintypes

class KS_DVDCOPY_BUSKEY(ctypes.Structure):
    _fields_ = [
        ("BusKey", ctypes.c_ubyte * 5),
        ("Reserved", ctypes.c_ubyte * 1),
    ]
#[repr(C)]
pub struct KS_DVDCOPY_BUSKEY {
    pub BusKey: [u8; 5],
    pub Reserved: [u8; 1],
}
import "golang.org/x/sys/windows"

type KS_DVDCOPY_BUSKEY struct {
	BusKey [5]byte
	Reserved [1]byte
}
type
  KS_DVDCOPY_BUSKEY = record
    BusKey: array[0..4] of Byte;
    Reserved: array[0..0] of Byte;
  end;
const KS_DVDCOPY_BUSKEY = extern struct {
    BusKey: [5]u8,
    Reserved: [1]u8,
};
type
  KS_DVDCOPY_BUSKEY {.bycopy.} = object
    BusKey: array[5, uint8]
    Reserved: array[1, uint8]
struct KS_DVDCOPY_BUSKEY
{
    ubyte[5] BusKey;
    ubyte[1] Reserved;
}

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_BUSKEY サイズ: 6 バイト(x64)
dim st, 2    ; 4byte整数×2(構造体サイズ 6 / 4 切り上げ)
; BusKey : BYTE (+0, 5byte)  varptr(st)+0 を基点に操作(5byte:入れ子/配列)
; Reserved : BYTE (+5, 1byte)  varptr(st)+5 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KS_DVDCOPY_BUSKEY
    #field byte BusKey 5
    #field byte Reserved 1
#endstruct

stdim st, KS_DVDCOPY_BUSKEY        ; NSTRUCT 変数を確保