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

DD_COLORCONTROLDATA

構造体
サイズx64: 40 バイト / x86: 24 バイト

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

フィールド

フィールドサイズx64x86説明
lpDDDD_DIRECTDRAW_GLOBAL*8/4+0+0対象のDirectDrawグローバルオブジェクトへのポインタ。
lpDDSurfaceDD_SURFACE_LOCAL*8/4+8+4色調整の対象サーフェスへのポインタ。
lpColorDataDDCOLORCONTROL*8/4+16+8色調整値を保持するDDCOLORCONTROLへのポインタ。
dwFlagsDWORD4+24+12色調整の取得/設定を制御するフラグ。
ddRValHRESULT4+28+16操作の結果を示すHRESULT。成功時はDD_OK。
ColorControlvoid*8/4+32+20サーフェス色調整処理を行うコールバック関数へのポインタ。

各言語での定義

#include <windows.h>

// DD_COLORCONTROLDATA  (x64 40 / x86 24 バイト)
typedef struct DD_COLORCONTROLDATA {
    DD_DIRECTDRAW_GLOBAL* lpDD;
    DD_SURFACE_LOCAL* lpDDSurface;
    DDCOLORCONTROL* lpColorData;
    DWORD dwFlags;
    HRESULT ddRVal;
    void* ColorControl;
} DD_COLORCONTROLDATA;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DD_COLORCONTROLDATA
{
    public IntPtr lpDD;
    public IntPtr lpDDSurface;
    public IntPtr lpColorData;
    public uint dwFlags;
    public int ddRVal;
    public IntPtr ColorControl;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DD_COLORCONTROLDATA
    Public lpDD As IntPtr
    Public lpDDSurface As IntPtr
    Public lpColorData As IntPtr
    Public dwFlags As UInteger
    Public ddRVal As Integer
    Public ColorControl As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DD_COLORCONTROLDATA(ctypes.Structure):
    _fields_ = [
        ("lpDD", ctypes.c_void_p),
        ("lpDDSurface", ctypes.c_void_p),
        ("lpColorData", ctypes.c_void_p),
        ("dwFlags", wintypes.DWORD),
        ("ddRVal", ctypes.c_int),
        ("ColorControl", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DD_COLORCONTROLDATA {
    pub lpDD: *mut core::ffi::c_void,
    pub lpDDSurface: *mut core::ffi::c_void,
    pub lpColorData: *mut core::ffi::c_void,
    pub dwFlags: u32,
    pub ddRVal: i32,
    pub ColorControl: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DD_COLORCONTROLDATA struct {
	lpDD uintptr
	lpDDSurface uintptr
	lpColorData uintptr
	dwFlags uint32
	ddRVal int32
	ColorControl uintptr
}
type
  DD_COLORCONTROLDATA = record
    lpDD: Pointer;
    lpDDSurface: Pointer;
    lpColorData: Pointer;
    dwFlags: DWORD;
    ddRVal: Integer;
    ColorControl: Pointer;
  end;
const DD_COLORCONTROLDATA = extern struct {
    lpDD: ?*anyopaque,
    lpDDSurface: ?*anyopaque,
    lpColorData: ?*anyopaque,
    dwFlags: u32,
    ddRVal: i32,
    ColorControl: ?*anyopaque,
};
type
  DD_COLORCONTROLDATA {.bycopy.} = object
    lpDD: pointer
    lpDDSurface: pointer
    lpColorData: pointer
    dwFlags: uint32
    ddRVal: int32
    ColorControl: pointer
struct DD_COLORCONTROLDATA
{
    void* lpDD;
    void* lpDDSurface;
    void* lpColorData;
    uint dwFlags;
    int ddRVal;
    void* ColorControl;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DD_COLORCONTROLDATA サイズ: 24 バイト(x86)
dim st, 6    ; 4byte整数×6(構造体サイズ 24 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_GLOBAL* (+0, 4byte)  varptr(st)+0 を基点に操作(4byte:入れ子/配列)
; lpDDSurface : DD_SURFACE_LOCAL* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; lpColorData : DDCOLORCONTROL* (+8, 4byte)  varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; dwFlags : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; ddRVal : HRESULT (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; ColorControl : void* (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DD_COLORCONTROLDATA サイズ: 40 バイト(x64)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; lpDD : DD_DIRECTDRAW_GLOBAL* (+0, 8byte)  varptr(st)+0 を基点に操作(8byte:入れ子/配列)
; lpDDSurface : DD_SURFACE_LOCAL* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; lpColorData : DDCOLORCONTROL* (+16, 8byte)  varptr(st)+16 を基点に操作(8byte:入れ子/配列)
; dwFlags : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ddRVal : HRESULT (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; ColorControl : void* (+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 DD_COLORCONTROLDATA
    #field intptr lpDD
    #field intptr lpDDSurface
    #field intptr lpColorData
    #field int dwFlags
    #field int ddRVal
    #field intptr ColorControl
#endstruct

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