Win32 API 日本語リファレンス
ホームGraphics.DirectDraw › DDRAWI_DDMOTIONCOMP_LCL

DDRAWI_DDMOTIONCOMP_LCL

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

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

フィールド

フィールドサイズx64x86説明
lpDDDDRAWI_DIRECTDRAW_LCL*8/4+0+0所属するローカルDirectDrawオブジェクトへのポインタ。
guidGUID16+8+4モーション補償の方式を識別するGUID。
dwUncompWidthDWORD4+24+20非圧縮映像の幅(ピクセル)を示す。
dwUncompHeightDWORD4+28+24非圧縮映像の高さ(ライン)を示す。
ddUncompPixelFormatDDPIXELFORMAT40/32+32+28非圧縮映像のピクセル形式(DDPIXELFORMAT)。
dwInternalFlagsDWORD4+72+60内部処理用のフラグを示す。
dwRefCntDWORD4+76+64このモーション補償オブジェクトの参照カウントを示す。
dwProcessIdDWORD4+80+68このオブジェクトを所有するプロセスの識別子を示す。
hMoCompHANDLE8/4+88+72ドライバが用いるモーション補償ハンドルを示す。
dwDriverReserved1DWORD4+96+76ドライバ用の予約フィールド(その1)。
dwDriverReserved2DWORD4+100+80ドライバ用の予約フィールド(その2)。
dwDriverReserved3DWORD4+104+84ドライバ用の予約フィールド(その3)。
lpDriverReserved1void*8/4+112+88ドライバ用の予約ポインタ(その1)。
lpDriverReserved2void*8/4+120+92ドライバ用の予約ポインタ(その2)。
lpDriverReserved3void*8/4+128+96ドライバ用の予約ポインタ(その3)。

各言語での定義

#include <windows.h>

// DDPIXELFORMAT  (x64 40 / x86 32 バイト)
typedef struct DDPIXELFORMAT {
    DWORD dwSize;
    DWORD dwFlags;
    DWORD dwFourCC;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
    _Anonymous3_e__Union Anonymous3;
    _Anonymous4_e__Union Anonymous4;
    _Anonymous5_e__Union Anonymous5;
} DDPIXELFORMAT;

// DDRAWI_DDMOTIONCOMP_LCL  (x64 136 / x86 100 バイト)
typedef struct DDRAWI_DDMOTIONCOMP_LCL {
    DDRAWI_DIRECTDRAW_LCL* lpDD;
    GUID guid;
    DWORD dwUncompWidth;
    DWORD dwUncompHeight;
    DDPIXELFORMAT ddUncompPixelFormat;
    DWORD dwInternalFlags;
    DWORD dwRefCnt;
    DWORD dwProcessId;
    HANDLE hMoComp;
    DWORD dwDriverReserved1;
    DWORD dwDriverReserved2;
    DWORD dwDriverReserved3;
    void* lpDriverReserved1;
    void* lpDriverReserved2;
    void* lpDriverReserved3;
} DDRAWI_DDMOTIONCOMP_LCL;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDPIXELFORMAT
{
    public uint dwSize;
    public uint dwFlags;
    public uint dwFourCC;
    public _Anonymous1_e__Union Anonymous1;
    public _Anonymous2_e__Union Anonymous2;
    public _Anonymous3_e__Union Anonymous3;
    public _Anonymous4_e__Union Anonymous4;
    public _Anonymous5_e__Union Anonymous5;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDRAWI_DDMOTIONCOMP_LCL
{
    public IntPtr lpDD;
    public Guid guid;
    public uint dwUncompWidth;
    public uint dwUncompHeight;
    public DDPIXELFORMAT ddUncompPixelFormat;
    public uint dwInternalFlags;
    public uint dwRefCnt;
    public uint dwProcessId;
    public IntPtr hMoComp;
    public uint dwDriverReserved1;
    public uint dwDriverReserved2;
    public uint dwDriverReserved3;
    public IntPtr lpDriverReserved1;
    public IntPtr lpDriverReserved2;
    public IntPtr lpDriverReserved3;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDPIXELFORMAT
    Public dwSize As UInteger
    Public dwFlags As UInteger
    Public dwFourCC As UInteger
    Public Anonymous1 As _Anonymous1_e__Union
    Public Anonymous2 As _Anonymous2_e__Union
    Public Anonymous3 As _Anonymous3_e__Union
    Public Anonymous4 As _Anonymous4_e__Union
    Public Anonymous5 As _Anonymous5_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDRAWI_DDMOTIONCOMP_LCL
    Public lpDD As IntPtr
    Public guid As Guid
    Public dwUncompWidth As UInteger
    Public dwUncompHeight As UInteger
    Public ddUncompPixelFormat As DDPIXELFORMAT
    Public dwInternalFlags As UInteger
    Public dwRefCnt As UInteger
    Public dwProcessId As UInteger
    Public hMoComp As IntPtr
    Public dwDriverReserved1 As UInteger
    Public dwDriverReserved2 As UInteger
    Public dwDriverReserved3 As UInteger
    Public lpDriverReserved1 As IntPtr
    Public lpDriverReserved2 As IntPtr
    Public lpDriverReserved3 As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DDPIXELFORMAT(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwFourCC", wintypes.DWORD),
        ("Anonymous1", _Anonymous1_e__Union),
        ("Anonymous2", _Anonymous2_e__Union),
        ("Anonymous3", _Anonymous3_e__Union),
        ("Anonymous4", _Anonymous4_e__Union),
        ("Anonymous5", _Anonymous5_e__Union),
    ]

class DDRAWI_DDMOTIONCOMP_LCL(ctypes.Structure):
    _fields_ = [
        ("lpDD", ctypes.c_void_p),
        ("guid", GUID),
        ("dwUncompWidth", wintypes.DWORD),
        ("dwUncompHeight", wintypes.DWORD),
        ("ddUncompPixelFormat", DDPIXELFORMAT),
        ("dwInternalFlags", wintypes.DWORD),
        ("dwRefCnt", wintypes.DWORD),
        ("dwProcessId", wintypes.DWORD),
        ("hMoComp", ctypes.c_void_p),
        ("dwDriverReserved1", wintypes.DWORD),
        ("dwDriverReserved2", wintypes.DWORD),
        ("dwDriverReserved3", wintypes.DWORD),
        ("lpDriverReserved1", ctypes.c_void_p),
        ("lpDriverReserved2", ctypes.c_void_p),
        ("lpDriverReserved3", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DDPIXELFORMAT {
    pub dwSize: u32,
    pub dwFlags: u32,
    pub dwFourCC: u32,
    pub Anonymous1: _Anonymous1_e__Union,
    pub Anonymous2: _Anonymous2_e__Union,
    pub Anonymous3: _Anonymous3_e__Union,
    pub Anonymous4: _Anonymous4_e__Union,
    pub Anonymous5: _Anonymous5_e__Union,
}

#[repr(C)]
pub struct DDRAWI_DDMOTIONCOMP_LCL {
    pub lpDD: *mut core::ffi::c_void,
    pub guid: GUID,
    pub dwUncompWidth: u32,
    pub dwUncompHeight: u32,
    pub ddUncompPixelFormat: DDPIXELFORMAT,
    pub dwInternalFlags: u32,
    pub dwRefCnt: u32,
    pub dwProcessId: u32,
    pub hMoComp: *mut core::ffi::c_void,
    pub dwDriverReserved1: u32,
    pub dwDriverReserved2: u32,
    pub dwDriverReserved3: u32,
    pub lpDriverReserved1: *mut core::ffi::c_void,
    pub lpDriverReserved2: *mut core::ffi::c_void,
    pub lpDriverReserved3: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DDPIXELFORMAT struct {
	dwSize uint32
	dwFlags uint32
	dwFourCC uint32
	Anonymous1 _Anonymous1_e__Union
	Anonymous2 _Anonymous2_e__Union
	Anonymous3 _Anonymous3_e__Union
	Anonymous4 _Anonymous4_e__Union
	Anonymous5 _Anonymous5_e__Union
}

type DDRAWI_DDMOTIONCOMP_LCL struct {
	lpDD uintptr
	guid windows.GUID
	dwUncompWidth uint32
	dwUncompHeight uint32
	ddUncompPixelFormat DDPIXELFORMAT
	dwInternalFlags uint32
	dwRefCnt uint32
	dwProcessId uint32
	hMoComp uintptr
	dwDriverReserved1 uint32
	dwDriverReserved2 uint32
	dwDriverReserved3 uint32
	lpDriverReserved1 uintptr
	lpDriverReserved2 uintptr
	lpDriverReserved3 uintptr
}
type
  DDPIXELFORMAT = record
    dwSize: DWORD;
    dwFlags: DWORD;
    dwFourCC: DWORD;
    Anonymous1: _Anonymous1_e__Union;
    Anonymous2: _Anonymous2_e__Union;
    Anonymous3: _Anonymous3_e__Union;
    Anonymous4: _Anonymous4_e__Union;
    Anonymous5: _Anonymous5_e__Union;
  end;

  DDRAWI_DDMOTIONCOMP_LCL = record
    lpDD: Pointer;
    guid: TGUID;
    dwUncompWidth: DWORD;
    dwUncompHeight: DWORD;
    ddUncompPixelFormat: DDPIXELFORMAT;
    dwInternalFlags: DWORD;
    dwRefCnt: DWORD;
    dwProcessId: DWORD;
    hMoComp: Pointer;
    dwDriverReserved1: DWORD;
    dwDriverReserved2: DWORD;
    dwDriverReserved3: DWORD;
    lpDriverReserved1: Pointer;
    lpDriverReserved2: Pointer;
    lpDriverReserved3: Pointer;
  end;
const DDPIXELFORMAT = extern struct {
    dwSize: u32,
    dwFlags: u32,
    dwFourCC: u32,
    Anonymous1: _Anonymous1_e__Union,
    Anonymous2: _Anonymous2_e__Union,
    Anonymous3: _Anonymous3_e__Union,
    Anonymous4: _Anonymous4_e__Union,
    Anonymous5: _Anonymous5_e__Union,
};

const DDRAWI_DDMOTIONCOMP_LCL = extern struct {
    lpDD: ?*anyopaque,
    guid: GUID,
    dwUncompWidth: u32,
    dwUncompHeight: u32,
    ddUncompPixelFormat: DDPIXELFORMAT,
    dwInternalFlags: u32,
    dwRefCnt: u32,
    dwProcessId: u32,
    hMoComp: ?*anyopaque,
    dwDriverReserved1: u32,
    dwDriverReserved2: u32,
    dwDriverReserved3: u32,
    lpDriverReserved1: ?*anyopaque,
    lpDriverReserved2: ?*anyopaque,
    lpDriverReserved3: ?*anyopaque,
};
type
  DDPIXELFORMAT {.bycopy.} = object
    dwSize: uint32
    dwFlags: uint32
    dwFourCC: uint32
    Anonymous1: _Anonymous1_e__Union
    Anonymous2: _Anonymous2_e__Union
    Anonymous3: _Anonymous3_e__Union
    Anonymous4: _Anonymous4_e__Union
    Anonymous5: _Anonymous5_e__Union

  DDRAWI_DDMOTIONCOMP_LCL {.bycopy.} = object
    lpDD: pointer
    guid: GUID
    dwUncompWidth: uint32
    dwUncompHeight: uint32
    ddUncompPixelFormat: DDPIXELFORMAT
    dwInternalFlags: uint32
    dwRefCnt: uint32
    dwProcessId: uint32
    hMoComp: pointer
    dwDriverReserved1: uint32
    dwDriverReserved2: uint32
    dwDriverReserved3: uint32
    lpDriverReserved1: pointer
    lpDriverReserved2: pointer
    lpDriverReserved3: pointer
struct DDPIXELFORMAT
{
    uint dwSize;
    uint dwFlags;
    uint dwFourCC;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
    _Anonymous3_e__Union Anonymous3;
    _Anonymous4_e__Union Anonymous4;
    _Anonymous5_e__Union Anonymous5;
}

struct DDRAWI_DDMOTIONCOMP_LCL
{
    void* lpDD;
    GUID guid;
    uint dwUncompWidth;
    uint dwUncompHeight;
    DDPIXELFORMAT ddUncompPixelFormat;
    uint dwInternalFlags;
    uint dwRefCnt;
    uint dwProcessId;
    void* hMoComp;
    uint dwDriverReserved1;
    uint dwDriverReserved2;
    uint dwDriverReserved3;
    void* lpDriverReserved1;
    void* lpDriverReserved2;
    void* lpDriverReserved3;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDRAWI_DDMOTIONCOMP_LCL サイズ: 100 バイト(x86)
dim st, 25    ; 4byte整数×25(構造体サイズ 100 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_LCL* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; guid : GUID (+4, 16byte)  varptr(st)+4 を基点に操作(16byte:入れ子/配列)
; dwUncompWidth : DWORD (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwUncompHeight : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ddUncompPixelFormat : DDPIXELFORMAT (+28, 32byte)  varptr(st)+28 を基点に操作(32byte:入れ子/配列)
; dwInternalFlags : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; dwRefCnt : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwProcessId : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; hMoComp : HANDLE (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; dwDriverReserved1 : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; dwDriverReserved2 : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; dwDriverReserved3 : DWORD (+84, 4byte)  st.21 = 値  /  値 = st.21   (lpoke/lpeek も可)
; lpDriverReserved1 : void* (+88, 4byte)  st.22 = 値  /  値 = st.22   (lpoke/lpeek も可)
; lpDriverReserved2 : void* (+92, 4byte)  st.23 = 値  /  値 = st.23   (lpoke/lpeek も可)
; lpDriverReserved3 : void* (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDRAWI_DDMOTIONCOMP_LCL サイズ: 136 バイト(x64)
dim st, 34    ; 4byte整数×34(構造体サイズ 136 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_LCL* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; guid : GUID (+8, 16byte)  varptr(st)+8 を基点に操作(16byte:入れ子/配列)
; dwUncompWidth : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwUncompHeight : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ddUncompPixelFormat : DDPIXELFORMAT (+32, 40byte)  varptr(st)+32 を基点に操作(40byte:入れ子/配列)
; dwInternalFlags : DWORD (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; dwRefCnt : DWORD (+76, 4byte)  st.19 = 値  /  値 = st.19   (lpoke/lpeek も可)
; dwProcessId : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; hMoComp : HANDLE (+88, 8byte)  qpoke st,88,値 / qpeek(st,88)  ※IronHSPのみ。3.7/3.8は lpoke st,88,下位 : lpoke st,92,上位
; dwDriverReserved1 : DWORD (+96, 4byte)  st.24 = 値  /  値 = st.24   (lpoke/lpeek も可)
; dwDriverReserved2 : DWORD (+100, 4byte)  st.25 = 値  /  値 = st.25   (lpoke/lpeek も可)
; dwDriverReserved3 : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; lpDriverReserved1 : void* (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; lpDriverReserved2 : void* (+120, 8byte)  qpoke st,120,値 / qpeek(st,120)  ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; lpDriverReserved3 : void* (+128, 8byte)  qpoke st,128,値 / qpeek(st,128)  ※IronHSPのみ。3.7/3.8は lpoke st,128,下位 : lpoke st,132,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global GUID, pack=1
    #field int Data1
    #field short Data2
    #field short Data3
    #field byte Data4 8
#endstruct

#defstruct global DDPIXELFORMAT
    #field int dwSize
    #field int dwFlags
    #field int dwFourCC
    #field byte Anonymous1 4
    #field byte Anonymous2 4
    #field byte Anonymous3 8
    #field byte Anonymous4 4
    #field byte Anonymous5 4
#endstruct

#defstruct global DDRAWI_DDMOTIONCOMP_LCL
    #field intptr lpDD
    #field GUID guid
    #field int dwUncompWidth
    #field int dwUncompHeight
    #field DDPIXELFORMAT ddUncompPixelFormat
    #field int dwInternalFlags
    #field int dwRefCnt
    #field int dwProcessId
    #field intptr hMoComp
    #field int dwDriverReserved1
    #field int dwDriverReserved2
    #field int dwDriverReserved3
    #field intptr lpDriverReserved1
    #field intptr lpDriverReserved2
    #field intptr lpDriverReserved3
#endstruct

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