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

BDA_DRM_DRMSTATUS

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

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

フィールド

フィールドサイズx64x86説明
lResultINT4+0+0操作の結果コードを示す。
DRMuuidGUID16+4+4現在のDRMシステムを識別するGUIDを示す。
ulDrmUuidListStringSizeDWORD4+20+20DRM UUIDリスト文字列のサイズをバイト単位で示す。
argbDrmUuidListStringGUID16+24+24サポートするDRMのUUIDリストを格納する配列。

各言語での定義

#include <windows.h>

// BDA_DRM_DRMSTATUS  (x64 40 / x86 40 バイト)
typedef struct BDA_DRM_DRMSTATUS {
    INT lResult;
    GUID DRMuuid;
    DWORD ulDrmUuidListStringSize;
    GUID argbDrmUuidListString[1];
} BDA_DRM_DRMSTATUS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BDA_DRM_DRMSTATUS
{
    public int lResult;
    public Guid DRMuuid;
    public uint ulDrmUuidListStringSize;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public Guid[] argbDrmUuidListString;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BDA_DRM_DRMSTATUS
    Public lResult As Integer
    Public DRMuuid As Guid
    Public ulDrmUuidListStringSize As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public argbDrmUuidListString() As Guid
End Structure
import ctypes
from ctypes import wintypes

class BDA_DRM_DRMSTATUS(ctypes.Structure):
    _fields_ = [
        ("lResult", ctypes.c_int),
        ("DRMuuid", GUID),
        ("ulDrmUuidListStringSize", wintypes.DWORD),
        ("argbDrmUuidListString", GUID * 1),
    ]
#[repr(C)]
pub struct BDA_DRM_DRMSTATUS {
    pub lResult: i32,
    pub DRMuuid: GUID,
    pub ulDrmUuidListStringSize: u32,
    pub argbDrmUuidListString: [GUID; 1],
}
import "golang.org/x/sys/windows"

type BDA_DRM_DRMSTATUS struct {
	lResult int32
	DRMuuid windows.GUID
	ulDrmUuidListStringSize uint32
	argbDrmUuidListString [1]windows.GUID
}
type
  BDA_DRM_DRMSTATUS = record
    lResult: Integer;
    DRMuuid: TGUID;
    ulDrmUuidListStringSize: DWORD;
    argbDrmUuidListString: array[0..0] of TGUID;
  end;
const BDA_DRM_DRMSTATUS = extern struct {
    lResult: i32,
    DRMuuid: GUID,
    ulDrmUuidListStringSize: u32,
    argbDrmUuidListString: [1]GUID,
};
type
  BDA_DRM_DRMSTATUS {.bycopy.} = object
    lResult: int32
    DRMuuid: GUID
    ulDrmUuidListStringSize: uint32
    argbDrmUuidListString: array[1, GUID]
struct BDA_DRM_DRMSTATUS
{
    int lResult;
    GUID DRMuuid;
    uint ulDrmUuidListStringSize;
    GUID[1] argbDrmUuidListString;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; BDA_DRM_DRMSTATUS サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; lResult : INT (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; DRMuuid : GUID (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; ulDrmUuidListStringSize : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; argbDrmUuidListString : GUID (+24, 16byte)  varptr(st)+24 を基点に操作(16byte:入れ子/配列)
; ※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 BDA_DRM_DRMSTATUS
    #field int lResult
    #field GUID DRMuuid
    #field int ulDrmUuidListStringSize
    #field GUID argbDrmUuidListString 1
#endstruct

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