ホーム › Graphics.DirectDraw › DDRAWI_DDRAWPALETTE_GBL
DDRAWI_DDRAWPALETTE_GBL
構造体サイズ=各フィールドのバイト数(x64/x86 で異なる場合は x64/x86 と併記)。x64/x86 列=フィールドのバイトオフセット(HSPで dupptr / lpoke / wpoke 等に使用)。
フィールド
| フィールド | 型 | サイズ | x64 | x86 | 説明 |
|---|---|---|---|---|---|
| dwRefCnt | DWORD | 4 | +0 | +0 | グローバルパレットオブジェクトの参照カウントを示す。 |
| dwFlags | DWORD | 4 | +4 | +4 | パレットの属性を示すDDRAWIPAL_系フラグを示す。 |
| lpDD_lcl | DDRAWI_DIRECTDRAW_LCL* | 8/4 | +8 | +8 | 所属するローカルDirectDrawオブジェクトへのポインタ。 |
| dwProcessId | DWORD | 4 | +16 | +12 | このパレットを所有するプロセスの識別子を示す。 |
| lpColorTable | PALETTEENTRY* | 8/4 | +24 | +16 | パレットの色テーブル(PALETTEENTRY配列)へのポインタ。 |
| Anonymous | _Anonymous_e__Union | 8/4 | +32 | +20 | ドライバ予約値またはハンドルを保持する共用体。 |
| dwDriverReserved | DWORD | 4 | +40 | +24 | ドライバが利用する予約値を示す。 |
| dwContentsStamp | DWORD | 4 | +44 | +28 | パレット内容の更新を追跡するスタンプ値を示す。 |
| dwSaveStamp | DWORD | 4 | +48 | +32 | 保存時点のスタンプ値を示す。 |
| dwHandle | DWORD | 4 | +52 | +36 | ドライバが用いるパレットハンドルを示す。 |
共用体: _Anonymous_e__Union x64 8B / x86 4B
| フィールド | 型 | サイズ | x64 | x86 |
|---|---|---|---|---|
| dwReserved1 | UINT_PTR | 8/4 | +0 | +0 |
| hHELGDIPalette | HPALETTE | 8/4 | +0 | +0 |
各言語での定義
#include <windows.h>
// DDRAWI_DDRAWPALETTE_GBL (x64 56 / x86 40 バイト)
typedef struct DDRAWI_DDRAWPALETTE_GBL {
DWORD dwRefCnt;
DWORD dwFlags;
DDRAWI_DIRECTDRAW_LCL* lpDD_lcl;
DWORD dwProcessId;
PALETTEENTRY* lpColorTable;
_Anonymous_e__Union Anonymous;
DWORD dwDriverReserved;
DWORD dwContentsStamp;
DWORD dwSaveStamp;
DWORD dwHandle;
} DDRAWI_DDRAWPALETTE_GBL;using System;
using System.Runtime.InteropServices;
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDRAWI_DDRAWPALETTE_GBL
{
public uint dwRefCnt;
public uint dwFlags;
public IntPtr lpDD_lcl;
public uint dwProcessId;
public IntPtr lpColorTable;
public _Anonymous_e__Union Anonymous;
public uint dwDriverReserved;
public uint dwContentsStamp;
public uint dwSaveStamp;
public uint dwHandle;
}Imports System.Runtime.InteropServices
<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDRAWI_DDRAWPALETTE_GBL
Public dwRefCnt As UInteger
Public dwFlags As UInteger
Public lpDD_lcl As IntPtr
Public dwProcessId As UInteger
Public lpColorTable As IntPtr
Public Anonymous As _Anonymous_e__Union
Public dwDriverReserved As UInteger
Public dwContentsStamp As UInteger
Public dwSaveStamp As UInteger
Public dwHandle As UInteger
End Structureimport ctypes
from ctypes import wintypes
class DDRAWI_DDRAWPALETTE_GBL(ctypes.Structure):
_fields_ = [
("dwRefCnt", wintypes.DWORD),
("dwFlags", wintypes.DWORD),
("lpDD_lcl", ctypes.c_void_p),
("dwProcessId", wintypes.DWORD),
("lpColorTable", ctypes.c_void_p),
("Anonymous", _Anonymous_e__Union),
("dwDriverReserved", wintypes.DWORD),
("dwContentsStamp", wintypes.DWORD),
("dwSaveStamp", wintypes.DWORD),
("dwHandle", wintypes.DWORD),
]#[repr(C)]
pub struct DDRAWI_DDRAWPALETTE_GBL {
pub dwRefCnt: u32,
pub dwFlags: u32,
pub lpDD_lcl: *mut core::ffi::c_void,
pub dwProcessId: u32,
pub lpColorTable: *mut core::ffi::c_void,
pub Anonymous: _Anonymous_e__Union,
pub dwDriverReserved: u32,
pub dwContentsStamp: u32,
pub dwSaveStamp: u32,
pub dwHandle: u32,
}import "golang.org/x/sys/windows"
type DDRAWI_DDRAWPALETTE_GBL struct {
dwRefCnt uint32
dwFlags uint32
lpDD_lcl uintptr
dwProcessId uint32
lpColorTable uintptr
Anonymous _Anonymous_e__Union
dwDriverReserved uint32
dwContentsStamp uint32
dwSaveStamp uint32
dwHandle uint32
}type
DDRAWI_DDRAWPALETTE_GBL = record
dwRefCnt: DWORD;
dwFlags: DWORD;
lpDD_lcl: Pointer;
dwProcessId: DWORD;
lpColorTable: Pointer;
Anonymous: _Anonymous_e__Union;
dwDriverReserved: DWORD;
dwContentsStamp: DWORD;
dwSaveStamp: DWORD;
dwHandle: DWORD;
end;const DDRAWI_DDRAWPALETTE_GBL = extern struct {
dwRefCnt: u32,
dwFlags: u32,
lpDD_lcl: ?*anyopaque,
dwProcessId: u32,
lpColorTable: ?*anyopaque,
Anonymous: _Anonymous_e__Union,
dwDriverReserved: u32,
dwContentsStamp: u32,
dwSaveStamp: u32,
dwHandle: u32,
};type
DDRAWI_DDRAWPALETTE_GBL {.bycopy.} = object
dwRefCnt: uint32
dwFlags: uint32
lpDD_lcl: pointer
dwProcessId: uint32
lpColorTable: pointer
Anonymous: _Anonymous_e__Union
dwDriverReserved: uint32
dwContentsStamp: uint32
dwSaveStamp: uint32
dwHandle: uint32struct DDRAWI_DDRAWPALETTE_GBL
{
uint dwRefCnt;
uint dwFlags;
void* lpDD_lcl;
uint dwProcessId;
void* lpColorTable;
_Anonymous_e__Union Anonymous;
uint dwDriverReserved;
uint dwContentsStamp;
uint dwSaveStamp;
uint dwHandle;
}HSP用 定義
HSP3.7/3.8 は構造体機能が無いため4byte整数配列(dim)+peek/poke で操作(32/64bitでサイズ・位置が異なる場合はタブで分割)。IronHSP は NSTRUCT(#defstruct/stdim/->)で32/64bit共通。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDRAWI_DDRAWPALETTE_GBL サイズ: 40 バイト(x86)
dim st, 10 ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; dwRefCnt : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpDD_lcl : DDRAWI_DIRECTDRAW_LCL* (+8, 4byte) varptr(st)+8 を基点に操作(4byte:入れ子/配列)
; dwProcessId : DWORD (+12, 4byte) st.3 = 値 / 値 = st.3 (lpoke/lpeek も可)
; lpColorTable : PALETTEENTRY* (+16, 4byte) varptr(st)+16 を基点に操作(4byte:入れ子/配列)
; Anonymous : _Anonymous_e__Union (+20, 4byte) varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; dwDriverReserved : DWORD (+24, 4byte) st.6 = 値 / 値 = st.6 (lpoke/lpeek も可)
; dwContentsStamp : DWORD (+28, 4byte) st.7 = 値 / 値 = st.7 (lpoke/lpeek も可)
; dwSaveStamp : DWORD (+32, 4byte) st.8 = 値 / 値 = st.8 (lpoke/lpeek も可)
; dwHandle : DWORD (+36, 4byte) st.9 = 値 / 値 = st.9 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDRAWI_DDRAWPALETTE_GBL サイズ: 56 バイト(x64)
dim st, 14 ; 4byte整数×14(構造体サイズ 56 / 4 切り上げ)
; dwRefCnt : DWORD (+0, 4byte) st.0 = 値 / 値 = st.0 (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte) st.1 = 値 / 値 = st.1 (lpoke/lpeek も可)
; lpDD_lcl : DDRAWI_DIRECTDRAW_LCL* (+8, 8byte) varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; dwProcessId : DWORD (+16, 4byte) st.4 = 値 / 値 = st.4 (lpoke/lpeek も可)
; lpColorTable : PALETTEENTRY* (+24, 8byte) varptr(st)+24 を基点に操作(8byte:入れ子/配列)
; Anonymous : _Anonymous_e__Union (+32, 8byte) varptr(st)+32 を基点に操作(8byte:入れ子/配列)
; dwDriverReserved : DWORD (+40, 4byte) st.10 = 値 / 値 = st.10 (lpoke/lpeek も可)
; dwContentsStamp : DWORD (+44, 4byte) st.11 = 値 / 値 = st.11 (lpoke/lpeek も可)
; dwSaveStamp : DWORD (+48, 4byte) st.12 = 値 / 値 = st.12 (lpoke/lpeek も可)
; dwHandle : DWORD (+52, 4byte) st.13 = 値 / 値 = st.13 (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDRAWI_DDRAWPALETTE_GBL
#field int dwRefCnt
#field int dwFlags
#field intptr lpDD_lcl
#field int dwProcessId
#field intptr lpColorTable
#field byte Anonymous 8
#field int dwDriverReserved
#field int dwContentsStamp
#field int dwSaveStamp
#field int dwHandle
#endstruct
stdim st, DDRAWI_DDRAWPALETTE_GBL ; NSTRUCT 変数を確保
st->dwRefCnt = 100
mes "dwRefCnt=" + st->dwRefCnt
; ※union フィールドは byte 列で確保(NSTRUCT は union 非対応)。必要に応じ手動でアクセス。