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

AM_DVDCOPY_DISCKEY

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

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

フィールド

フィールドサイズx64x86説明
DiscKeyBYTE2048+0+0DVDのディスクキー配列。CSS復号に用いる鍵情報。

各言語での定義

#include <windows.h>

// AM_DVDCOPY_DISCKEY  (x64 2048 / x86 2048 バイト)
typedef struct AM_DVDCOPY_DISCKEY {
    BYTE DiscKey[2048];
} AM_DVDCOPY_DISCKEY;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct AM_DVDCOPY_DISCKEY
{
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 2048)] public byte[] DiscKey;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure AM_DVDCOPY_DISCKEY
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=2048)> Public DiscKey() As Byte
End Structure
import ctypes
from ctypes import wintypes

class AM_DVDCOPY_DISCKEY(ctypes.Structure):
    _fields_ = [
        ("DiscKey", ctypes.c_ubyte * 2048),
    ]
#[repr(C)]
pub struct AM_DVDCOPY_DISCKEY {
    pub DiscKey: [u8; 2048],
}
import "golang.org/x/sys/windows"

type AM_DVDCOPY_DISCKEY struct {
	DiscKey [2048]byte
}
type
  AM_DVDCOPY_DISCKEY = record
    DiscKey: array[0..2047] of Byte;
  end;
const AM_DVDCOPY_DISCKEY = extern struct {
    DiscKey: [2048]u8,
};
type
  AM_DVDCOPY_DISCKEY {.bycopy.} = object
    DiscKey: array[2048, uint8]
struct AM_DVDCOPY_DISCKEY
{
    ubyte[2048] DiscKey;
}

HSP用 定義

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

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

stdim st, AM_DVDCOPY_DISCKEY        ; NSTRUCT 変数を確保