ホーム › Media.MediaFoundation › D3DCONTENTPROTECTIONCAPS
D3DCONTENTPROTECTIONCAPS
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 | ||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Caps | DWORD | 4 | +0 | +0 | 0 個以上のフラグのビット単位の OR です。
| ||||||||||||||||||||
| KeyExchangeType | GUID | 16 | +4 | +4 | セッションキーのネゴシエーションに必要なキー交換の種類を指定します。次の GUID が定義されています。
| ||||||||||||||||||||
| BufferAlignmentStart | DWORD | 4 | +20 | +20 | GPU の暗号化エンジンが使用するバッファーに必要なメモリアラインメントです。アプリケーションがシステムメモリのバッファーを使用して暗号化されたコンテンツを GPU に渡す場合、または GPU から暗号化されたコンテンツを読み戻す場合、バッファーの開始アドレスはこの値の倍数でなければなりません。 | ||||||||||||||||||||
| BlockAlignmentSize | DWORD | 4 | +24 | +24 | GPU の暗号化エンジンが必要とするブロックアラインメントです。暗号化するデータのサイズは、この値の倍数でなければなりません。 | ||||||||||||||||||||
| ProtectedMemorySize | ULONGLONG | 8 | +28 | +28 | 保護されたサーフェスを保持するために使用できるメモリの総量です。 |
公式ドキュメント
ディスプレイドライバーのコンテンツ保護機能について説明します。この機能を取得するには、IDirect3DDevice9Video::GetContentProtectionCaps を呼び出します。
出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)
各言語での定義
#include <windows.h>
// D3DCONTENTPROTECTIONCAPS (x64 36 / x86 36 バイト)
#pragma pack(push, 4)
typedef struct D3DCONTENTPROTECTIONCAPS {
DWORD Caps;
GUID KeyExchangeType;
DWORD BufferAlignmentStart;
DWORD BlockAlignmentSize;
ULONGLONG ProtectedMemorySize;
} D3DCONTENTPROTECTIONCAPS;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 4, CharSet = CharSet.Unicode)]
public struct D3DCONTENTPROTECTIONCAPS
{
public uint Caps;
public Guid KeyExchangeType;
public uint BufferAlignmentStart;
public uint BlockAlignmentSize;
public ulong ProtectedMemorySize;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=4, CharSet:=CharSet.Unicode)>
Public Structure D3DCONTENTPROTECTIONCAPS
Public Caps As UInteger
Public KeyExchangeType As Guid
Public BufferAlignmentStart As UInteger
Public BlockAlignmentSize As UInteger
Public ProtectedMemorySize As ULong
End Structureimport ctypes
from ctypes import wintypes
class D3DCONTENTPROTECTIONCAPS(ctypes.Structure):
_pack_ = 4
_fields_ = [
("Caps", wintypes.DWORD),
("KeyExchangeType", GUID),
("BufferAlignmentStart", wintypes.DWORD),
("BlockAlignmentSize", wintypes.DWORD),
("ProtectedMemorySize", ctypes.c_ulonglong),
]#[repr(C, packed(4))]
pub struct D3DCONTENTPROTECTIONCAPS {
pub Caps: u32,
pub KeyExchangeType: GUID,
pub BufferAlignmentStart: u32,
pub BlockAlignmentSize: u32,
pub ProtectedMemorySize: u64,
}import "golang.org/x/sys/windows"
type D3DCONTENTPROTECTIONCAPS struct {
Caps uint32
KeyExchangeType windows.GUID
BufferAlignmentStart uint32
BlockAlignmentSize uint32
ProtectedMemorySize uint64
}type
D3DCONTENTPROTECTIONCAPS = packed record
Caps: DWORD;
KeyExchangeType: TGUID;
BufferAlignmentStart: DWORD;
BlockAlignmentSize: DWORD;
ProtectedMemorySize: UInt64;
end;const D3DCONTENTPROTECTIONCAPS = extern struct {
Caps: u32,
KeyExchangeType: GUID,
BufferAlignmentStart: u32,
BlockAlignmentSize: u32,
ProtectedMemorySize: u64,
};type
D3DCONTENTPROTECTIONCAPS {.packed.} = object
Caps: uint32
KeyExchangeType: GUID
BufferAlignmentStart: uint32
BlockAlignmentSize: uint32
ProtectedMemorySize: uint64align(4)
struct D3DCONTENTPROTECTIONCAPS
{
uint Caps;
GUID KeyExchangeType;
uint BufferAlignmentStart;
uint BlockAlignmentSize;
ulong ProtectedMemorySize;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; D3DCONTENTPROTECTIONCAPS サイズ: 36 バイト(x64)
dim st, 9 ; 4byte整数×9(構造体サイズ 36 / 4 切り上げ)
; Caps : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; KeyExchangeType : GUID (+4, 16byte) varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; BufferAlignmentStart : DWORD (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; BlockAlignmentSize : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; ProtectedMemorySize : ULONGLONG (+28, 8byte) qpoke st,28,値 / qpeek(st,28) ※IronHSPのみ。3.7/3.8は lpoke st,28,下位 : lpoke st,32,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
#field int Data1
#field short Data2
#field short Data3
#field byte Data4 8
#endstruct
#defstruct global D3DCONTENTPROTECTIONCAPS, pack=4
#field int Caps
#field GUID KeyExchangeType
#field int BufferAlignmentStart
#field int BlockAlignmentSize
#field int64 ProtectedMemorySize
#endstruct
stdim st, D3DCONTENTPROTECTIONCAPS ; NSTRUCT 変数を確保
st->Caps = 100
mes "Caps=" + st->Caps