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

KSSTREAM_METADATA_INFO

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

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

フィールド

フィールドサイズx64x86説明
BufferSizeDWORD4+0+0メタデータバッファ全体のバイト容量を示す。
UsedSizeDWORD4+4+4実際に使用されたメタデータのバイト数を示す。
Datavoid*8/4+8+8メタデータバッファへのポインタ。実データ領域を指す。
SystemVavoid*8/4+16+12システム仮想アドレス。カーネル側のバッファ参照を示す。
FlagsDWORD4+24+16メタデータに関するフラグ。属性や状態を示す。
ReservedDWORD4+28+20予約領域。将来拡張用で通常は0とする。

各言語での定義

#include <windows.h>

// KSSTREAM_METADATA_INFO  (x64 32 / x86 24 バイト)
typedef struct KSSTREAM_METADATA_INFO {
    DWORD BufferSize;
    DWORD UsedSize;
    void* Data;
    void* SystemVa;
    DWORD Flags;
    DWORD Reserved;
} KSSTREAM_METADATA_INFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSSTREAM_METADATA_INFO
{
    public uint BufferSize;
    public uint UsedSize;
    public IntPtr Data;
    public IntPtr SystemVa;
    public uint Flags;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSSTREAM_METADATA_INFO
    Public BufferSize As UInteger
    Public UsedSize As UInteger
    Public Data As IntPtr
    Public SystemVa As IntPtr
    Public Flags As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class KSSTREAM_METADATA_INFO(ctypes.Structure):
    _fields_ = [
        ("BufferSize", wintypes.DWORD),
        ("UsedSize", wintypes.DWORD),
        ("Data", ctypes.c_void_p),
        ("SystemVa", ctypes.c_void_p),
        ("Flags", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct KSSTREAM_METADATA_INFO {
    pub BufferSize: u32,
    pub UsedSize: u32,
    pub Data: *mut core::ffi::c_void,
    pub SystemVa: *mut core::ffi::c_void,
    pub Flags: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type KSSTREAM_METADATA_INFO struct {
	BufferSize uint32
	UsedSize uint32
	Data uintptr
	SystemVa uintptr
	Flags uint32
	Reserved uint32
}
type
  KSSTREAM_METADATA_INFO = record
    BufferSize: DWORD;
    UsedSize: DWORD;
    Data: Pointer;
    SystemVa: Pointer;
    Flags: DWORD;
    Reserved: DWORD;
  end;
const KSSTREAM_METADATA_INFO = extern struct {
    BufferSize: u32,
    UsedSize: u32,
    Data: ?*anyopaque,
    SystemVa: ?*anyopaque,
    Flags: u32,
    Reserved: u32,
};
type
  KSSTREAM_METADATA_INFO {.bycopy.} = object
    BufferSize: uint32
    UsedSize: uint32
    Data: pointer
    SystemVa: pointer
    Flags: uint32
    Reserved: uint32
struct KSSTREAM_METADATA_INFO
{
    uint BufferSize;
    uint UsedSize;
    void* Data;
    void* SystemVa;
    uint Flags;
    uint Reserved;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; KSSTREAM_METADATA_INFO サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; BufferSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; UsedSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Data : void* (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; SystemVa : void* (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; Flags : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; Reserved : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; KSSTREAM_METADATA_INFO サイズ: 32 バイト(x64)
dim st, 8    ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; BufferSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; UsedSize : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; Data : void* (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; SystemVa : void* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; Flags : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; Reserved : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global KSSTREAM_METADATA_INFO
    #field int BufferSize
    #field int UsedSize
    #field intptr Data
    #field intptr SystemVa
    #field int Flags
    #field int Reserved
#endstruct

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