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

MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA

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

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

フィールド

フィールドサイズx64x86説明
PrivateDataByteCountDWORD4+0+0ドライバ固有のプライベートデータのバイト数。
MaxHWProtectionDataByteCountDWORD4+4+4格納可能なハードウェア保護データの最大バイト数。
HWProtectionDataByteCountDWORD4+8+8実際に書き込まれたハードウェア保護データのバイト数。
StatusHRESULT4+12+12保護機能実行の結果を示すHRESULT。
TransportTimeInHundredsOfNanosecondsLONGLONG8+16+16データ転送に要した時間を100ナノ秒単位で示す。
ExecutionTimeInHundredsOfNanosecondsLONGLONG8+24+24機能実行に要した時間を100ナノ秒単位で示す。
OutputDataBYTE4+32+32出力データ本体を格納するバイト配列。可変長配列の先頭。

各言語での定義

#include <windows.h>

// MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA  (x64 40 / x86 40 バイト)
typedef struct MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA {
    DWORD PrivateDataByteCount;
    DWORD MaxHWProtectionDataByteCount;
    DWORD HWProtectionDataByteCount;
    HRESULT Status;
    LONGLONG TransportTimeInHundredsOfNanoseconds;
    LONGLONG ExecutionTimeInHundredsOfNanoseconds;
    BYTE OutputData[4];
} MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA
{
    public uint PrivateDataByteCount;
    public uint MaxHWProtectionDataByteCount;
    public uint HWProtectionDataByteCount;
    public int Status;
    public long TransportTimeInHundredsOfNanoseconds;
    public long ExecutionTimeInHundredsOfNanoseconds;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] public byte[] OutputData;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA
    Public PrivateDataByteCount As UInteger
    Public MaxHWProtectionDataByteCount As UInteger
    Public HWProtectionDataByteCount As UInteger
    Public Status As Integer
    Public TransportTimeInHundredsOfNanoseconds As Long
    Public ExecutionTimeInHundredsOfNanoseconds As Long
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=4)> Public OutputData() As Byte
End Structure
import ctypes
from ctypes import wintypes

class MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA(ctypes.Structure):
    _fields_ = [
        ("PrivateDataByteCount", wintypes.DWORD),
        ("MaxHWProtectionDataByteCount", wintypes.DWORD),
        ("HWProtectionDataByteCount", wintypes.DWORD),
        ("Status", ctypes.c_int),
        ("TransportTimeInHundredsOfNanoseconds", ctypes.c_longlong),
        ("ExecutionTimeInHundredsOfNanoseconds", ctypes.c_longlong),
        ("OutputData", ctypes.c_ubyte * 4),
    ]
#[repr(C)]
pub struct MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA {
    pub PrivateDataByteCount: u32,
    pub MaxHWProtectionDataByteCount: u32,
    pub HWProtectionDataByteCount: u32,
    pub Status: i32,
    pub TransportTimeInHundredsOfNanoseconds: i64,
    pub ExecutionTimeInHundredsOfNanoseconds: i64,
    pub OutputData: [u8; 4],
}
import "golang.org/x/sys/windows"

type MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA struct {
	PrivateDataByteCount uint32
	MaxHWProtectionDataByteCount uint32
	HWProtectionDataByteCount uint32
	Status int32
	TransportTimeInHundredsOfNanoseconds int64
	ExecutionTimeInHundredsOfNanoseconds int64
	OutputData [4]byte
}
type
  MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA = record
    PrivateDataByteCount: DWORD;
    MaxHWProtectionDataByteCount: DWORD;
    HWProtectionDataByteCount: DWORD;
    Status: Integer;
    TransportTimeInHundredsOfNanoseconds: Int64;
    ExecutionTimeInHundredsOfNanoseconds: Int64;
    OutputData: array[0..3] of Byte;
  end;
const MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA = extern struct {
    PrivateDataByteCount: u32,
    MaxHWProtectionDataByteCount: u32,
    HWProtectionDataByteCount: u32,
    Status: i32,
    TransportTimeInHundredsOfNanoseconds: i64,
    ExecutionTimeInHundredsOfNanoseconds: i64,
    OutputData: [4]u8,
};
type
  MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA {.bycopy.} = object
    PrivateDataByteCount: uint32
    MaxHWProtectionDataByteCount: uint32
    HWProtectionDataByteCount: uint32
    Status: int32
    TransportTimeInHundredsOfNanoseconds: int64
    ExecutionTimeInHundredsOfNanoseconds: int64
    OutputData: array[4, uint8]
struct MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA
{
    uint PrivateDataByteCount;
    uint MaxHWProtectionDataByteCount;
    uint HWProtectionDataByteCount;
    int Status;
    long TransportTimeInHundredsOfNanoseconds;
    long ExecutionTimeInHundredsOfNanoseconds;
    ubyte[4] OutputData;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; PrivateDataByteCount : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; MaxHWProtectionDataByteCount : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; HWProtectionDataByteCount : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; Status : HRESULT (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; TransportTimeInHundredsOfNanoseconds : LONGLONG (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; ExecutionTimeInHundredsOfNanoseconds : LONGLONG (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; OutputData : BYTE (+32, 4byte)  varptr(st)+32 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global MFCONTENTPROTECTIONDEVICE_OUTPUT_DATA
    #field int PrivateDataByteCount
    #field int MaxHWProtectionDataByteCount
    #field int HWProtectionDataByteCount
    #field int Status
    #field int64 TransportTimeInHundredsOfNanoseconds
    #field int64 ExecutionTimeInHundredsOfNanoseconds
    #field byte OutputData 4
#endstruct

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