ホーム › Graphics.DirectDraw › DD_GETVPORTSIGNALDATA
DD_GETVPORTSIGNALDATA
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| lpDD | DD_DIRECTDRAW_LOCAL* | 8/4 | +0 | +0 | 対象のDirectDrawローカルオブジェクトへのポインタ。 |
| lpVideoPort | DD_VIDEOPORT_LOCAL* | 8/4 | +8 | +4 | 対象のビデオポートローカルオブジェクトへのポインタ。 |
| dwStatus | DWORD | 4 | +16 | +8 | 入力ビデオ信号の状態を返す(有効/不安定/無信号など)。 |
| ddRVal | HRESULT | 4 | +20 | +12 | 操作の結果を示すHRESULT。成功時はDD_OK。 |
| GetVideoSignalStatus | void* | 8/4 | +24 | +16 | ビデオ信号状態取得処理を行うコールバック関数へのポインタ。 |
各言語での定義
#include <windows.h>
// DD_GETVPORTSIGNALDATA (x64 32 / x86 20 バイト)
typedef struct DD_GETVPORTSIGNALDATA {
DD_DIRECTDRAW_LOCAL* lpDD;
DD_VIDEOPORT_LOCAL* lpVideoPort;
DWORD dwStatus;
HRESULT ddRVal;
void* GetVideoSignalStatus;
} DD_GETVPORTSIGNALDATA;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_GETVPORTSIGNALDATA
{
public IntPtr lpDD;
public IntPtr lpVideoPort;
public uint dwStatus;
public int ddRVal;
public IntPtr GetVideoSignalStatus;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_GETVPORTSIGNALDATA
Public lpDD As IntPtr
Public lpVideoPort As IntPtr
Public dwStatus As UInteger
Public ddRVal As Integer
Public GetVideoSignalStatus As IntPtr
End Structureimport ctypes
from ctypes import wintypes
class DD_GETVPORTSIGNALDATA(ctypes.Structure):
_fields_ = [
("lpDD", ctypes.c_void_p),
("lpVideoPort", ctypes.c_void_p),
("dwStatus", wintypes.DWORD),
("ddRVal", ctypes.c_int),
("GetVideoSignalStatus", ctypes.c_void_p),
]#[repr(C)]
pub struct DD_GETVPORTSIGNALDATA {
pub lpDD: *mut core::ffi::c_void,
pub lpVideoPort: *mut core::ffi::c_void,
pub dwStatus: u32,
pub ddRVal: i32,
pub GetVideoSignalStatus: *mut core::ffi::c_void,
}import "golang.org/x/sys/windows"
type DD_GETVPORTSIGNALDATA struct {
lpDD uintptr
lpVideoPort uintptr
dwStatus uint32
ddRVal int32
GetVideoSignalStatus uintptr
}type
DD_GETVPORTSIGNALDATA = record
lpDD: Pointer;
lpVideoPort: Pointer;
dwStatus: DWORD;
ddRVal: Integer;
GetVideoSignalStatus: Pointer;
end;const DD_GETVPORTSIGNALDATA = extern struct {
lpDD: ?*anyopaque,
lpVideoPort: ?*anyopaque,
dwStatus: u32,
ddRVal: i32,
GetVideoSignalStatus: ?*anyopaque,
};type
DD_GETVPORTSIGNALDATA {.bycopy.} = object
lpDD: pointer
lpVideoPort: pointer
dwStatus: uint32
ddRVal: int32
GetVideoSignalStatus: pointerstruct DD_GETVPORTSIGNALDATA
{
void* lpDD;
void* lpVideoPort;
uint dwStatus;
int ddRVal;
void* GetVideoSignalStatus;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DD_GETVPORTSIGNALDATA サイズ: 20 バイト(x86)
dim st, 5 ; 4byte整数×5(構造体サイズ 20 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_LOCAL* (+0, 4byte) varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; lpVideoPort : DD_VIDEOPORT_LOCAL* (+4, 4byte) varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; dwStatus : DWORD (+8, 4byte) st.2 = 値 / 値 = st.2 (lpoke/lpeek も可)
; ddRVal : HRESULT (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; GetVideoSignalStatus : void* (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DD_GETVPORTSIGNALDATA サイズ: 32 バイト(x64)
dim st, 8 ; 4byte整数×8(構造体サイズ 32 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_LOCAL* (+0, 8byte) varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpVideoPort : DD_VIDEOPORT_LOCAL* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; dwStatus : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; ddRVal : HRESULT (+20, 4byte) st.5 = 値 / 値 = st.5 (lpoke/lpeek も可)
; GetVideoSignalStatus : void* (+24, 8byte) qpoke st,24,値 / qpeek(st,24) ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DD_GETVPORTSIGNALDATA
#field intptr lpDD
#field intptr lpVideoPort
#field int dwStatus
#field int ddRVal
#field intptr GetVideoSignalStatus
#endstruct
stdim st, DD_GETVPORTSIGNALDATA ; NSTRUCT 変数を確保
st->dwStatus = 100
mes "dwStatus=" + st->dwStatus