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

DDHAL_GETVPORTOUTPUTFORMATDATA

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

サイズ=各フィールドのバイト数(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問い合わせ方法を示すフラグを示す。
lpddpfInputFormatDDPIXELFORMAT*8/4+24+12基準となる入力ピクセル形式(DDPIXELFORMAT)へのポインタ。
lpddpfOutputFormatsDDPIXELFORMAT*8/4+32+16対応出力形式(DDPIXELFORMAT配列)を返すポインタ。NULL可。
dwNumFormatsDWORD4+40+20対応出力形式の数を返す。
ddRValHRESULT4+44+24出力形式取得の実行結果を示すHRESULT。
GetVideoPortOutputFormatsLPDDHALVPORTCB_GETOUTPUTFORMATS8/4+48+28実際の出力形式列挙を行うコールバックへのポインタ。

各言語での定義

#include <windows.h>

// DDHAL_GETVPORTOUTPUTFORMATDATA  (x64 56 / x86 32 バイト)
typedef struct DDHAL_GETVPORTOUTPUTFORMATDATA {
    DDRAWI_DIRECTDRAW_LCL* lpDD;
    DDRAWI_DDVIDEOPORT_LCL* lpVideoPort;
    DWORD dwFlags;
    DDPIXELFORMAT* lpddpfInputFormat;
    DDPIXELFORMAT* lpddpfOutputFormats;
    DWORD dwNumFormats;
    HRESULT ddRVal;
    LPDDHALVPORTCB_GETOUTPUTFORMATS GetVideoPortOutputFormats;
} DDHAL_GETVPORTOUTPUTFORMATDATA;
using System;
using System.Runtime.InteropServices;

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

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

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

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

HSP用 定義

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

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

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