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

KSCAMERA_PERFRAMESETTING_FRAME_HEADER

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

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

フィールド

フィールドサイズx64x86説明
SizeDWORD4+0+0ヘッダを含むフレーム設定全体のサイズをバイト単位で示す。
IdDWORD4+4+4このフレーム設定の識別子。
ItemCountDWORD4+8+8このフレームに含まれる設定項目の数を示す。
ReservedDWORD4+12+12予約フィールド。将来の拡張用で通常は0を設定する。

各言語での定義

#include <windows.h>

// KSCAMERA_PERFRAMESETTING_FRAME_HEADER  (x64 16 / x86 16 バイト)
typedef struct KSCAMERA_PERFRAMESETTING_FRAME_HEADER {
    DWORD Size;
    DWORD Id;
    DWORD ItemCount;
    DWORD Reserved;
} KSCAMERA_PERFRAMESETTING_FRAME_HEADER;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct KSCAMERA_PERFRAMESETTING_FRAME_HEADER
{
    public uint Size;
    public uint Id;
    public uint ItemCount;
    public uint Reserved;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure KSCAMERA_PERFRAMESETTING_FRAME_HEADER
    Public Size As UInteger
    Public Id As UInteger
    Public ItemCount As UInteger
    Public Reserved As UInteger
End Structure
import ctypes
from ctypes import wintypes

class KSCAMERA_PERFRAMESETTING_FRAME_HEADER(ctypes.Structure):
    _fields_ = [
        ("Size", wintypes.DWORD),
        ("Id", wintypes.DWORD),
        ("ItemCount", wintypes.DWORD),
        ("Reserved", wintypes.DWORD),
    ]
#[repr(C)]
pub struct KSCAMERA_PERFRAMESETTING_FRAME_HEADER {
    pub Size: u32,
    pub Id: u32,
    pub ItemCount: u32,
    pub Reserved: u32,
}
import "golang.org/x/sys/windows"

type KSCAMERA_PERFRAMESETTING_FRAME_HEADER struct {
	Size uint32
	Id uint32
	ItemCount uint32
	Reserved uint32
}
type
  KSCAMERA_PERFRAMESETTING_FRAME_HEADER = record
    Size: DWORD;
    Id: DWORD;
    ItemCount: DWORD;
    Reserved: DWORD;
  end;
const KSCAMERA_PERFRAMESETTING_FRAME_HEADER = extern struct {
    Size: u32,
    Id: u32,
    ItemCount: u32,
    Reserved: u32,
};
type
  KSCAMERA_PERFRAMESETTING_FRAME_HEADER {.bycopy.} = object
    Size: uint32
    Id: uint32
    ItemCount: uint32
    Reserved: uint32
struct KSCAMERA_PERFRAMESETTING_FRAME_HEADER
{
    uint Size;
    uint Id;
    uint ItemCount;
    uint Reserved;
}

HSP用 定義

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

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

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