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

DD_GETVPORTCONNECTDATA

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

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

フィールド

フィールドサイズx64x86説明
lpDDDD_DIRECTDRAW_LOCAL*8/4+0+0現在の Microsoft DirectDraw プロセスにのみ関連する DD_DIRECTDRAW_LOCAL 構造体を指します。
dwPortIdDWORD4+8+4ドライバーが接続情報を取得する対象となる VPE オブジェクトの ID を指定します。DirectDraw は、この ID を DDVIDEOPORTCAPS 構造体の dwVideoPortID メンバーから取得します。
lpConnectDDVIDEOPORTCONNECT*8/4+16+8VPE オブジェクトがサポートする各接続の特性をドライバーが返すための、DDVIDEOPORTCONNECT 構造体の配列を指します。このメンバーは NULL でもかまいません。
dwNumEntriesDWORD4+24+12指定された VPE オブジェクトがサポートする接続の組み合わせの数をドライバーが返す場所を指定します。
ddRValHRESULT4+28+16DdVideoPortGetConnectInfo コールバックの戻り値をドライバーが書き込む場所を指定します。戻り値 DD_OK は成功を示します。詳細については、Return Values for DirectDraw を参照してください。
GetVideoPortConnectInfovoid*8/4+32+20DirectDraw API が使用するメンバーであり、ドライバーが設定してはなりません。

公式ドキュメント

DD_GETVPORTCONNECTDATA 構造体には、指定された ビデオポート拡張 (VPE) オブジェクトがサポートする接続の組み合わせが格納されます。

出典・ライセンス: 上記「公式ドキュメント」の内容は Microsoft の Win32 API ドキュメント(MicrosoftDocs/sdk-api)を日本語に翻訳・改変したものです。© Microsoft Corporation. CC BY 4.0 で提供。
Microsoft 公式リファレンス: 英語 (en-us) · 日本語 (ja-jp) · 原文ソース (GitHub)

各言語での定義

#include <windows.h>

// DD_GETVPORTCONNECTDATA  (x64 40 / x86 24 バイト)
typedef struct DD_GETVPORTCONNECTDATA {
    DD_DIRECTDRAW_LOCAL* lpDD;
    DWORD dwPortId;
    DDVIDEOPORTCONNECT* lpConnect;
    DWORD dwNumEntries;
    HRESULT ddRVal;
    void* GetVideoPortConnectInfo;
} DD_GETVPORTCONNECTDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_GETVPORTCONNECTDATA
{
    public IntPtr lpDD;
    public uint dwPortId;
    public IntPtr lpConnect;
    public uint dwNumEntries;
    public int ddRVal;
    public IntPtr GetVideoPortConnectInfo;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_GETVPORTCONNECTDATA
    Public lpDD As IntPtr
    Public dwPortId As UInteger
    Public lpConnect As IntPtr
    Public dwNumEntries As UInteger
    Public ddRVal As Integer
    Public GetVideoPortConnectInfo As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DD_GETVPORTCONNECTDATA(ctypes.Structure):
    _fields_ = [
        ("lpDD", ctypes.c_void_p),
        ("dwPortId", wintypes.DWORD),
        ("lpConnect", ctypes.c_void_p),
        ("dwNumEntries", wintypes.DWORD),
        ("ddRVal", ctypes.c_int),
        ("GetVideoPortConnectInfo", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DD_GETVPORTCONNECTDATA {
    pub lpDD: *mut core::ffi::c_void,
    pub dwPortId: u32,
    pub lpConnect: *mut core::ffi::c_void,
    pub dwNumEntries: u32,
    pub ddRVal: i32,
    pub GetVideoPortConnectInfo: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DD_GETVPORTCONNECTDATA struct {
	lpDD uintptr
	dwPortId uint32
	lpConnect uintptr
	dwNumEntries uint32
	ddRVal int32
	GetVideoPortConnectInfo uintptr
}
type
  DD_GETVPORTCONNECTDATA = record
    lpDD: Pointer;
    dwPortId: DWORD;
    lpConnect: Pointer;
    dwNumEntries: DWORD;
    ddRVal: Integer;
    GetVideoPortConnectInfo: Pointer;
  end;
const DD_GETVPORTCONNECTDATA = extern struct {
    lpDD: ?*anyopaque,
    dwPortId: u32,
    lpConnect: ?*anyopaque,
    dwNumEntries: u32,
    ddRVal: i32,
    GetVideoPortConnectInfo: ?*anyopaque,
};
type
  DD_GETVPORTCONNECTDATA {.bycopy.} = object
    lpDD: pointer
    dwPortId: uint32
    lpConnect: pointer
    dwNumEntries: uint32
    ddRVal: int32
    GetVideoPortConnectInfo: pointer
struct DD_GETVPORTCONNECTDATA
{
    void* lpDD;
    uint dwPortId;
    void* lpConnect;
    uint dwNumEntries;
    int ddRVal;
    void* GetVideoPortConnectInfo;
}

HSP用 定義

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

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

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