ホーム › Graphics.DirectDraw › DDHAL_GETVPORTCONNECTDATA
DDHAL_GETVPORTCONNECTDATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lpDD | DDRAWI_DIRECTDRAW_LCL* | 8/4 | +0 | +0 | 対象のローカルDirectDrawオブジェクトへのポインタ。 |
| dwPortId | DWORD | 4 | +8 | +4 | 対象ビデオポートの識別子を示す。 |
| lpConnect | DDVIDEOPORTCONNECT* | 8/4 | +16 | +8 | 対応接続情報(DDVIDEOPORTCONNECT配列)を返すポインタ。NULL可。 |
| dwNumEntries | DWORD | 4 | +24 | +12 | 対応する接続情報の数を返す。 |
| ddRVal | HRESULT | 4 | +28 | +16 | 接続情報取得の実行結果を示すHRESULT。 |
| GetVideoPortConnectInfo | LPDDHALVPORTCB_GETVPORTCONNECT | 8/4 | +32 | +20 | 実際の接続情報取得を行うコールバックへのポインタ。 |
各言語での定義
#include <windows.h>
// DDHAL_GETVPORTCONNECTDATA (x64 40 / x86 24 バイト)
typedef struct DDHAL_GETVPORTCONNECTDATA {
DDRAWI_DIRECTDRAW_LCL* lpDD;
DWORD dwPortId;
DDVIDEOPORTCONNECT* lpConnect;
DWORD dwNumEntries;
HRESULT ddRVal;
LPDDHALVPORTCB_GETVPORTCONNECT GetVideoPortConnectInfo;
} DDHAL_GETVPORTCONNECTDATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDHAL_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 DDHAL_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 Structureimport ctypes
from ctypes import wintypes
class DDHAL_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 DDHAL_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 DDHAL_GETVPORTCONNECTDATA struct {
lpDD uintptr
dwPortId uint32
lpConnect uintptr
dwNumEntries uint32
ddRVal int32
GetVideoPortConnectInfo uintptr
}type
DDHAL_GETVPORTCONNECTDATA = record
lpDD: Pointer;
dwPortId: DWORD;
lpConnect: Pointer;
dwNumEntries: DWORD;
ddRVal: Integer;
GetVideoPortConnectInfo: Pointer;
end;const DDHAL_GETVPORTCONNECTDATA = extern struct {
lpDD: ?*anyopaque,
dwPortId: u32,
lpConnect: ?*anyopaque,
dwNumEntries: u32,
ddRVal: i32,
GetVideoPortConnectInfo: ?*anyopaque,
};type
DDHAL_GETVPORTCONNECTDATA {.bycopy.} = object
lpDD: pointer
dwPortId: uint32
lpConnect: pointer
dwNumEntries: uint32
ddRVal: int32
GetVideoPortConnectInfo: pointerstruct DDHAL_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 レイアウト)
; DDHAL_GETVPORTCONNECTDATA サイズ: 24 バイト(x86)
dim st, 6 ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_LCL* (+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 : LPDDHALVPORTCB_GETVPORTCONNECT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDHAL_GETVPORTCONNECTDATA サイズ: 40 バイト(x64)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; lpDD : DDRAWI_DIRECTDRAW_LCL* (+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 : LPDDHALVPORTCB_GETVPORTCONNECT (+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 DDHAL_GETVPORTCONNECTDATA
#field intptr lpDD
#field int dwPortId
#field intptr lpConnect
#field int dwNumEntries
#field int ddRVal
#field intptr GetVideoPortConnectInfo
#endstruct
stdim st, DDHAL_GETVPORTCONNECTDATA ; NSTRUCT 変数を確保
st->dwPortId = 100
mes "dwPortId=" + st->dwPortId