ホーム › Media.DirectShow.Tv › DSMCC_ELEMENT
DSMCC_ELEMENT
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| pid | WORD | 2 | +0 | +0 | DSM-CC要素のパケット識別子(PID)。 |
| bComponentTag | BYTE | 1 | +2 | +2 | コンポーネントタグ。サービス内要素を識別する。 |
| dwCarouselId | DWORD | 4 | +3 | +3 | データカルーセルを識別するID。 |
| dwTransactionId | DWORD | 4 | +7 | +7 | DSM-CCトランザクションID。 |
| pNext | DSMCC_ELEMENT* | 8/4 | +11 | +11 | 次のDSMCC_ELEMENTへのポインタ。連結リストを形成する。 |
各言語での定義
#include <windows.h>
// DSMCC_ELEMENT (x64 19 / x86 15 バイト)
#pragma pack(push, 1)
typedef struct DSMCC_ELEMENT {
WORD pid;
BYTE bComponentTag;
DWORD dwCarouselId;
DWORD dwTransactionId;
DSMCC_ELEMENT* pNext;
} DSMCC_ELEMENT;
#pragma pack(pop)using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, Pack = 1, CharSet = CharSet.Unicode)]
public struct DSMCC_ELEMENT
{
public ushort pid;
public byte bComponentTag;
public uint dwCarouselId;
public uint dwTransactionId;
public IntPtr pNext;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, Pack:=1, CharSet:=CharSet.Unicode)>
Public Structure DSMCC_ELEMENT
Public pid As UShort
Public bComponentTag As Byte
Public dwCarouselId As UInteger
Public dwTransactionId As UInteger
Public pNext As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DSMCC_ELEMENT(ctypes.Structure):
_pack_ = 1
_fields_ = [
("pid", ctypes.c_ushort),
("bComponentTag", ctypes.c_ubyte),
("dwCarouselId", wintypes.DWORD),
("dwTransactionId", wintypes.DWORD),
("pNext", ctypes.c_void_p),
]#[repr(C, packed(1))]
pub struct DSMCC_ELEMENT {
pub pid: u16,
pub bComponentTag: u8,
pub dwCarouselId: u32,
pub dwTransactionId: u32,
pub pNext: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DSMCC_ELEMENT struct {
pid uint16
bComponentTag byte
dwCarouselId uint32
dwTransactionId uint32
pNext uintptr
}type
DSMCC_ELEMENT = packed record
pid: Word;
bComponentTag: Byte;
dwCarouselId: DWORD;
dwTransactionId: DWORD;
pNext: Pointer;
end;const DSMCC_ELEMENT = extern struct {
pid: u16,
bComponentTag: u8,
dwCarouselId: u32,
dwTransactionId: u32,
pNext: ?*anyopaque,
};type
DSMCC_ELEMENT {.packed.} = object
pid: uint16
bComponentTag: uint8
dwCarouselId: uint32
dwTransactionId: uint32
pNext: pointeralign(1)
struct DSMCC_ELEMENT
{
ushort pid;
ubyte bComponentTag;
uint dwCarouselId;
uint dwTransactionId;
void* pNext;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DSMCC_ELEMENT サイズ: 15 バイト(x86)
dim st, 4 ; 4byte整数×4(構造体サイズ 15 / 4 切り上げ)
; pid : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; bComponentTag : BYTE (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; dwCarouselId : DWORD (+3, 4byte) lpoke st,3,値 / 値 = lpeek(st,3)
; dwTransactionId : DWORD (+7, 4byte) lpoke st,7,値 / 値 = lpeek(st,7)
; pNext : DSMCC_ELEMENT* (+11, 4byte) varptr(st)+11 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DSMCC_ELEMENT サイズ: 19 バイト(x64)
dim st, 5 ; 4byte整数×5(構造体サイズ 19 / 4 切り上げ)
; pid : WORD (+0, 2byte) wpoke st,0,値 / 値 = wpeek(st,0)
; bComponentTag : BYTE (+2, 1byte) poke st,2,値 / 値 = peek(st,2)
; dwCarouselId : DWORD (+3, 4byte) lpoke st,3,値 / 値 = lpeek(st,3)
; dwTransactionId : DWORD (+7, 4byte) lpoke st,7,値 / 値 = lpeek(st,7)
; pNext : DSMCC_ELEMENT* (+11, 8byte) varptr(st)+11 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DSMCC_ELEMENT, pack=1
#field short pid
#field byte bComponentTag
#field int dwCarouselId
#field int dwTransactionId
#field intptr pNext
#endstruct
stdim st, DSMCC_ELEMENT ; NSTRUCT 変数を確保
st->pid = 100
mes "pid=" + st->pid