ホーム › Media.DirectShow › BDA_ISDBCAS_REQUESTHEADER
BDA_ISDBCAS_REQUESTHEADER
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| bInstruction | BYTE | 1 | +0 | +0 | ISDB-CASへ送る命令(インストラクション)コード。 |
| bReserved | BYTE | 3 | +1 | +1 | 予約フィールド。将来の拡張用で通常は0。 |
| ulDataLength | DWORD | 4 | +4 | +4 | 後続のISDBコマンドデータのバイト長。 |
| argbIsdbCommand | BYTE | 1 | +8 | +8 | 可変長のISDB-CASコマンドデータ配列。先頭1バイトを起点とする。 |
各言語での定義
#include <windows.h>
// BDA_ISDBCAS_REQUESTHEADER (x64 9 / x86 9 バイト)
#pragma pack(push, 1)
typedef struct BDA_ISDBCAS_REQUESTHEADER {
BYTE bInstruction;
BYTE bReserved[3];
DWORD ulDataLength;
BYTE argbIsdbCommand[1];
} BDA_ISDBCAS_REQUESTHEADER;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct BDA_ISDBCAS_REQUESTHEADER
{
public byte bInstruction;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public byte[] bReserved;
public uint ulDataLength;
[MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public byte[] argbIsdbCommand;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure BDA_ISDBCAS_REQUESTHEADER
Public bInstruction As Byte
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public bReserved() As Byte
Public ulDataLength As UInteger
<MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public argbIsdbCommand() As Byte
End Structureimport ctypes
from ctypes import wintypes
class BDA_ISDBCAS_REQUESTHEADER(ctypes.Structure):
_pack_ = 1
_fields_ = [
("bInstruction", ctypes.c_ubyte),
("bReserved", ctypes.c_ubyte * 3),
("ulDataLength", wintypes.DWORD),
("argbIsdbCommand", ctypes.c_ubyte * 1),
]#[repr(C, packed(1))]
pub struct BDA_ISDBCAS_REQUESTHEADER {
pub bInstruction: u8,
pub bReserved: [u8; 3],
pub ulDataLength: u32,
pub argbIsdbCommand: [u8; 1],
}import "golang.org/x/sys/windows"
type BDA_ISDBCAS_REQUESTHEADER struct {
bInstruction byte
bReserved [3]byte
ulDataLength uint32
argbIsdbCommand [1]byte
}type
BDA_ISDBCAS_REQUESTHEADER = packed record
bInstruction: Byte;
bReserved: array[0..2] of Byte;
ulDataLength: DWORD;
argbIsdbCommand: array[0..0] of Byte;
end;const BDA_ISDBCAS_REQUESTHEADER = extern struct {
bInstruction: u8,
bReserved: [3]u8,
ulDataLength: u32,
argbIsdbCommand: [1]u8,
};type
BDA_ISDBCAS_REQUESTHEADER {.packed.} = object
bInstruction: uint8
bReserved: array[3, uint8]
ulDataLength: uint32
argbIsdbCommand: array[1, uint8]align(1)
struct BDA_ISDBCAS_REQUESTHEADER
{
ubyte bInstruction;
ubyte[3] bReserved;
uint ulDataLength;
ubyte[1] argbIsdbCommand;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; BDA_ISDBCAS_REQUESTHEADER サイズ: 9 バイト(x64)
dim st, 3 ; 4byte整数×3(構造体サイズ 9 / 4 切り上げ)
; bInstruction : BYTE (+0, 1byte) poke st,0,値 / 値 = peek(st,0)
; bReserved : BYTE (+1, 3byte) varptr(st)+1 を基点に操作(3byte:入れ子/配列)
; ulDataLength : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; argbIsdbCommand : BYTE (+8, 1byte) varptr(st)+8 を基点に操作(1byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global BDA_ISDBCAS_REQUESTHEADER, pack=1
#field byte bInstruction
#field byte bReserved 3
#field int ulDataLength
#field byte argbIsdbCommand 1
#endstruct
stdim st, BDA_ISDBCAS_REQUESTHEADER ; NSTRUCT 変数を確保
st->bInstruction = 100
mes "bInstruction=" + st->bInstruction