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

BDA_TABLE_SECTION

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

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

フィールド

フィールドサイズx64x86説明
ulPrimarySectionIdDWORD4+0+0テーブルの一次セクション識別子を示す。
ulSecondarySectionIdDWORD4+4+4テーブルの二次セクション識別子を示す。
ulcbSectionLengthDWORD4+8+8セクションデータの長さをバイト単位で示す。
argbSectionDataDWORD4+12+12セクションの生データを格納する可変長配列。

各言語での定義

#include <windows.h>

// BDA_TABLE_SECTION  (x64 16 / x86 16 バイト)
typedef struct BDA_TABLE_SECTION {
    DWORD ulPrimarySectionId;
    DWORD ulSecondarySectionId;
    DWORD ulcbSectionLength;
    DWORD argbSectionData[1];
} BDA_TABLE_SECTION;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct BDA_TABLE_SECTION
{
    public uint ulPrimarySectionId;
    public uint ulSecondarySectionId;
    public uint ulcbSectionLength;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 1)] public uint[] argbSectionData;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure BDA_TABLE_SECTION
    Public ulPrimarySectionId As UInteger
    Public ulSecondarySectionId As UInteger
    Public ulcbSectionLength As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=1)> Public argbSectionData() As UInteger
End Structure
import ctypes
from ctypes import wintypes

class BDA_TABLE_SECTION(ctypes.Structure):
    _fields_ = [
        ("ulPrimarySectionId", wintypes.DWORD),
        ("ulSecondarySectionId", wintypes.DWORD),
        ("ulcbSectionLength", wintypes.DWORD),
        ("argbSectionData", wintypes.DWORD * 1),
    ]
#[repr(C)]
pub struct BDA_TABLE_SECTION {
    pub ulPrimarySectionId: u32,
    pub ulSecondarySectionId: u32,
    pub ulcbSectionLength: u32,
    pub argbSectionData: [u32; 1],
}
import "golang.org/x/sys/windows"

type BDA_TABLE_SECTION struct {
	ulPrimarySectionId uint32
	ulSecondarySectionId uint32
	ulcbSectionLength uint32
	argbSectionData [1]uint32
}
type
  BDA_TABLE_SECTION = record
    ulPrimarySectionId: DWORD;
    ulSecondarySectionId: DWORD;
    ulcbSectionLength: DWORD;
    argbSectionData: array[0..0] of DWORD;
  end;
const BDA_TABLE_SECTION = extern struct {
    ulPrimarySectionId: u32,
    ulSecondarySectionId: u32,
    ulcbSectionLength: u32,
    argbSectionData: [1]u32,
};
type
  BDA_TABLE_SECTION {.bycopy.} = object
    ulPrimarySectionId: uint32
    ulSecondarySectionId: uint32
    ulcbSectionLength: uint32
    argbSectionData: array[1, uint32]
struct BDA_TABLE_SECTION
{
    uint ulPrimarySectionId;
    uint ulSecondarySectionId;
    uint ulcbSectionLength;
    uint[1] argbSectionData;
}

HSP用 定義

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

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

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