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

DDHAL_GETVPORTINPUTFORMATDATA

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

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

フィールド

フィールドサイズx64x86説明
lpDDDDRAWI_DIRECTDRAW_LCL*8/4+0+0対象のローカルDirectDrawオブジェクトへのポインタ。
lpVideoPortDDRAWI_DDVIDEOPORT_LCL*8/4+8+4対象のビデオポートローカルオブジェクトへのポインタ。
dwFlagsDWORD4+16+8問い合わせ方法を示すフラグを示す。
lpddpfFormatDDPIXELFORMAT*8/4+24+12対応入力形式(DDPIXELFORMAT配列)を返すポインタ。NULL可。
dwNumFormatsDWORD4+32+16対応入力形式の数を返す。
ddRValHRESULT4+36+20入力形式取得の実行結果を示すHRESULT。
GetVideoPortInputFormatsLPDDHALVPORTCB_GETINPUTFORMATS8/4+40+24実際の入力形式列挙を行うコールバックへのポインタ。

各言語での定義

#include <windows.h>

// DDHAL_GETVPORTINPUTFORMATDATA  (x64 48 / x86 28 バイト)
typedef struct DDHAL_GETVPORTINPUTFORMATDATA {
    DDRAWI_DIRECTDRAW_LCL* lpDD;
    DDRAWI_DDVIDEOPORT_LCL* lpVideoPort;
    DWORD dwFlags;
    DDPIXELFORMAT* lpddpfFormat;
    DWORD dwNumFormats;
    HRESULT ddRVal;
    LPDDHALVPORTCB_GETINPUTFORMATS GetVideoPortInputFormats;
} DDHAL_GETVPORTINPUTFORMATDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDHAL_GETVPORTINPUTFORMATDATA
{
    public IntPtr lpDD;
    public IntPtr lpVideoPort;
    public uint dwFlags;
    public IntPtr lpddpfFormat;
    public uint dwNumFormats;
    public int ddRVal;
    public IntPtr GetVideoPortInputFormats;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDHAL_GETVPORTINPUTFORMATDATA
    Public lpDD As IntPtr
    Public lpVideoPort As IntPtr
    Public dwFlags As UInteger
    Public lpddpfFormat As IntPtr
    Public dwNumFormats As UInteger
    Public ddRVal As Integer
    Public GetVideoPortInputFormats As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DDHAL_GETVPORTINPUTFORMATDATA(ctypes.Structure):
    _fields_ = [
        ("lpDD", ctypes.c_void_p),
        ("lpVideoPort", ctypes.c_void_p),
        ("dwFlags", wintypes.DWORD),
        ("lpddpfFormat", ctypes.c_void_p),
        ("dwNumFormats", wintypes.DWORD),
        ("ddRVal", ctypes.c_int),
        ("GetVideoPortInputFormats", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DDHAL_GETVPORTINPUTFORMATDATA {
    pub lpDD: *mut core::ffi::c_void,
    pub lpVideoPort: *mut core::ffi::c_void,
    pub dwFlags: u32,
    pub lpddpfFormat: *mut core::ffi::c_void,
    pub dwNumFormats: u32,
    pub ddRVal: i32,
    pub GetVideoPortInputFormats: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DDHAL_GETVPORTINPUTFORMATDATA struct {
	lpDD uintptr
	lpVideoPort uintptr
	dwFlags uint32
	lpddpfFormat uintptr
	dwNumFormats uint32
	ddRVal int32
	GetVideoPortInputFormats uintptr
}
type
  DDHAL_GETVPORTINPUTFORMATDATA = record
    lpDD: Pointer;
    lpVideoPort: Pointer;
    dwFlags: DWORD;
    lpddpfFormat: Pointer;
    dwNumFormats: DWORD;
    ddRVal: Integer;
    GetVideoPortInputFormats: Pointer;
  end;
const DDHAL_GETVPORTINPUTFORMATDATA = extern struct {
    lpDD: ?*anyopaque,
    lpVideoPort: ?*anyopaque,
    dwFlags: u32,
    lpddpfFormat: ?*anyopaque,
    dwNumFormats: u32,
    ddRVal: i32,
    GetVideoPortInputFormats: ?*anyopaque,
};
type
  DDHAL_GETVPORTINPUTFORMATDATA {.bycopy.} = object
    lpDD: pointer
    lpVideoPort: pointer
    dwFlags: uint32
    lpddpfFormat: pointer
    dwNumFormats: uint32
    ddRVal: int32
    GetVideoPortInputFormats: pointer
struct DDHAL_GETVPORTINPUTFORMATDATA
{
    void* lpDD;
    void* lpVideoPort;
    uint dwFlags;
    void* lpddpfFormat;
    uint dwNumFormats;
    int ddRVal;
    void* GetVideoPortInputFormats;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDHAL_GETVPORTINPUTFORMATDATA サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_LCL* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; lpVideoPort : DDRAWI_DDVIDEOPORT_LCL* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; dwFlags : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; lpddpfFormat : DDPIXELFORMAT* (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; dwNumFormats : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ddRVal : HRESULT (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; GetVideoPortInputFormats : LPDDHALVPORTCB_GETINPUTFORMATS (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDHAL_GETVPORTINPUTFORMATDATA サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_LCL* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpVideoPort : DDRAWI_DDVIDEOPORT_LCL* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; dwFlags : DWORD (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lpddpfFormat : DDPIXELFORMAT* (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; dwNumFormats : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; ddRVal : HRESULT (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; GetVideoPortInputFormats : LPDDHALVPORTCB_GETINPUTFORMATS (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDHAL_GETVPORTINPUTFORMATDATA
    #field intptr lpDD
    #field intptr lpVideoPort
    #field int dwFlags
    #field intptr lpddpfFormat
    #field int dwNumFormats
    #field int ddRVal
    #field intptr GetVideoPortInputFormats
#endstruct

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