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

DDHALINFO

構造体
サイズx64: 536 バイト / x86: 460 バイト

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0構造体サイズ(バイト数)。呼び出し前に設定する。
lpDDCallbacksDDHAL_DDCALLBACKS*8/4+8+4DirectDrawレベルのコールバック群へのポインタを示す。
lpDDSurfaceCallbacksDDHAL_DDSURFACECALLBACKS*8/4+16+8サーフェスレベルのコールバック群へのポインタを示す。
lpDDPaletteCallbacksDDHAL_DDPALETTECALLBACKS*8/4+24+12パレットレベルのコールバック群へのポインタを示す。
vmiDataVIDMEMINFO96/80+32+16ビデオメモリ情報(VIDMEMINFO)を示す。
ddCapsDDCORECAPS316+128+96ドライバの能力(DDCORECAPS)を示す。
dwMonitorFrequencyDWORD4+444+412モニタのリフレッシュ周波数(Hz)を示す。
GetDriverInfoLPDDHAL_GETDRIVERINFO8/4+448+416ドライバ情報取得コールバックへのポインタを示す。
dwModeIndexDWORD4+456+420現在のディスプレイモードのインデックスを示す。
lpdwFourCCDWORD*8/4+464+424対応FourCCコードの配列へのポインタを示す。
dwNumModesDWORD4+472+428利用可能なディスプレイモード数を示す。
lpModeInfoDDHALMODEINFO*8/4+480+432ディスプレイモード情報(DDHALMODEINFO)配列へのポインタ。
dwFlagsDWORD4+488+436ドライバ情報の属性を示すフラグを示す。
lpPDevicevoid*8/4+496+440物理デバイス(PDEV)へのポインタを示す。
hInstanceDWORD4+504+444ドライバDLLのインスタンスハンドルを示す。
lpD3DGlobalDriverDataUINT_PTR8/4+512+448Direct3Dグローバルドライバデータへのポインタを示す。
lpD3DHALCallbacksUINT_PTR8/4+520+452Direct3D HALコールバックへのポインタを示す。
lpDDExeBufCallbacksDDHAL_DDEXEBUFCALLBACKS*8/4+528+456実行バッファ用コールバック群へのポインタを示す。

各言語での定義

#include <windows.h>

// DDPIXELFORMAT  (x64 40 / x86 32 バイト)
typedef struct DDPIXELFORMAT {
    DWORD dwSize;
    DWORD dwFlags;
    DWORD dwFourCC;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
    _Anonymous3_e__Union Anonymous3;
    _Anonymous4_e__Union Anonymous4;
    _Anonymous5_e__Union Anonymous5;
} DDPIXELFORMAT;

// VIDMEMINFO  (x64 96 / x86 80 バイト)
typedef struct VIDMEMINFO {
    UINT_PTR fpPrimary;
    DWORD dwFlags;
    DWORD dwDisplayWidth;
    DWORD dwDisplayHeight;
    INT lDisplayPitch;
    DDPIXELFORMAT ddpfDisplay;
    DWORD dwOffscreenAlign;
    DWORD dwOverlayAlign;
    DWORD dwTextureAlign;
    DWORD dwZBufferAlign;
    DWORD dwAlphaAlign;
    DWORD dwNumHeaps;
    VIDMEM* pvmList;
} VIDMEMINFO;

// DDSCAPS  (x64 4 / x86 4 バイト)
typedef struct DDSCAPS {
    DWORD dwCaps;
} DDSCAPS;

// DDCORECAPS  (x64 316 / x86 316 バイト)
typedef struct DDCORECAPS {
    DWORD dwSize;
    DWORD dwCaps;
    DWORD dwCaps2;
    DWORD dwCKeyCaps;
    DWORD dwFXCaps;
    DWORD dwFXAlphaCaps;
    DWORD dwPalCaps;
    DWORD dwSVCaps;
    DWORD dwAlphaBltConstBitDepths;
    DWORD dwAlphaBltPixelBitDepths;
    DWORD dwAlphaBltSurfaceBitDepths;
    DWORD dwAlphaOverlayConstBitDepths;
    DWORD dwAlphaOverlayPixelBitDepths;
    DWORD dwAlphaOverlaySurfaceBitDepths;
    DWORD dwZBufferBitDepths;
    DWORD dwVidMemTotal;
    DWORD dwVidMemFree;
    DWORD dwMaxVisibleOverlays;
    DWORD dwCurrVisibleOverlays;
    DWORD dwNumFourCCCodes;
    DWORD dwAlignBoundarySrc;
    DWORD dwAlignSizeSrc;
    DWORD dwAlignBoundaryDest;
    DWORD dwAlignSizeDest;
    DWORD dwAlignStrideAlign;
    DWORD dwRops[8];
    DDSCAPS ddsCaps;
    DWORD dwMinOverlayStretch;
    DWORD dwMaxOverlayStretch;
    DWORD dwMinLiveVideoStretch;
    DWORD dwMaxLiveVideoStretch;
    DWORD dwMinHwCodecStretch;
    DWORD dwMaxHwCodecStretch;
    DWORD dwReserved1;
    DWORD dwReserved2;
    DWORD dwReserved3;
    DWORD dwSVBCaps;
    DWORD dwSVBCKeyCaps;
    DWORD dwSVBFXCaps;
    DWORD dwSVBRops[8];
    DWORD dwVSBCaps;
    DWORD dwVSBCKeyCaps;
    DWORD dwVSBFXCaps;
    DWORD dwVSBRops[8];
    DWORD dwSSBCaps;
    DWORD dwSSBCKeyCaps;
    DWORD dwSSBFXCaps;
    DWORD dwSSBRops[8];
    DWORD dwMaxVideoPorts;
    DWORD dwCurrVideoPorts;
    DWORD dwSVBCaps2;
} DDCORECAPS;

// DDHALINFO  (x64 536 / x86 460 バイト)
typedef struct DDHALINFO {
    DWORD dwSize;
    DDHAL_DDCALLBACKS* lpDDCallbacks;
    DDHAL_DDSURFACECALLBACKS* lpDDSurfaceCallbacks;
    DDHAL_DDPALETTECALLBACKS* lpDDPaletteCallbacks;
    VIDMEMINFO vmiData;
    DDCORECAPS ddCaps;
    DWORD dwMonitorFrequency;
    LPDDHAL_GETDRIVERINFO GetDriverInfo;
    DWORD dwModeIndex;
    DWORD* lpdwFourCC;
    DWORD dwNumModes;
    DDHALMODEINFO* lpModeInfo;
    DWORD dwFlags;
    void* lpPDevice;
    DWORD hInstance;
    UINT_PTR lpD3DGlobalDriverData;
    UINT_PTR lpD3DHALCallbacks;
    DDHAL_DDEXEBUFCALLBACKS* lpDDExeBufCallbacks;
} DDHALINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDPIXELFORMAT
{
    public uint dwSize;
    public uint dwFlags;
    public uint dwFourCC;
    public _Anonymous1_e__Union Anonymous1;
    public _Anonymous2_e__Union Anonymous2;
    public _Anonymous3_e__Union Anonymous3;
    public _Anonymous4_e__Union Anonymous4;
    public _Anonymous5_e__Union Anonymous5;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct VIDMEMINFO
{
    public UIntPtr fpPrimary;
    public uint dwFlags;
    public uint dwDisplayWidth;
    public uint dwDisplayHeight;
    public int lDisplayPitch;
    public DDPIXELFORMAT ddpfDisplay;
    public uint dwOffscreenAlign;
    public uint dwOverlayAlign;
    public uint dwTextureAlign;
    public uint dwZBufferAlign;
    public uint dwAlphaAlign;
    public uint dwNumHeaps;
    public IntPtr pvmList;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDSCAPS
{
    public uint dwCaps;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDCORECAPS
{
    public uint dwSize;
    public uint dwCaps;
    public uint dwCaps2;
    public uint dwCKeyCaps;
    public uint dwFXCaps;
    public uint dwFXAlphaCaps;
    public uint dwPalCaps;
    public uint dwSVCaps;
    public uint dwAlphaBltConstBitDepths;
    public uint dwAlphaBltPixelBitDepths;
    public uint dwAlphaBltSurfaceBitDepths;
    public uint dwAlphaOverlayConstBitDepths;
    public uint dwAlphaOverlayPixelBitDepths;
    public uint dwAlphaOverlaySurfaceBitDepths;
    public uint dwZBufferBitDepths;
    public uint dwVidMemTotal;
    public uint dwVidMemFree;
    public uint dwMaxVisibleOverlays;
    public uint dwCurrVisibleOverlays;
    public uint dwNumFourCCCodes;
    public uint dwAlignBoundarySrc;
    public uint dwAlignSizeSrc;
    public uint dwAlignBoundaryDest;
    public uint dwAlignSizeDest;
    public uint dwAlignStrideAlign;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] dwRops;
    public DDSCAPS ddsCaps;
    public uint dwMinOverlayStretch;
    public uint dwMaxOverlayStretch;
    public uint dwMinLiveVideoStretch;
    public uint dwMaxLiveVideoStretch;
    public uint dwMinHwCodecStretch;
    public uint dwMaxHwCodecStretch;
    public uint dwReserved1;
    public uint dwReserved2;
    public uint dwReserved3;
    public uint dwSVBCaps;
    public uint dwSVBCKeyCaps;
    public uint dwSVBFXCaps;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] dwSVBRops;
    public uint dwVSBCaps;
    public uint dwVSBCKeyCaps;
    public uint dwVSBFXCaps;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] dwVSBRops;
    public uint dwSSBCaps;
    public uint dwSSBCKeyCaps;
    public uint dwSSBFXCaps;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 8)] public uint[] dwSSBRops;
    public uint dwMaxVideoPorts;
    public uint dwCurrVideoPorts;
    public uint dwSVBCaps2;
}

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDHALINFO
{
    public uint dwSize;
    public IntPtr lpDDCallbacks;
    public IntPtr lpDDSurfaceCallbacks;
    public IntPtr lpDDPaletteCallbacks;
    public VIDMEMINFO vmiData;
    public DDCORECAPS ddCaps;
    public uint dwMonitorFrequency;
    public IntPtr GetDriverInfo;
    public uint dwModeIndex;
    public IntPtr lpdwFourCC;
    public uint dwNumModes;
    public IntPtr lpModeInfo;
    public uint dwFlags;
    public IntPtr lpPDevice;
    public uint hInstance;
    public UIntPtr lpD3DGlobalDriverData;
    public UIntPtr lpD3DHALCallbacks;
    public IntPtr lpDDExeBufCallbacks;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDPIXELFORMAT
    Public dwSize As UInteger
    Public dwFlags As UInteger
    Public dwFourCC As UInteger
    Public Anonymous1 As _Anonymous1_e__Union
    Public Anonymous2 As _Anonymous2_e__Union
    Public Anonymous3 As _Anonymous3_e__Union
    Public Anonymous4 As _Anonymous4_e__Union
    Public Anonymous5 As _Anonymous5_e__Union
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure VIDMEMINFO
    Public fpPrimary As UIntPtr
    Public dwFlags As UInteger
    Public dwDisplayWidth As UInteger
    Public dwDisplayHeight As UInteger
    Public lDisplayPitch As Integer
    Public ddpfDisplay As DDPIXELFORMAT
    Public dwOffscreenAlign As UInteger
    Public dwOverlayAlign As UInteger
    Public dwTextureAlign As UInteger
    Public dwZBufferAlign As UInteger
    Public dwAlphaAlign As UInteger
    Public dwNumHeaps As UInteger
    Public pvmList As IntPtr
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDSCAPS
    Public dwCaps As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDCORECAPS
    Public dwSize As UInteger
    Public dwCaps As UInteger
    Public dwCaps2 As UInteger
    Public dwCKeyCaps As UInteger
    Public dwFXCaps As UInteger
    Public dwFXAlphaCaps As UInteger
    Public dwPalCaps As UInteger
    Public dwSVCaps As UInteger
    Public dwAlphaBltConstBitDepths As UInteger
    Public dwAlphaBltPixelBitDepths As UInteger
    Public dwAlphaBltSurfaceBitDepths As UInteger
    Public dwAlphaOverlayConstBitDepths As UInteger
    Public dwAlphaOverlayPixelBitDepths As UInteger
    Public dwAlphaOverlaySurfaceBitDepths As UInteger
    Public dwZBufferBitDepths As UInteger
    Public dwVidMemTotal As UInteger
    Public dwVidMemFree As UInteger
    Public dwMaxVisibleOverlays As UInteger
    Public dwCurrVisibleOverlays As UInteger
    Public dwNumFourCCCodes As UInteger
    Public dwAlignBoundarySrc As UInteger
    Public dwAlignSizeSrc As UInteger
    Public dwAlignBoundaryDest As UInteger
    Public dwAlignSizeDest As UInteger
    Public dwAlignStrideAlign As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public dwRops() As UInteger
    Public ddsCaps As DDSCAPS
    Public dwMinOverlayStretch As UInteger
    Public dwMaxOverlayStretch As UInteger
    Public dwMinLiveVideoStretch As UInteger
    Public dwMaxLiveVideoStretch As UInteger
    Public dwMinHwCodecStretch As UInteger
    Public dwMaxHwCodecStretch As UInteger
    Public dwReserved1 As UInteger
    Public dwReserved2 As UInteger
    Public dwReserved3 As UInteger
    Public dwSVBCaps As UInteger
    Public dwSVBCKeyCaps As UInteger
    Public dwSVBFXCaps As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public dwSVBRops() As UInteger
    Public dwVSBCaps As UInteger
    Public dwVSBCKeyCaps As UInteger
    Public dwVSBFXCaps As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public dwVSBRops() As UInteger
    Public dwSSBCaps As UInteger
    Public dwSSBCKeyCaps As UInteger
    Public dwSSBFXCaps As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=8)> Public dwSSBRops() As UInteger
    Public dwMaxVideoPorts As UInteger
    Public dwCurrVideoPorts As UInteger
    Public dwSVBCaps2 As UInteger
End Structure

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDHALINFO
    Public dwSize As UInteger
    Public lpDDCallbacks As IntPtr
    Public lpDDSurfaceCallbacks As IntPtr
    Public lpDDPaletteCallbacks As IntPtr
    Public vmiData As VIDMEMINFO
    Public ddCaps As DDCORECAPS
    Public dwMonitorFrequency As UInteger
    Public GetDriverInfo As IntPtr
    Public dwModeIndex As UInteger
    Public lpdwFourCC As IntPtr
    Public dwNumModes As UInteger
    Public lpModeInfo As IntPtr
    Public dwFlags As UInteger
    Public lpPDevice As IntPtr
    Public hInstance As UInteger
    Public lpD3DGlobalDriverData As UIntPtr
    Public lpD3DHALCallbacks As UIntPtr
    Public lpDDExeBufCallbacks As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DDPIXELFORMAT(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("dwFourCC", wintypes.DWORD),
        ("Anonymous1", _Anonymous1_e__Union),
        ("Anonymous2", _Anonymous2_e__Union),
        ("Anonymous3", _Anonymous3_e__Union),
        ("Anonymous4", _Anonymous4_e__Union),
        ("Anonymous5", _Anonymous5_e__Union),
    ]

class VIDMEMINFO(ctypes.Structure):
    _fields_ = [
        ("fpPrimary", ctypes.c_size_t),
        ("dwFlags", wintypes.DWORD),
        ("dwDisplayWidth", wintypes.DWORD),
        ("dwDisplayHeight", wintypes.DWORD),
        ("lDisplayPitch", ctypes.c_int),
        ("ddpfDisplay", DDPIXELFORMAT),
        ("dwOffscreenAlign", wintypes.DWORD),
        ("dwOverlayAlign", wintypes.DWORD),
        ("dwTextureAlign", wintypes.DWORD),
        ("dwZBufferAlign", wintypes.DWORD),
        ("dwAlphaAlign", wintypes.DWORD),
        ("dwNumHeaps", wintypes.DWORD),
        ("pvmList", ctypes.c_void_p),
    ]

class DDSCAPS(ctypes.Structure):
    _fields_ = [
        ("dwCaps", wintypes.DWORD),
    ]

class DDCORECAPS(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwCaps", wintypes.DWORD),
        ("dwCaps2", wintypes.DWORD),
        ("dwCKeyCaps", wintypes.DWORD),
        ("dwFXCaps", wintypes.DWORD),
        ("dwFXAlphaCaps", wintypes.DWORD),
        ("dwPalCaps", wintypes.DWORD),
        ("dwSVCaps", wintypes.DWORD),
        ("dwAlphaBltConstBitDepths", wintypes.DWORD),
        ("dwAlphaBltPixelBitDepths", wintypes.DWORD),
        ("dwAlphaBltSurfaceBitDepths", wintypes.DWORD),
        ("dwAlphaOverlayConstBitDepths", wintypes.DWORD),
        ("dwAlphaOverlayPixelBitDepths", wintypes.DWORD),
        ("dwAlphaOverlaySurfaceBitDepths", wintypes.DWORD),
        ("dwZBufferBitDepths", wintypes.DWORD),
        ("dwVidMemTotal", wintypes.DWORD),
        ("dwVidMemFree", wintypes.DWORD),
        ("dwMaxVisibleOverlays", wintypes.DWORD),
        ("dwCurrVisibleOverlays", wintypes.DWORD),
        ("dwNumFourCCCodes", wintypes.DWORD),
        ("dwAlignBoundarySrc", wintypes.DWORD),
        ("dwAlignSizeSrc", wintypes.DWORD),
        ("dwAlignBoundaryDest", wintypes.DWORD),
        ("dwAlignSizeDest", wintypes.DWORD),
        ("dwAlignStrideAlign", wintypes.DWORD),
        ("dwRops", wintypes.DWORD * 8),
        ("ddsCaps", DDSCAPS),
        ("dwMinOverlayStretch", wintypes.DWORD),
        ("dwMaxOverlayStretch", wintypes.DWORD),
        ("dwMinLiveVideoStretch", wintypes.DWORD),
        ("dwMaxLiveVideoStretch", wintypes.DWORD),
        ("dwMinHwCodecStretch", wintypes.DWORD),
        ("dwMaxHwCodecStretch", wintypes.DWORD),
        ("dwReserved1", wintypes.DWORD),
        ("dwReserved2", wintypes.DWORD),
        ("dwReserved3", wintypes.DWORD),
        ("dwSVBCaps", wintypes.DWORD),
        ("dwSVBCKeyCaps", wintypes.DWORD),
        ("dwSVBFXCaps", wintypes.DWORD),
        ("dwSVBRops", wintypes.DWORD * 8),
        ("dwVSBCaps", wintypes.DWORD),
        ("dwVSBCKeyCaps", wintypes.DWORD),
        ("dwVSBFXCaps", wintypes.DWORD),
        ("dwVSBRops", wintypes.DWORD * 8),
        ("dwSSBCaps", wintypes.DWORD),
        ("dwSSBCKeyCaps", wintypes.DWORD),
        ("dwSSBFXCaps", wintypes.DWORD),
        ("dwSSBRops", wintypes.DWORD * 8),
        ("dwMaxVideoPorts", wintypes.DWORD),
        ("dwCurrVideoPorts", wintypes.DWORD),
        ("dwSVBCaps2", wintypes.DWORD),
    ]

class DDHALINFO(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("lpDDCallbacks", ctypes.c_void_p),
        ("lpDDSurfaceCallbacks", ctypes.c_void_p),
        ("lpDDPaletteCallbacks", ctypes.c_void_p),
        ("vmiData", VIDMEMINFO),
        ("ddCaps", DDCORECAPS),
        ("dwMonitorFrequency", wintypes.DWORD),
        ("GetDriverInfo", ctypes.c_void_p),
        ("dwModeIndex", wintypes.DWORD),
        ("lpdwFourCC", ctypes.c_void_p),
        ("dwNumModes", wintypes.DWORD),
        ("lpModeInfo", ctypes.c_void_p),
        ("dwFlags", wintypes.DWORD),
        ("lpPDevice", ctypes.c_void_p),
        ("hInstance", wintypes.DWORD),
        ("lpD3DGlobalDriverData", ctypes.c_size_t),
        ("lpD3DHALCallbacks", ctypes.c_size_t),
        ("lpDDExeBufCallbacks", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DDPIXELFORMAT {
    pub dwSize: u32,
    pub dwFlags: u32,
    pub dwFourCC: u32,
    pub Anonymous1: _Anonymous1_e__Union,
    pub Anonymous2: _Anonymous2_e__Union,
    pub Anonymous3: _Anonymous3_e__Union,
    pub Anonymous4: _Anonymous4_e__Union,
    pub Anonymous5: _Anonymous5_e__Union,
}

#[repr(C)]
pub struct VIDMEMINFO {
    pub fpPrimary: usize,
    pub dwFlags: u32,
    pub dwDisplayWidth: u32,
    pub dwDisplayHeight: u32,
    pub lDisplayPitch: i32,
    pub ddpfDisplay: DDPIXELFORMAT,
    pub dwOffscreenAlign: u32,
    pub dwOverlayAlign: u32,
    pub dwTextureAlign: u32,
    pub dwZBufferAlign: u32,
    pub dwAlphaAlign: u32,
    pub dwNumHeaps: u32,
    pub pvmList: *mut core::ffi::c_void,
}

#[repr(C)]
pub struct DDSCAPS {
    pub dwCaps: u32,
}

#[repr(C)]
pub struct DDCORECAPS {
    pub dwSize: u32,
    pub dwCaps: u32,
    pub dwCaps2: u32,
    pub dwCKeyCaps: u32,
    pub dwFXCaps: u32,
    pub dwFXAlphaCaps: u32,
    pub dwPalCaps: u32,
    pub dwSVCaps: u32,
    pub dwAlphaBltConstBitDepths: u32,
    pub dwAlphaBltPixelBitDepths: u32,
    pub dwAlphaBltSurfaceBitDepths: u32,
    pub dwAlphaOverlayConstBitDepths: u32,
    pub dwAlphaOverlayPixelBitDepths: u32,
    pub dwAlphaOverlaySurfaceBitDepths: u32,
    pub dwZBufferBitDepths: u32,
    pub dwVidMemTotal: u32,
    pub dwVidMemFree: u32,
    pub dwMaxVisibleOverlays: u32,
    pub dwCurrVisibleOverlays: u32,
    pub dwNumFourCCCodes: u32,
    pub dwAlignBoundarySrc: u32,
    pub dwAlignSizeSrc: u32,
    pub dwAlignBoundaryDest: u32,
    pub dwAlignSizeDest: u32,
    pub dwAlignStrideAlign: u32,
    pub dwRops: [u32; 8],
    pub ddsCaps: DDSCAPS,
    pub dwMinOverlayStretch: u32,
    pub dwMaxOverlayStretch: u32,
    pub dwMinLiveVideoStretch: u32,
    pub dwMaxLiveVideoStretch: u32,
    pub dwMinHwCodecStretch: u32,
    pub dwMaxHwCodecStretch: u32,
    pub dwReserved1: u32,
    pub dwReserved2: u32,
    pub dwReserved3: u32,
    pub dwSVBCaps: u32,
    pub dwSVBCKeyCaps: u32,
    pub dwSVBFXCaps: u32,
    pub dwSVBRops: [u32; 8],
    pub dwVSBCaps: u32,
    pub dwVSBCKeyCaps: u32,
    pub dwVSBFXCaps: u32,
    pub dwVSBRops: [u32; 8],
    pub dwSSBCaps: u32,
    pub dwSSBCKeyCaps: u32,
    pub dwSSBFXCaps: u32,
    pub dwSSBRops: [u32; 8],
    pub dwMaxVideoPorts: u32,
    pub dwCurrVideoPorts: u32,
    pub dwSVBCaps2: u32,
}

#[repr(C)]
pub struct DDHALINFO {
    pub dwSize: u32,
    pub lpDDCallbacks: *mut core::ffi::c_void,
    pub lpDDSurfaceCallbacks: *mut core::ffi::c_void,
    pub lpDDPaletteCallbacks: *mut core::ffi::c_void,
    pub vmiData: VIDMEMINFO,
    pub ddCaps: DDCORECAPS,
    pub dwMonitorFrequency: u32,
    pub GetDriverInfo: *mut core::ffi::c_void,
    pub dwModeIndex: u32,
    pub lpdwFourCC: *mut core::ffi::c_void,
    pub dwNumModes: u32,
    pub lpModeInfo: *mut core::ffi::c_void,
    pub dwFlags: u32,
    pub lpPDevice: *mut core::ffi::c_void,
    pub hInstance: u32,
    pub lpD3DGlobalDriverData: usize,
    pub lpD3DHALCallbacks: usize,
    pub lpDDExeBufCallbacks: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DDPIXELFORMAT struct {
	dwSize uint32
	dwFlags uint32
	dwFourCC uint32
	Anonymous1 _Anonymous1_e__Union
	Anonymous2 _Anonymous2_e__Union
	Anonymous3 _Anonymous3_e__Union
	Anonymous4 _Anonymous4_e__Union
	Anonymous5 _Anonymous5_e__Union
}

type VIDMEMINFO struct {
	fpPrimary uintptr
	dwFlags uint32
	dwDisplayWidth uint32
	dwDisplayHeight uint32
	lDisplayPitch int32
	ddpfDisplay DDPIXELFORMAT
	dwOffscreenAlign uint32
	dwOverlayAlign uint32
	dwTextureAlign uint32
	dwZBufferAlign uint32
	dwAlphaAlign uint32
	dwNumHeaps uint32
	pvmList uintptr
}

type DDSCAPS struct {
	dwCaps uint32
}

type DDCORECAPS struct {
	dwSize uint32
	dwCaps uint32
	dwCaps2 uint32
	dwCKeyCaps uint32
	dwFXCaps uint32
	dwFXAlphaCaps uint32
	dwPalCaps uint32
	dwSVCaps uint32
	dwAlphaBltConstBitDepths uint32
	dwAlphaBltPixelBitDepths uint32
	dwAlphaBltSurfaceBitDepths uint32
	dwAlphaOverlayConstBitDepths uint32
	dwAlphaOverlayPixelBitDepths uint32
	dwAlphaOverlaySurfaceBitDepths uint32
	dwZBufferBitDepths uint32
	dwVidMemTotal uint32
	dwVidMemFree uint32
	dwMaxVisibleOverlays uint32
	dwCurrVisibleOverlays uint32
	dwNumFourCCCodes uint32
	dwAlignBoundarySrc uint32
	dwAlignSizeSrc uint32
	dwAlignBoundaryDest uint32
	dwAlignSizeDest uint32
	dwAlignStrideAlign uint32
	dwRops [8]uint32
	ddsCaps DDSCAPS
	dwMinOverlayStretch uint32
	dwMaxOverlayStretch uint32
	dwMinLiveVideoStretch uint32
	dwMaxLiveVideoStretch uint32
	dwMinHwCodecStretch uint32
	dwMaxHwCodecStretch uint32
	dwReserved1 uint32
	dwReserved2 uint32
	dwReserved3 uint32
	dwSVBCaps uint32
	dwSVBCKeyCaps uint32
	dwSVBFXCaps uint32
	dwSVBRops [8]uint32
	dwVSBCaps uint32
	dwVSBCKeyCaps uint32
	dwVSBFXCaps uint32
	dwVSBRops [8]uint32
	dwSSBCaps uint32
	dwSSBCKeyCaps uint32
	dwSSBFXCaps uint32
	dwSSBRops [8]uint32
	dwMaxVideoPorts uint32
	dwCurrVideoPorts uint32
	dwSVBCaps2 uint32
}

type DDHALINFO struct {
	dwSize uint32
	lpDDCallbacks uintptr
	lpDDSurfaceCallbacks uintptr
	lpDDPaletteCallbacks uintptr
	vmiData VIDMEMINFO
	ddCaps DDCORECAPS
	dwMonitorFrequency uint32
	GetDriverInfo uintptr
	dwModeIndex uint32
	lpdwFourCC uintptr
	dwNumModes uint32
	lpModeInfo uintptr
	dwFlags uint32
	lpPDevice uintptr
	hInstance uint32
	lpD3DGlobalDriverData uintptr
	lpD3DHALCallbacks uintptr
	lpDDExeBufCallbacks uintptr
}
type
  DDPIXELFORMAT = record
    dwSize: DWORD;
    dwFlags: DWORD;
    dwFourCC: DWORD;
    Anonymous1: _Anonymous1_e__Union;
    Anonymous2: _Anonymous2_e__Union;
    Anonymous3: _Anonymous3_e__Union;
    Anonymous4: _Anonymous4_e__Union;
    Anonymous5: _Anonymous5_e__Union;
  end;

  VIDMEMINFO = record
    fpPrimary: NativeUInt;
    dwFlags: DWORD;
    dwDisplayWidth: DWORD;
    dwDisplayHeight: DWORD;
    lDisplayPitch: Integer;
    ddpfDisplay: DDPIXELFORMAT;
    dwOffscreenAlign: DWORD;
    dwOverlayAlign: DWORD;
    dwTextureAlign: DWORD;
    dwZBufferAlign: DWORD;
    dwAlphaAlign: DWORD;
    dwNumHeaps: DWORD;
    pvmList: Pointer;
  end;

  DDSCAPS = record
    dwCaps: DWORD;
  end;

  DDCORECAPS = record
    dwSize: DWORD;
    dwCaps: DWORD;
    dwCaps2: DWORD;
    dwCKeyCaps: DWORD;
    dwFXCaps: DWORD;
    dwFXAlphaCaps: DWORD;
    dwPalCaps: DWORD;
    dwSVCaps: DWORD;
    dwAlphaBltConstBitDepths: DWORD;
    dwAlphaBltPixelBitDepths: DWORD;
    dwAlphaBltSurfaceBitDepths: DWORD;
    dwAlphaOverlayConstBitDepths: DWORD;
    dwAlphaOverlayPixelBitDepths: DWORD;
    dwAlphaOverlaySurfaceBitDepths: DWORD;
    dwZBufferBitDepths: DWORD;
    dwVidMemTotal: DWORD;
    dwVidMemFree: DWORD;
    dwMaxVisibleOverlays: DWORD;
    dwCurrVisibleOverlays: DWORD;
    dwNumFourCCCodes: DWORD;
    dwAlignBoundarySrc: DWORD;
    dwAlignSizeSrc: DWORD;
    dwAlignBoundaryDest: DWORD;
    dwAlignSizeDest: DWORD;
    dwAlignStrideAlign: DWORD;
    dwRops: array[0..7] of DWORD;
    ddsCaps: DDSCAPS;
    dwMinOverlayStretch: DWORD;
    dwMaxOverlayStretch: DWORD;
    dwMinLiveVideoStretch: DWORD;
    dwMaxLiveVideoStretch: DWORD;
    dwMinHwCodecStretch: DWORD;
    dwMaxHwCodecStretch: DWORD;
    dwReserved1: DWORD;
    dwReserved2: DWORD;
    dwReserved3: DWORD;
    dwSVBCaps: DWORD;
    dwSVBCKeyCaps: DWORD;
    dwSVBFXCaps: DWORD;
    dwSVBRops: array[0..7] of DWORD;
    dwVSBCaps: DWORD;
    dwVSBCKeyCaps: DWORD;
    dwVSBFXCaps: DWORD;
    dwVSBRops: array[0..7] of DWORD;
    dwSSBCaps: DWORD;
    dwSSBCKeyCaps: DWORD;
    dwSSBFXCaps: DWORD;
    dwSSBRops: array[0..7] of DWORD;
    dwMaxVideoPorts: DWORD;
    dwCurrVideoPorts: DWORD;
    dwSVBCaps2: DWORD;
  end;

  DDHALINFO = record
    dwSize: DWORD;
    lpDDCallbacks: Pointer;
    lpDDSurfaceCallbacks: Pointer;
    lpDDPaletteCallbacks: Pointer;
    vmiData: VIDMEMINFO;
    ddCaps: DDCORECAPS;
    dwMonitorFrequency: DWORD;
    GetDriverInfo: Pointer;
    dwModeIndex: DWORD;
    lpdwFourCC: Pointer;
    dwNumModes: DWORD;
    lpModeInfo: Pointer;
    dwFlags: DWORD;
    lpPDevice: Pointer;
    hInstance: DWORD;
    lpD3DGlobalDriverData: NativeUInt;
    lpD3DHALCallbacks: NativeUInt;
    lpDDExeBufCallbacks: Pointer;
  end;
const DDPIXELFORMAT = extern struct {
    dwSize: u32,
    dwFlags: u32,
    dwFourCC: u32,
    Anonymous1: _Anonymous1_e__Union,
    Anonymous2: _Anonymous2_e__Union,
    Anonymous3: _Anonymous3_e__Union,
    Anonymous4: _Anonymous4_e__Union,
    Anonymous5: _Anonymous5_e__Union,
};

const VIDMEMINFO = extern struct {
    fpPrimary: usize,
    dwFlags: u32,
    dwDisplayWidth: u32,
    dwDisplayHeight: u32,
    lDisplayPitch: i32,
    ddpfDisplay: DDPIXELFORMAT,
    dwOffscreenAlign: u32,
    dwOverlayAlign: u32,
    dwTextureAlign: u32,
    dwZBufferAlign: u32,
    dwAlphaAlign: u32,
    dwNumHeaps: u32,
    pvmList: ?*anyopaque,
};

const DDSCAPS = extern struct {
    dwCaps: u32,
};

const DDCORECAPS = extern struct {
    dwSize: u32,
    dwCaps: u32,
    dwCaps2: u32,
    dwCKeyCaps: u32,
    dwFXCaps: u32,
    dwFXAlphaCaps: u32,
    dwPalCaps: u32,
    dwSVCaps: u32,
    dwAlphaBltConstBitDepths: u32,
    dwAlphaBltPixelBitDepths: u32,
    dwAlphaBltSurfaceBitDepths: u32,
    dwAlphaOverlayConstBitDepths: u32,
    dwAlphaOverlayPixelBitDepths: u32,
    dwAlphaOverlaySurfaceBitDepths: u32,
    dwZBufferBitDepths: u32,
    dwVidMemTotal: u32,
    dwVidMemFree: u32,
    dwMaxVisibleOverlays: u32,
    dwCurrVisibleOverlays: u32,
    dwNumFourCCCodes: u32,
    dwAlignBoundarySrc: u32,
    dwAlignSizeSrc: u32,
    dwAlignBoundaryDest: u32,
    dwAlignSizeDest: u32,
    dwAlignStrideAlign: u32,
    dwRops: [8]u32,
    ddsCaps: DDSCAPS,
    dwMinOverlayStretch: u32,
    dwMaxOverlayStretch: u32,
    dwMinLiveVideoStretch: u32,
    dwMaxLiveVideoStretch: u32,
    dwMinHwCodecStretch: u32,
    dwMaxHwCodecStretch: u32,
    dwReserved1: u32,
    dwReserved2: u32,
    dwReserved3: u32,
    dwSVBCaps: u32,
    dwSVBCKeyCaps: u32,
    dwSVBFXCaps: u32,
    dwSVBRops: [8]u32,
    dwVSBCaps: u32,
    dwVSBCKeyCaps: u32,
    dwVSBFXCaps: u32,
    dwVSBRops: [8]u32,
    dwSSBCaps: u32,
    dwSSBCKeyCaps: u32,
    dwSSBFXCaps: u32,
    dwSSBRops: [8]u32,
    dwMaxVideoPorts: u32,
    dwCurrVideoPorts: u32,
    dwSVBCaps2: u32,
};

const DDHALINFO = extern struct {
    dwSize: u32,
    lpDDCallbacks: ?*anyopaque,
    lpDDSurfaceCallbacks: ?*anyopaque,
    lpDDPaletteCallbacks: ?*anyopaque,
    vmiData: VIDMEMINFO,
    ddCaps: DDCORECAPS,
    dwMonitorFrequency: u32,
    GetDriverInfo: ?*anyopaque,
    dwModeIndex: u32,
    lpdwFourCC: ?*anyopaque,
    dwNumModes: u32,
    lpModeInfo: ?*anyopaque,
    dwFlags: u32,
    lpPDevice: ?*anyopaque,
    hInstance: u32,
    lpD3DGlobalDriverData: usize,
    lpD3DHALCallbacks: usize,
    lpDDExeBufCallbacks: ?*anyopaque,
};
type
  DDPIXELFORMAT {.bycopy.} = object
    dwSize: uint32
    dwFlags: uint32
    dwFourCC: uint32
    Anonymous1: _Anonymous1_e__Union
    Anonymous2: _Anonymous2_e__Union
    Anonymous3: _Anonymous3_e__Union
    Anonymous4: _Anonymous4_e__Union
    Anonymous5: _Anonymous5_e__Union

  VIDMEMINFO {.bycopy.} = object
    fpPrimary: uint
    dwFlags: uint32
    dwDisplayWidth: uint32
    dwDisplayHeight: uint32
    lDisplayPitch: int32
    ddpfDisplay: DDPIXELFORMAT
    dwOffscreenAlign: uint32
    dwOverlayAlign: uint32
    dwTextureAlign: uint32
    dwZBufferAlign: uint32
    dwAlphaAlign: uint32
    dwNumHeaps: uint32
    pvmList: pointer

  DDSCAPS {.bycopy.} = object
    dwCaps: uint32

  DDCORECAPS {.bycopy.} = object
    dwSize: uint32
    dwCaps: uint32
    dwCaps2: uint32
    dwCKeyCaps: uint32
    dwFXCaps: uint32
    dwFXAlphaCaps: uint32
    dwPalCaps: uint32
    dwSVCaps: uint32
    dwAlphaBltConstBitDepths: uint32
    dwAlphaBltPixelBitDepths: uint32
    dwAlphaBltSurfaceBitDepths: uint32
    dwAlphaOverlayConstBitDepths: uint32
    dwAlphaOverlayPixelBitDepths: uint32
    dwAlphaOverlaySurfaceBitDepths: uint32
    dwZBufferBitDepths: uint32
    dwVidMemTotal: uint32
    dwVidMemFree: uint32
    dwMaxVisibleOverlays: uint32
    dwCurrVisibleOverlays: uint32
    dwNumFourCCCodes: uint32
    dwAlignBoundarySrc: uint32
    dwAlignSizeSrc: uint32
    dwAlignBoundaryDest: uint32
    dwAlignSizeDest: uint32
    dwAlignStrideAlign: uint32
    dwRops: array[8, uint32]
    ddsCaps: DDSCAPS
    dwMinOverlayStretch: uint32
    dwMaxOverlayStretch: uint32
    dwMinLiveVideoStretch: uint32
    dwMaxLiveVideoStretch: uint32
    dwMinHwCodecStretch: uint32
    dwMaxHwCodecStretch: uint32
    dwReserved1: uint32
    dwReserved2: uint32
    dwReserved3: uint32
    dwSVBCaps: uint32
    dwSVBCKeyCaps: uint32
    dwSVBFXCaps: uint32
    dwSVBRops: array[8, uint32]
    dwVSBCaps: uint32
    dwVSBCKeyCaps: uint32
    dwVSBFXCaps: uint32
    dwVSBRops: array[8, uint32]
    dwSSBCaps: uint32
    dwSSBCKeyCaps: uint32
    dwSSBFXCaps: uint32
    dwSSBRops: array[8, uint32]
    dwMaxVideoPorts: uint32
    dwCurrVideoPorts: uint32
    dwSVBCaps2: uint32

  DDHALINFO {.bycopy.} = object
    dwSize: uint32
    lpDDCallbacks: pointer
    lpDDSurfaceCallbacks: pointer
    lpDDPaletteCallbacks: pointer
    vmiData: VIDMEMINFO
    ddCaps: DDCORECAPS
    dwMonitorFrequency: uint32
    GetDriverInfo: pointer
    dwModeIndex: uint32
    lpdwFourCC: pointer
    dwNumModes: uint32
    lpModeInfo: pointer
    dwFlags: uint32
    lpPDevice: pointer
    hInstance: uint32
    lpD3DGlobalDriverData: uint
    lpD3DHALCallbacks: uint
    lpDDExeBufCallbacks: pointer
struct DDPIXELFORMAT
{
    uint dwSize;
    uint dwFlags;
    uint dwFourCC;
    _Anonymous1_e__Union Anonymous1;
    _Anonymous2_e__Union Anonymous2;
    _Anonymous3_e__Union Anonymous3;
    _Anonymous4_e__Union Anonymous4;
    _Anonymous5_e__Union Anonymous5;
}

struct VIDMEMINFO
{
    size_t fpPrimary;
    uint dwFlags;
    uint dwDisplayWidth;
    uint dwDisplayHeight;
    int lDisplayPitch;
    DDPIXELFORMAT ddpfDisplay;
    uint dwOffscreenAlign;
    uint dwOverlayAlign;
    uint dwTextureAlign;
    uint dwZBufferAlign;
    uint dwAlphaAlign;
    uint dwNumHeaps;
    void* pvmList;
}

struct DDSCAPS
{
    uint dwCaps;
}

struct DDCORECAPS
{
    uint dwSize;
    uint dwCaps;
    uint dwCaps2;
    uint dwCKeyCaps;
    uint dwFXCaps;
    uint dwFXAlphaCaps;
    uint dwPalCaps;
    uint dwSVCaps;
    uint dwAlphaBltConstBitDepths;
    uint dwAlphaBltPixelBitDepths;
    uint dwAlphaBltSurfaceBitDepths;
    uint dwAlphaOverlayConstBitDepths;
    uint dwAlphaOverlayPixelBitDepths;
    uint dwAlphaOverlaySurfaceBitDepths;
    uint dwZBufferBitDepths;
    uint dwVidMemTotal;
    uint dwVidMemFree;
    uint dwMaxVisibleOverlays;
    uint dwCurrVisibleOverlays;
    uint dwNumFourCCCodes;
    uint dwAlignBoundarySrc;
    uint dwAlignSizeSrc;
    uint dwAlignBoundaryDest;
    uint dwAlignSizeDest;
    uint dwAlignStrideAlign;
    uint[8] dwRops;
    DDSCAPS ddsCaps;
    uint dwMinOverlayStretch;
    uint dwMaxOverlayStretch;
    uint dwMinLiveVideoStretch;
    uint dwMaxLiveVideoStretch;
    uint dwMinHwCodecStretch;
    uint dwMaxHwCodecStretch;
    uint dwReserved1;
    uint dwReserved2;
    uint dwReserved3;
    uint dwSVBCaps;
    uint dwSVBCKeyCaps;
    uint dwSVBFXCaps;
    uint[8] dwSVBRops;
    uint dwVSBCaps;
    uint dwVSBCKeyCaps;
    uint dwVSBFXCaps;
    uint[8] dwVSBRops;
    uint dwSSBCaps;
    uint dwSSBCKeyCaps;
    uint dwSSBFXCaps;
    uint[8] dwSSBRops;
    uint dwMaxVideoPorts;
    uint dwCurrVideoPorts;
    uint dwSVBCaps2;
}

struct DDHALINFO
{
    uint dwSize;
    void* lpDDCallbacks;
    void* lpDDSurfaceCallbacks;
    void* lpDDPaletteCallbacks;
    VIDMEMINFO vmiData;
    DDCORECAPS ddCaps;
    uint dwMonitorFrequency;
    void* GetDriverInfo;
    uint dwModeIndex;
    void* lpdwFourCC;
    uint dwNumModes;
    void* lpModeInfo;
    uint dwFlags;
    void* lpPDevice;
    uint hInstance;
    size_t lpD3DGlobalDriverData;
    size_t lpD3DHALCallbacks;
    void* lpDDExeBufCallbacks;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDHALINFO サイズ: 460 バイト(x86)
dim st, 115    ; 4byte整数×115(構造体サイズ 460 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpDDCallbacks : DDHAL_DDCALLBACKS* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; lpDDSurfaceCallbacks : DDHAL_DDSURFACECALLBACKS* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; lpDDPaletteCallbacks : DDHAL_DDPALETTECALLBACKS* (+12, 4byte)  varptr(st)+12 を基点に操作(4byte:入れ子/配列)
; vmiData : VIDMEMINFO (+16, 80byte)  varptr(st)+16 を基点に操作(80byte:入れ子/配列)
; ddCaps : DDCORECAPS (+96, 316byte)  varptr(st)+96 を基点に操作(316byte:入れ子/配列)
; dwMonitorFrequency : DWORD (+412, 4byte)  st.103 = 値  /  値 = st.103   (lpoke/lpeek も可)
; GetDriverInfo : LPDDHAL_GETDRIVERINFO (+416, 4byte)  st.104 = 値  /  値 = st.104   (lpoke/lpeek も可)
; dwModeIndex : DWORD (+420, 4byte)  st.105 = 値  /  値 = st.105   (lpoke/lpeek も可)
; lpdwFourCC : DWORD* (+424, 4byte)  st.106 = 値  /  値 = st.106   (lpoke/lpeek も可)
; dwNumModes : DWORD (+428, 4byte)  st.107 = 値  /  値 = st.107   (lpoke/lpeek も可)
; lpModeInfo : DDHALMODEINFO* (+432, 4byte)  varptr(st)+432 を基点に操作(4byte:入れ子/配列)
; dwFlags : DWORD (+436, 4byte)  st.109 = 値  /  値 = st.109   (lpoke/lpeek も可)
; lpPDevice : void* (+440, 4byte)  st.110 = 値  /  値 = st.110   (lpoke/lpeek も可)
; hInstance : DWORD (+444, 4byte)  st.111 = 値  /  値 = st.111   (lpoke/lpeek も可)
; lpD3DGlobalDriverData : UINT_PTR (+448, 4byte)  st.112 = 値  /  値 = st.112   (lpoke/lpeek も可)
; lpD3DHALCallbacks : UINT_PTR (+452, 4byte)  st.113 = 値  /  値 = st.113   (lpoke/lpeek も可)
; lpDDExeBufCallbacks : DDHAL_DDEXEBUFCALLBACKS* (+456, 4byte)  varptr(st)+456 を基点に操作(4byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDHALINFO サイズ: 536 バイト(x64)
dim st, 134    ; 4byte整数×134(構造体サイズ 536 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpDDCallbacks : DDHAL_DDCALLBACKS* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lpDDSurfaceCallbacks : DDHAL_DDSURFACECALLBACKS* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; lpDDPaletteCallbacks : DDHAL_DDPALETTECALLBACKS* (+24, 8byte)  varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; vmiData : VIDMEMINFO (+32, 96byte)  varptr(st)+32 を基点に操作(96byte:入れ子/配列)
; ddCaps : DDCORECAPS (+128, 316byte)  varptr(st)+128 を基点に操作(316byte:入れ子/配列)
; dwMonitorFrequency : DWORD (+444, 4byte)  st.111 = 値  /  値 = st.111   (lpoke/lpeek も可)
; GetDriverInfo : LPDDHAL_GETDRIVERINFO (+448, 8byte)  qpoke st,448,値 / qpeek(st,448)  ※IronHSPのみ。3.7/3.8は lpoke st,448,下位 : lpoke st,452,上位
; dwModeIndex : DWORD (+456, 4byte)  st.114 = 値  /  値 = st.114   (lpoke/lpeek も可)
; lpdwFourCC : DWORD* (+464, 8byte)  qpoke st,464,値 / qpeek(st,464)  ※IronHSPのみ。3.7/3.8は lpoke st,464,下位 : lpoke st,468,上位
; dwNumModes : DWORD (+472, 4byte)  st.118 = 値  /  値 = st.118   (lpoke/lpeek も可)
; lpModeInfo : DDHALMODEINFO* (+480, 8byte)  varptr(st)+480 を基点に操作(8byte:入れ子/配列)
; dwFlags : DWORD (+488, 4byte)  st.122 = 値  /  値 = st.122   (lpoke/lpeek も可)
; lpPDevice : void* (+496, 8byte)  qpoke st,496,値 / qpeek(st,496)  ※IronHSPのみ。3.7/3.8は lpoke st,496,下位 : lpoke st,500,上位
; hInstance : DWORD (+504, 4byte)  st.126 = 値  /  値 = st.126   (lpoke/lpeek も可)
; lpD3DGlobalDriverData : UINT_PTR (+512, 8byte)  qpoke st,512,値 / qpeek(st,512)  ※IronHSPのみ。3.7/3.8は lpoke st,512,下位 : lpoke st,516,上位
; lpD3DHALCallbacks : UINT_PTR (+520, 8byte)  qpoke st,520,値 / qpeek(st,520)  ※IronHSPのみ。3.7/3.8は lpoke st,520,下位 : lpoke st,524,上位
; lpDDExeBufCallbacks : DDHAL_DDEXEBUFCALLBACKS* (+528, 8byte)  varptr(st)+528 を基点に操作(8byte:入れ子/配列)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
; ※GUID・入れ子構造体はデフォルト型でないため、依存する #defstruct を先に定義(下記に同梱)。
#defstruct global DDPIXELFORMAT
    #field int dwSize
    #field int dwFlags
    #field int dwFourCC
    #field byte Anonymous1 4
    #field byte Anonymous2 4
    #field byte Anonymous3 8
    #field byte Anonymous4 4
    #field byte Anonymous5 4
#endstruct

#defstruct global VIDMEMINFO
    #field intptr fpPrimary
    #field int dwFlags
    #field int dwDisplayWidth
    #field int dwDisplayHeight
    #field int lDisplayPitch
    #field DDPIXELFORMAT ddpfDisplay
    #field int dwOffscreenAlign
    #field int dwOverlayAlign
    #field int dwTextureAlign
    #field int dwZBufferAlign
    #field int dwAlphaAlign
    #field int dwNumHeaps
    #field intptr pvmList
#endstruct

#defstruct global DDSCAPS
    #field int dwCaps
#endstruct

#defstruct global DDCORECAPS
    #field int dwSize
    #field int dwCaps
    #field int dwCaps2
    #field int dwCKeyCaps
    #field int dwFXCaps
    #field int dwFXAlphaCaps
    #field int dwPalCaps
    #field int dwSVCaps
    #field int dwAlphaBltConstBitDepths
    #field int dwAlphaBltPixelBitDepths
    #field int dwAlphaBltSurfaceBitDepths
    #field int dwAlphaOverlayConstBitDepths
    #field int dwAlphaOverlayPixelBitDepths
    #field int dwAlphaOverlaySurfaceBitDepths
    #field int dwZBufferBitDepths
    #field int dwVidMemTotal
    #field int dwVidMemFree
    #field int dwMaxVisibleOverlays
    #field int dwCurrVisibleOverlays
    #field int dwNumFourCCCodes
    #field int dwAlignBoundarySrc
    #field int dwAlignSizeSrc
    #field int dwAlignBoundaryDest
    #field int dwAlignSizeDest
    #field int dwAlignStrideAlign
    #field int dwRops 8
    #field DDSCAPS ddsCaps
    #field int dwMinOverlayStretch
    #field int dwMaxOverlayStretch
    #field int dwMinLiveVideoStretch
    #field int dwMaxLiveVideoStretch
    #field int dwMinHwCodecStretch
    #field int dwMaxHwCodecStretch
    #field int dwReserved1
    #field int dwReserved2
    #field int dwReserved3
    #field int dwSVBCaps
    #field int dwSVBCKeyCaps
    #field int dwSVBFXCaps
    #field int dwSVBRops 8
    #field int dwVSBCaps
    #field int dwVSBCKeyCaps
    #field int dwVSBFXCaps
    #field int dwVSBRops 8
    #field int dwSSBCaps
    #field int dwSSBCKeyCaps
    #field int dwSSBFXCaps
    #field int dwSSBRops 8
    #field int dwMaxVideoPorts
    #field int dwCurrVideoPorts
    #field int dwSVBCaps2
#endstruct

#defstruct global DDHALINFO
    #field int dwSize
    #field intptr lpDDCallbacks
    #field intptr lpDDSurfaceCallbacks
    #field intptr lpDDPaletteCallbacks
    #field VIDMEMINFO vmiData
    #field DDCORECAPS ddCaps
    #field int dwMonitorFrequency
    #field intptr GetDriverInfo
    #field int dwModeIndex
    #field intptr lpdwFourCC
    #field int dwNumModes
    #field intptr lpModeInfo
    #field int dwFlags
    #field intptr lpPDevice
    #field int hInstance
    #field intptr lpD3DGlobalDriverData
    #field intptr lpD3DHALCallbacks
    #field intptr lpDDExeBufCallbacks
#endstruct

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