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

DDRAWI_DDRAWSURFACE_GBL_MORE

構造体
サイズx64: 144 バイト / x86: 76 バイト

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0構造体サイズ(バイト数)。呼び出し前に設定する。
Anonymous_Anonymous_e__Union8/4+8+4ピクセル形式またはFourCC等を保持する共用体。
pPageTableDWORD*8/4+16+8サーフェスのページテーブル(DWORD配列)へのポインタ。
cPagesDWORD4+24+12ページテーブルのページ数を示す。
dwSavedDCContextUINT_PTR8/4+32+16保存されたデバイスコンテキストの情報を示す。
fpAliasedVidMemUINT_PTR8/4+40+20エイリアスされたビデオメモリのアドレスを示す。
dwDriverReservedUINT_PTR8/4+48+24ドライバが利用する予約値を示す。
dwHELReservedUINT_PTR8/4+56+28HEL(ソフトウェアエミュレーション層)用の予約値を示す。
cPageUnlocksDWORD4+64+32ページアンロック回数を示す。
hKernelSurfaceUINT_PTR8/4+72+36カーネルモードサーフェスのハンドルを示す。
dwKernelRefCntDWORD4+80+40カーネルサーフェスの参照カウントを示す。
lpColorInfoDDCOLORCONTROL*8/4+88+44色調整情報(DDCOLORCONTROL)へのポインタ。NULL可。
fpNTAliasUINT_PTR8/4+96+48NT環境でのエイリアスアドレスを示す。
dwContentsStampDWORD4+104+52サーフェス内容の更新を追跡するスタンプ値を示す。
lpvUnswappedDriverReservedvoid*8/4+112+56スワップ非対象のドライバ予約データへのポインタ。
lpDDRAWReserved2void*8/4+120+60DirectDraw内部用の予約ポインタ(その2)。
dwDDRAWReserved1DWORD4+128+64DirectDraw内部用の予約フィールド(その1)。
dwDDRAWReserved2DWORD4+132+68DirectDraw内部用の予約フィールド(その2)。
fpAliasOfVidMemUINT_PTR8/4+136+72エイリアス元のビデオメモリアドレスを示す。

共用体: _Anonymous_e__Union x64 8B / x86 4B

フィールドサイズx64x86
dwPhysicalPageTableDWORD4+0+0
fpPhysicalVidMemUINT_PTR8/4+0+0

各言語での定義

#include <windows.h>

// DDRAWI_DDRAWSURFACE_GBL_MORE  (x64 144 / x86 76 バイト)
typedef struct DDRAWI_DDRAWSURFACE_GBL_MORE {
    DWORD dwSize;
    _Anonymous_e__Union Anonymous;
    DWORD* pPageTable;
    DWORD cPages;
    UINT_PTR dwSavedDCContext;
    UINT_PTR fpAliasedVidMem;
    UINT_PTR dwDriverReserved;
    UINT_PTR dwHELReserved;
    DWORD cPageUnlocks;
    UINT_PTR hKernelSurface;
    DWORD dwKernelRefCnt;
    DDCOLORCONTROL* lpColorInfo;
    UINT_PTR fpNTAlias;
    DWORD dwContentsStamp;
    void* lpvUnswappedDriverReserved;
    void* lpDDRAWReserved2;
    DWORD dwDDRAWReserved1;
    DWORD dwDDRAWReserved2;
    UINT_PTR fpAliasOfVidMem;
} DDRAWI_DDRAWSURFACE_GBL_MORE;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDRAWI_DDRAWSURFACE_GBL_MORE
{
    public uint dwSize;
    public _Anonymous_e__Union Anonymous;
    public IntPtr pPageTable;
    public uint cPages;
    public UIntPtr dwSavedDCContext;
    public UIntPtr fpAliasedVidMem;
    public UIntPtr dwDriverReserved;
    public UIntPtr dwHELReserved;
    public uint cPageUnlocks;
    public UIntPtr hKernelSurface;
    public uint dwKernelRefCnt;
    public IntPtr lpColorInfo;
    public UIntPtr fpNTAlias;
    public uint dwContentsStamp;
    public IntPtr lpvUnswappedDriverReserved;
    public IntPtr lpDDRAWReserved2;
    public uint dwDDRAWReserved1;
    public uint dwDDRAWReserved2;
    public UIntPtr fpAliasOfVidMem;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDRAWI_DDRAWSURFACE_GBL_MORE
    Public dwSize As UInteger
    Public Anonymous As _Anonymous_e__Union
    Public pPageTable As IntPtr
    Public cPages As UInteger
    Public dwSavedDCContext As UIntPtr
    Public fpAliasedVidMem As UIntPtr
    Public dwDriverReserved As UIntPtr
    Public dwHELReserved As UIntPtr
    Public cPageUnlocks As UInteger
    Public hKernelSurface As UIntPtr
    Public dwKernelRefCnt As UInteger
    Public lpColorInfo As IntPtr
    Public fpNTAlias As UIntPtr
    Public dwContentsStamp As UInteger
    Public lpvUnswappedDriverReserved As IntPtr
    Public lpDDRAWReserved2 As IntPtr
    Public dwDDRAWReserved1 As UInteger
    Public dwDDRAWReserved2 As UInteger
    Public fpAliasOfVidMem As UIntPtr
End Structure
import ctypes
from ctypes import wintypes

class DDRAWI_DDRAWSURFACE_GBL_MORE(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("Anonymous", _Anonymous_e__Union),
        ("pPageTable", ctypes.c_void_p),
        ("cPages", wintypes.DWORD),
        ("dwSavedDCContext", ctypes.c_size_t),
        ("fpAliasedVidMem", ctypes.c_size_t),
        ("dwDriverReserved", ctypes.c_size_t),
        ("dwHELReserved", ctypes.c_size_t),
        ("cPageUnlocks", wintypes.DWORD),
        ("hKernelSurface", ctypes.c_size_t),
        ("dwKernelRefCnt", wintypes.DWORD),
        ("lpColorInfo", ctypes.c_void_p),
        ("fpNTAlias", ctypes.c_size_t),
        ("dwContentsStamp", wintypes.DWORD),
        ("lpvUnswappedDriverReserved", ctypes.c_void_p),
        ("lpDDRAWReserved2", ctypes.c_void_p),
        ("dwDDRAWReserved1", wintypes.DWORD),
        ("dwDDRAWReserved2", wintypes.DWORD),
        ("fpAliasOfVidMem", ctypes.c_size_t),
    ]
#[repr(C)]
pub struct DDRAWI_DDRAWSURFACE_GBL_MORE {
    pub dwSize: u32,
    pub Anonymous: _Anonymous_e__Union,
    pub pPageTable: *mut core::ffi::c_void,
    pub cPages: u32,
    pub dwSavedDCContext: usize,
    pub fpAliasedVidMem: usize,
    pub dwDriverReserved: usize,
    pub dwHELReserved: usize,
    pub cPageUnlocks: u32,
    pub hKernelSurface: usize,
    pub dwKernelRefCnt: u32,
    pub lpColorInfo: *mut core::ffi::c_void,
    pub fpNTAlias: usize,
    pub dwContentsStamp: u32,
    pub lpvUnswappedDriverReserved: *mut core::ffi::c_void,
    pub lpDDRAWReserved2: *mut core::ffi::c_void,
    pub dwDDRAWReserved1: u32,
    pub dwDDRAWReserved2: u32,
    pub fpAliasOfVidMem: usize,
}
import "golang.org/x/sys/windows"

type DDRAWI_DDRAWSURFACE_GBL_MORE struct {
	dwSize uint32
	Anonymous _Anonymous_e__Union
	pPageTable uintptr
	cPages uint32
	dwSavedDCContext uintptr
	fpAliasedVidMem uintptr
	dwDriverReserved uintptr
	dwHELReserved uintptr
	cPageUnlocks uint32
	hKernelSurface uintptr
	dwKernelRefCnt uint32
	lpColorInfo uintptr
	fpNTAlias uintptr
	dwContentsStamp uint32
	lpvUnswappedDriverReserved uintptr
	lpDDRAWReserved2 uintptr
	dwDDRAWReserved1 uint32
	dwDDRAWReserved2 uint32
	fpAliasOfVidMem uintptr
}
type
  DDRAWI_DDRAWSURFACE_GBL_MORE = record
    dwSize: DWORD;
    Anonymous: _Anonymous_e__Union;
    pPageTable: Pointer;
    cPages: DWORD;
    dwSavedDCContext: NativeUInt;
    fpAliasedVidMem: NativeUInt;
    dwDriverReserved: NativeUInt;
    dwHELReserved: NativeUInt;
    cPageUnlocks: DWORD;
    hKernelSurface: NativeUInt;
    dwKernelRefCnt: DWORD;
    lpColorInfo: Pointer;
    fpNTAlias: NativeUInt;
    dwContentsStamp: DWORD;
    lpvUnswappedDriverReserved: Pointer;
    lpDDRAWReserved2: Pointer;
    dwDDRAWReserved1: DWORD;
    dwDDRAWReserved2: DWORD;
    fpAliasOfVidMem: NativeUInt;
  end;
const DDRAWI_DDRAWSURFACE_GBL_MORE = extern struct {
    dwSize: u32,
    Anonymous: _Anonymous_e__Union,
    pPageTable: ?*anyopaque,
    cPages: u32,
    dwSavedDCContext: usize,
    fpAliasedVidMem: usize,
    dwDriverReserved: usize,
    dwHELReserved: usize,
    cPageUnlocks: u32,
    hKernelSurface: usize,
    dwKernelRefCnt: u32,
    lpColorInfo: ?*anyopaque,
    fpNTAlias: usize,
    dwContentsStamp: u32,
    lpvUnswappedDriverReserved: ?*anyopaque,
    lpDDRAWReserved2: ?*anyopaque,
    dwDDRAWReserved1: u32,
    dwDDRAWReserved2: u32,
    fpAliasOfVidMem: usize,
};
type
  DDRAWI_DDRAWSURFACE_GBL_MORE {.bycopy.} = object
    dwSize: uint32
    Anonymous: _Anonymous_e__Union
    pPageTable: pointer
    cPages: uint32
    dwSavedDCContext: uint
    fpAliasedVidMem: uint
    dwDriverReserved: uint
    dwHELReserved: uint
    cPageUnlocks: uint32
    hKernelSurface: uint
    dwKernelRefCnt: uint32
    lpColorInfo: pointer
    fpNTAlias: uint
    dwContentsStamp: uint32
    lpvUnswappedDriverReserved: pointer
    lpDDRAWReserved2: pointer
    dwDDRAWReserved1: uint32
    dwDDRAWReserved2: uint32
    fpAliasOfVidMem: uint
struct DDRAWI_DDRAWSURFACE_GBL_MORE
{
    uint dwSize;
    _Anonymous_e__Union Anonymous;
    void* pPageTable;
    uint cPages;
    size_t dwSavedDCContext;
    size_t fpAliasedVidMem;
    size_t dwDriverReserved;
    size_t dwHELReserved;
    uint cPageUnlocks;
    size_t hKernelSurface;
    uint dwKernelRefCnt;
    void* lpColorInfo;
    size_t fpNTAlias;
    uint dwContentsStamp;
    void* lpvUnswappedDriverReserved;
    void* lpDDRAWReserved2;
    uint dwDDRAWReserved1;
    uint dwDDRAWReserved2;
    size_t fpAliasOfVidMem;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDRAWI_DDRAWSURFACE_GBL_MORE サイズ: 76 バイト(x86)
dim st, 19    ; 4byte整数×19(構造体サイズ 76 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; pPageTable : DWORD* (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; cPages : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; dwSavedDCContext : UINT_PTR (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; fpAliasedVidMem : UINT_PTR (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; dwDriverReserved : UINT_PTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwHELReserved : UINT_PTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; cPageUnlocks : DWORD (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; hKernelSurface : UINT_PTR (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwKernelRefCnt : DWORD (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; lpColorInfo : DDCOLORCONTROL* (+44, 4byte)  varptr(st)+44 を基点に操作(4byte:入れ子/配列)
; fpNTAlias : UINT_PTR (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwContentsStamp : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; lpvUnswappedDriverReserved : void* (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; lpDDRAWReserved2 : void* (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; dwDDRAWReserved1 : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; dwDDRAWReserved2 : DWORD (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; fpAliasOfVidMem : UINT_PTR (+72, 4byte)  st.18 = 値  /  値 = st.18   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDRAWI_DDRAWSURFACE_GBL_MORE サイズ: 144 バイト(x64)
dim st, 36    ; 4byte整数×36(構造体サイズ 144 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; Anonymous : _Anonymous_e__Union (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; pPageTable : DWORD* (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; cPages : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwSavedDCContext : UINT_PTR (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; fpAliasedVidMem : UINT_PTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; dwDriverReserved : UINT_PTR (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; dwHELReserved : UINT_PTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; cPageUnlocks : DWORD (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; hKernelSurface : UINT_PTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; dwKernelRefCnt : DWORD (+80, 4byte)  st.20 = 値  /  値 = st.20   (lpoke/lpeek も可)
; lpColorInfo : DDCOLORCONTROL* (+88, 8byte)  varptr(st)+88 を基点に操作(8byte:入れ子/配列)
; fpNTAlias : UINT_PTR (+96, 8byte)  qpoke st,96,値 / qpeek(st,96)  ※IronHSPのみ。3.7/3.8は lpoke st,96,下位 : lpoke st,100,上位
; dwContentsStamp : DWORD (+104, 4byte)  st.26 = 値  /  値 = st.26   (lpoke/lpeek も可)
; lpvUnswappedDriverReserved : void* (+112, 8byte)  qpoke st,112,値 / qpeek(st,112)  ※IronHSPのみ。3.7/3.8は lpoke st,112,下位 : lpoke st,116,上位
; lpDDRAWReserved2 : void* (+120, 8byte)  qpoke st,120,値 / qpeek(st,120)  ※IronHSPのみ。3.7/3.8は lpoke st,120,下位 : lpoke st,124,上位
; dwDDRAWReserved1 : DWORD (+128, 4byte)  st.32 = 値  /  値 = st.32   (lpoke/lpeek も可)
; dwDDRAWReserved2 : DWORD (+132, 4byte)  st.33 = 値  /  値 = st.33   (lpoke/lpeek も可)
; fpAliasOfVidMem : UINT_PTR (+136, 8byte)  qpoke st,136,値 / qpeek(st,136)  ※IronHSPのみ。3.7/3.8は lpoke st,136,下位 : lpoke st,140,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDRAWI_DDRAWSURFACE_GBL_MORE
    #field int dwSize
    #field byte Anonymous 8
    #field intptr pPageTable
    #field int cPages
    #field intptr dwSavedDCContext
    #field intptr fpAliasedVidMem
    #field intptr dwDriverReserved
    #field intptr dwHELReserved
    #field int cPageUnlocks
    #field intptr hKernelSurface
    #field int dwKernelRefCnt
    #field intptr lpColorInfo
    #field intptr fpNTAlias
    #field int dwContentsStamp
    #field intptr lpvUnswappedDriverReserved
    #field intptr lpDDRAWReserved2
    #field int dwDDRAWReserved1
    #field int dwDDRAWReserved2
    #field intptr fpAliasOfVidMem
#endstruct

stdim st, DDRAWI_DDRAWSURFACE_GBL_MORE        ; NSTRUCT 変数を確保
st->dwSize = 100
mes "dwSize=" + st->dwSize
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。