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

DDRAWI_DDRAWPALETTE_LCL

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

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

フィールド

フィールドサイズx64x86説明
lpPalMoreDWORD4+0+0追加パレット情報へのポインタ(予約)を示す。
lpGblDDRAWI_DDRAWPALETTE_GBL*8/4+8+4対応するグローバルパレットオブジェクトへのポインタ。
dwUnused0UINT_PTR8/4+16+8未使用の予約フィールド。
dwLocalRefCntDWORD4+24+12ローカルパレットオブジェクトの参照カウントを示す。
pUnkOuterIUnknown*8/4+32+16アグリゲーション時の外部IUnknownへのポインタ。NULL可。
lpDD_lclDDRAWI_DIRECTDRAW_LCL*8/4+40+20所属するローカルDirectDrawオブジェクトへのポインタ。
dwReserved1UINT_PTR8/4+48+24予約フィールド。0とする。
dwDDRAWReserved1UINT_PTR8/4+56+28DirectDraw内部用の予約フィールド(その1)。
dwDDRAWReserved2UINT_PTR8/4+64+32DirectDraw内部用の予約フィールド(その2)。
dwDDRAWReserved3UINT_PTR8/4+72+36DirectDraw内部用の予約フィールド(その3)。

各言語での定義

#include <windows.h>

// DDRAWI_DDRAWPALETTE_LCL  (x64 80 / x86 40 バイト)
typedef struct DDRAWI_DDRAWPALETTE_LCL {
    DWORD lpPalMore;
    DDRAWI_DDRAWPALETTE_GBL* lpGbl;
    UINT_PTR dwUnused0;
    DWORD dwLocalRefCnt;
    IUnknown* pUnkOuter;
    DDRAWI_DIRECTDRAW_LCL* lpDD_lcl;
    UINT_PTR dwReserved1;
    UINT_PTR dwDDRAWReserved1;
    UINT_PTR dwDDRAWReserved2;
    UINT_PTR dwDDRAWReserved3;
} DDRAWI_DDRAWPALETTE_LCL;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDRAWI_DDRAWPALETTE_LCL
{
    public uint lpPalMore;
    public IntPtr lpGbl;
    public UIntPtr dwUnused0;
    public uint dwLocalRefCnt;
    public IntPtr pUnkOuter;
    public IntPtr lpDD_lcl;
    public UIntPtr dwReserved1;
    public UIntPtr dwDDRAWReserved1;
    public UIntPtr dwDDRAWReserved2;
    public UIntPtr dwDDRAWReserved3;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDRAWI_DDRAWPALETTE_LCL
    Public lpPalMore As UInteger
    Public lpGbl As IntPtr
    Public dwUnused0 As UIntPtr
    Public dwLocalRefCnt As UInteger
    Public pUnkOuter As IntPtr
    Public lpDD_lcl As IntPtr
    Public dwReserved1 As UIntPtr
    Public dwDDRAWReserved1 As UIntPtr
    Public dwDDRAWReserved2 As UIntPtr
    Public dwDDRAWReserved3 As UIntPtr
End Structure
import ctypes
from ctypes import wintypes

class DDRAWI_DDRAWPALETTE_LCL(ctypes.Structure):
    _fields_ = [
        ("lpPalMore", wintypes.DWORD),
        ("lpGbl", ctypes.c_void_p),
        ("dwUnused0", ctypes.c_size_t),
        ("dwLocalRefCnt", wintypes.DWORD),
        ("pUnkOuter", ctypes.c_void_p),
        ("lpDD_lcl", ctypes.c_void_p),
        ("dwReserved1", ctypes.c_size_t),
        ("dwDDRAWReserved1", ctypes.c_size_t),
        ("dwDDRAWReserved2", ctypes.c_size_t),
        ("dwDDRAWReserved3", ctypes.c_size_t),
    ]
#[repr(C)]
pub struct DDRAWI_DDRAWPALETTE_LCL {
    pub lpPalMore: u32,
    pub lpGbl: *mut core::ffi::c_void,
    pub dwUnused0: usize,
    pub dwLocalRefCnt: u32,
    pub pUnkOuter: *mut core::ffi::c_void,
    pub lpDD_lcl: *mut core::ffi::c_void,
    pub dwReserved1: usize,
    pub dwDDRAWReserved1: usize,
    pub dwDDRAWReserved2: usize,
    pub dwDDRAWReserved3: usize,
}
import "golang.org/x/sys/windows"

type DDRAWI_DDRAWPALETTE_LCL struct {
	lpPalMore uint32
	lpGbl uintptr
	dwUnused0 uintptr
	dwLocalRefCnt uint32
	pUnkOuter uintptr
	lpDD_lcl uintptr
	dwReserved1 uintptr
	dwDDRAWReserved1 uintptr
	dwDDRAWReserved2 uintptr
	dwDDRAWReserved3 uintptr
}
type
  DDRAWI_DDRAWPALETTE_LCL = record
    lpPalMore: DWORD;
    lpGbl: Pointer;
    dwUnused0: NativeUInt;
    dwLocalRefCnt: DWORD;
    pUnkOuter: Pointer;
    lpDD_lcl: Pointer;
    dwReserved1: NativeUInt;
    dwDDRAWReserved1: NativeUInt;
    dwDDRAWReserved2: NativeUInt;
    dwDDRAWReserved3: NativeUInt;
  end;
const DDRAWI_DDRAWPALETTE_LCL = extern struct {
    lpPalMore: u32,
    lpGbl: ?*anyopaque,
    dwUnused0: usize,
    dwLocalRefCnt: u32,
    pUnkOuter: ?*anyopaque,
    lpDD_lcl: ?*anyopaque,
    dwReserved1: usize,
    dwDDRAWReserved1: usize,
    dwDDRAWReserved2: usize,
    dwDDRAWReserved3: usize,
};
type
  DDRAWI_DDRAWPALETTE_LCL {.bycopy.} = object
    lpPalMore: uint32
    lpGbl: pointer
    dwUnused0: uint
    dwLocalRefCnt: uint32
    pUnkOuter: pointer
    lpDD_lcl: pointer
    dwReserved1: uint
    dwDDRAWReserved1: uint
    dwDDRAWReserved2: uint
    dwDDRAWReserved3: uint
struct DDRAWI_DDRAWPALETTE_LCL
{
    uint lpPalMore;
    void* lpGbl;
    size_t dwUnused0;
    uint dwLocalRefCnt;
    void* pUnkOuter;
    void* lpDD_lcl;
    size_t dwReserved1;
    size_t dwDDRAWReserved1;
    size_t dwDDRAWReserved2;
    size_t dwDDRAWReserved3;
}

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_LCL サイズ: 40 バイト(x86)
dim st, 10    ; 4byte整数×10(構造体サイズ 40 / 4 切り上げ)
; lpPalMore : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpGbl : DDRAWI_DDRAWPALETTE_GBL* (+4, 4byte)  varptr(st)+4 を基点に操作(4byte:入れ子/配列)
; dwUnused0 : UINT_PTR (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; dwLocalRefCnt : DWORD (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; pUnkOuter : IUnknown* (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; lpDD_lcl : DDRAWI_DIRECTDRAW_LCL* (+20, 4byte)  varptr(st)+20 を基点に操作(4byte:入れ子/配列)
; dwReserved1 : UINT_PTR (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; dwDDRAWReserved1 : UINT_PTR (+28, 4byte)  st.7 = 値  /  値 = st.7   (lpoke/lpeek も可)
; dwDDRAWReserved2 : UINT_PTR (+32, 4byte)  st.8 = 値  /  値 = st.8   (lpoke/lpeek も可)
; dwDDRAWReserved3 : UINT_PTR (+36, 4byte)  st.9 = 値  /  値 = st.9   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDRAWI_DDRAWPALETTE_LCL サイズ: 80 バイト(x64)
dim st, 20    ; 4byte整数×20(構造体サイズ 80 / 4 切り上げ)
; lpPalMore : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; lpGbl : DDRAWI_DDRAWPALETTE_GBL* (+8, 8byte)  varptr(st)+8 を基点に操作(8byte:入れ子/配列)
; dwUnused0 : UINT_PTR (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; dwLocalRefCnt : DWORD (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; pUnkOuter : IUnknown* (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; lpDD_lcl : DDRAWI_DIRECTDRAW_LCL* (+40, 8byte)  varptr(st)+40 を基点に操作(8byte:入れ子/配列)
; dwReserved1 : UINT_PTR (+48, 8byte)  qpoke st,48,値 / qpeek(st,48)  ※IronHSPのみ。3.7/3.8は lpoke st,48,下位 : lpoke st,52,上位
; dwDDRAWReserved1 : UINT_PTR (+56, 8byte)  qpoke st,56,値 / qpeek(st,56)  ※IronHSPのみ。3.7/3.8は lpoke st,56,下位 : lpoke st,60,上位
; dwDDRAWReserved2 : UINT_PTR (+64, 8byte)  qpoke st,64,値 / qpeek(st,64)  ※IronHSPのみ。3.7/3.8は lpoke st,64,下位 : lpoke st,68,上位
; dwDDRAWReserved3 : UINT_PTR (+72, 8byte)  qpoke st,72,値 / qpeek(st,72)  ※IronHSPのみ。3.7/3.8は lpoke st,72,下位 : lpoke st,76,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDRAWI_DDRAWPALETTE_LCL
    #field int lpPalMore
    #field intptr lpGbl
    #field intptr dwUnused0
    #field int dwLocalRefCnt
    #field intptr pUnkOuter
    #field intptr lpDD_lcl
    #field intptr dwReserved1
    #field intptr dwDDRAWReserved1
    #field intptr dwDDRAWReserved2
    #field intptr dwDDRAWReserved3
#endstruct

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