Win32 API 日本語リファレンス
ホームSystem.WindowsProgramming › DCISURFACEINFO

DCISURFACEINFO

構造体
サイズx64: 88 バイト / x86: 72 バイト

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0この構造体のサイズ(バイト)。
dwDCICapsDWORD4+4+4サーフェスのDCIケイパビリティを示すフラグ。
dwCompressionDWORD4+8+8サーフェスの圧縮形式を示すFOURCCコード。
dwMaskDWORD12+12+12RGBのカラーマスク配列。
dwWidthDWORD4+24+24サーフェスの幅(ピクセル)。
dwHeightDWORD4+28+28サーフェスの高さ(ピクセル)。
lStrideINT4+32+321行あたりのバイト数(ストライド)。負値の場合は下から上の格納。
dwBitCountDWORD4+36+361ピクセルあたりのビット数。
dwOffSurfaceUINT_PTR8/4+40+40サーフェスデータへのオフセット(UINT_PTR)。
wSelSurfaceWORD2+48+44サーフェスのセレクタ値。
wReservedWORD2+50+46予約フィールド。
dwReserved1DWORD4+52+48予約フィールド。
dwReserved2DWORD4+56+52予約フィールド。
dwReserved3DWORD4+60+56予約フィールド。
BeginAccessINT_PTR8/4+64+60サーフェスアクセス開始時に呼ぶコールバック関数のアドレス。
EndAccessINT_PTR8/4+72+64サーフェスアクセス終了時に呼ぶコールバック関数のアドレス。
DestroySurfaceINT_PTR8/4+80+68サーフェス破棄時に呼ぶコールバック関数のアドレス。

各言語での定義

#include <windows.h>

// DCISURFACEINFO  (x64 88 / x86 72 バイト)
typedef struct DCISURFACEINFO {
    DWORD dwSize;
    DWORD dwDCICaps;
    DWORD dwCompression;
    DWORD dwMask[3];
    DWORD dwWidth;
    DWORD dwHeight;
    INT lStride;
    DWORD dwBitCount;
    UINT_PTR dwOffSurface;
    WORD wSelSurface;
    WORD wReserved;
    DWORD dwReserved1;
    DWORD dwReserved2;
    DWORD dwReserved3;
    INT_PTR BeginAccess;
    INT_PTR EndAccess;
    INT_PTR DestroySurface;
} DCISURFACEINFO;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DCISURFACEINFO
{
    public uint dwSize;
    public uint dwDCICaps;
    public uint dwCompression;
    [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] public uint[] dwMask;
    public uint dwWidth;
    public uint dwHeight;
    public int lStride;
    public uint dwBitCount;
    public UIntPtr dwOffSurface;
    public ushort wSelSurface;
    public ushort wReserved;
    public uint dwReserved1;
    public uint dwReserved2;
    public uint dwReserved3;
    public IntPtr BeginAccess;
    public IntPtr EndAccess;
    public IntPtr DestroySurface;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DCISURFACEINFO
    Public dwSize As UInteger
    Public dwDCICaps As UInteger
    Public dwCompression As UInteger
    <MarshalAs(UnmanagedType.ByValArray, SizeConst:=3)> Public dwMask() As UInteger
    Public dwWidth As UInteger
    Public dwHeight As UInteger
    Public lStride As Integer
    Public dwBitCount As UInteger
    Public dwOffSurface As UIntPtr
    Public wSelSurface As UShort
    Public wReserved As UShort
    Public dwReserved1 As UInteger
    Public dwReserved2 As UInteger
    Public dwReserved3 As UInteger
    Public BeginAccess As IntPtr
    Public EndAccess As IntPtr
    Public DestroySurface As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DCISURFACEINFO(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwDCICaps", wintypes.DWORD),
        ("dwCompression", wintypes.DWORD),
        ("dwMask", wintypes.DWORD * 3),
        ("dwWidth", wintypes.DWORD),
        ("dwHeight", wintypes.DWORD),
        ("lStride", ctypes.c_int),
        ("dwBitCount", wintypes.DWORD),
        ("dwOffSurface", ctypes.c_size_t),
        ("wSelSurface", ctypes.c_ushort),
        ("wReserved", ctypes.c_ushort),
        ("dwReserved1", wintypes.DWORD),
        ("dwReserved2", wintypes.DWORD),
        ("dwReserved3", wintypes.DWORD),
        ("BeginAccess", ctypes.c_ssize_t),
        ("EndAccess", ctypes.c_ssize_t),
        ("DestroySurface", ctypes.c_ssize_t),
    ]
#[repr(C)]
pub struct DCISURFACEINFO {
    pub dwSize: u32,
    pub dwDCICaps: u32,
    pub dwCompression: u32,
    pub dwMask: [u32; 3],
    pub dwWidth: u32,
    pub dwHeight: u32,
    pub lStride: i32,
    pub dwBitCount: u32,
    pub dwOffSurface: usize,
    pub wSelSurface: u16,
    pub wReserved: u16,
    pub dwReserved1: u32,
    pub dwReserved2: u32,
    pub dwReserved3: u32,
    pub BeginAccess: isize,
    pub EndAccess: isize,
    pub DestroySurface: isize,
}
import "golang.org/x/sys/windows"

type DCISURFACEINFO struct {
	dwSize uint32
	dwDCICaps uint32
	dwCompression uint32
	dwMask [3]uint32
	dwWidth uint32
	dwHeight uint32
	lStride int32
	dwBitCount uint32
	dwOffSurface uintptr
	wSelSurface uint16
	wReserved uint16
	dwReserved1 uint32
	dwReserved2 uint32
	dwReserved3 uint32
	BeginAccess uintptr
	EndAccess uintptr
	DestroySurface uintptr
}
type
  DCISURFACEINFO = record
    dwSize: DWORD;
    dwDCICaps: DWORD;
    dwCompression: DWORD;
    dwMask: array[0..2] of DWORD;
    dwWidth: DWORD;
    dwHeight: DWORD;
    lStride: Integer;
    dwBitCount: DWORD;
    dwOffSurface: NativeUInt;
    wSelSurface: Word;
    wReserved: Word;
    dwReserved1: DWORD;
    dwReserved2: DWORD;
    dwReserved3: DWORD;
    BeginAccess: NativeInt;
    EndAccess: NativeInt;
    DestroySurface: NativeInt;
  end;
const DCISURFACEINFO = extern struct {
    dwSize: u32,
    dwDCICaps: u32,
    dwCompression: u32,
    dwMask: [3]u32,
    dwWidth: u32,
    dwHeight: u32,
    lStride: i32,
    dwBitCount: u32,
    dwOffSurface: usize,
    wSelSurface: u16,
    wReserved: u16,
    dwReserved1: u32,
    dwReserved2: u32,
    dwReserved3: u32,
    BeginAccess: isize,
    EndAccess: isize,
    DestroySurface: isize,
};
type
  DCISURFACEINFO {.bycopy.} = object
    dwSize: uint32
    dwDCICaps: uint32
    dwCompression: uint32
    dwMask: array[3, uint32]
    dwWidth: uint32
    dwHeight: uint32
    lStride: int32
    dwBitCount: uint32
    dwOffSurface: uint
    wSelSurface: uint16
    wReserved: uint16
    dwReserved1: uint32
    dwReserved2: uint32
    dwReserved3: uint32
    BeginAccess: int
    EndAccess: int
    DestroySurface: int
struct DCISURFACEINFO
{
    uint dwSize;
    uint dwDCICaps;
    uint dwCompression;
    uint[3] dwMask;
    uint dwWidth;
    uint dwHeight;
    int lStride;
    uint dwBitCount;
    size_t dwOffSurface;
    ushort wSelSurface;
    ushort wReserved;
    uint dwReserved1;
    uint dwReserved2;
    uint dwReserved3;
    ptrdiff_t BeginAccess;
    ptrdiff_t EndAccess;
    ptrdiff_t DestroySurface;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DCISURFACEINFO サイズ: 72 バイト(x86)
dim st, 18    ; 4byte整数×18(構造体サイズ 72 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwDCICaps : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwCompression : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwMask : DWORD (+12, 12byte)  varptr(st)+12 を基点に操作(12byte:入れ子/配列)
; dwWidth : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwHeight : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; lStride : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwBitCount : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwOffSurface : UINT_PTR (+40, 4byte)  st.10 = 値  /  値 = st.10   (lpoke/lpeek も可)
; wSelSurface : WORD (+44, 2byte)  wpoke st,44,値  /  値 = wpeek(st,44)
; wReserved : WORD (+46, 2byte)  wpoke st,46,値  /  値 = wpeek(st,46)
; dwReserved1 : DWORD (+48, 4byte)  st.12 = 値  /  値 = st.12   (lpoke/lpeek も可)
; dwReserved2 : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; dwReserved3 : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; BeginAccess : INT_PTR (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; EndAccess : INT_PTR (+64, 4byte)  st.16 = 値  /  値 = st.16   (lpoke/lpeek も可)
; DestroySurface : INT_PTR (+68, 4byte)  st.17 = 値  /  値 = st.17   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DCISURFACEINFO サイズ: 88 バイト(x64)
dim st, 22    ; 4byte整数×22(構造体サイズ 88 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwDCICaps : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; dwCompression : DWORD (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwMask : DWORD (+12, 12byte)  varptr(st)+12 を基点に操作(12byte:入れ子/配列)
; dwWidth : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwHeight : DWORD (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; lStride : INT (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwBitCount : DWORD (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; dwOffSurface : UINT_PTR (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; wSelSurface : WORD (+48, 2byte)  wpoke st,48,値  /  値 = wpeek(st,48)
; wReserved : WORD (+50, 2byte)  wpoke st,50,値  /  値 = wpeek(st,50)
; dwReserved1 : DWORD (+52, 4byte)  st.13 = 値  /  値 = st.13   (lpoke/lpeek も可)
; dwReserved2 : DWORD (+56, 4byte)  st.14 = 値  /  値 = st.14   (lpoke/lpeek も可)
; dwReserved3 : DWORD (+60, 4byte)  st.15 = 値  /  値 = st.15   (lpoke/lpeek も可)
; BeginAccess : INT_PTR (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; EndAccess : INT_PTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; DestroySurface : INT_PTR (+80, 8byte)  qpoke st,80,値 / qpeek(st,80)  ※IronHSPのみ。3.7/3.8は lpoke st,80,下位 : lpoke st,84,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DCISURFACEINFO
    #field int dwSize
    #field int dwDCICaps
    #field int dwCompression
    #field int dwMask 3
    #field int dwWidth
    #field int dwHeight
    #field int lStride
    #field int dwBitCount
    #field intptr dwOffSurface
    #field short wSelSurface
    #field short wReserved
    #field int dwReserved1
    #field int dwReserved2
    #field int dwReserved3
    #field intptr BeginAccess
    #field intptr EndAccess
    #field intptr DestroySurface
#endstruct

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