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

DDHAL_DDEXEBUFCALLBACKS

構造体
サイズx64: 48 バイト / x86: 28 バイト

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

フィールド

フィールドサイズx64x86説明
dwSizeDWORD4+0+0構造体サイズ(バイト数)。呼び出し前に設定する。
dwFlagsDWORD4+4+4有効なコールバックを示すフラグを示す。
CanCreateExecuteBufferLPDDHALEXEBUFCB_CANCREATEEXEBUF8/4+8+8実行バッファ作成可否判定コールバックへのポインタ。
CreateExecuteBufferLPDDHALEXEBUFCB_CREATEEXEBUF8/4+16+12実行バッファ作成コールバックへのポインタ。
DestroyExecuteBufferLPDDHALEXEBUFCB_DESTROYEXEBUF8/4+24+16実行バッファ破棄コールバックへのポインタ。
LockExecuteBufferLPDDHALEXEBUFCB_LOCKEXEBUF8/4+32+20実行バッファロックコールバックへのポインタ。
UnlockExecuteBufferLPDDHALEXEBUFCB_UNLOCKEXEBUF8/4+40+24実行バッファアンロックコールバックへのポインタ。

各言語での定義

#include <windows.h>

// DDHAL_DDEXEBUFCALLBACKS  (x64 48 / x86 28 バイト)
typedef struct DDHAL_DDEXEBUFCALLBACKS {
    DWORD dwSize;
    DWORD dwFlags;
    LPDDHALEXEBUFCB_CANCREATEEXEBUF CanCreateExecuteBuffer;
    LPDDHALEXEBUFCB_CREATEEXEBUF CreateExecuteBuffer;
    LPDDHALEXEBUFCB_DESTROYEXEBUF DestroyExecuteBuffer;
    LPDDHALEXEBUFCB_LOCKEXEBUF LockExecuteBuffer;
    LPDDHALEXEBUFCB_UNLOCKEXEBUF UnlockExecuteBuffer;
} DDHAL_DDEXEBUFCALLBACKS;
using System;
using System.Runtime.InteropServices;

[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
public struct DDHAL_DDEXEBUFCALLBACKS
{
    public uint dwSize;
    public uint dwFlags;
    public IntPtr CanCreateExecuteBuffer;
    public IntPtr CreateExecuteBuffer;
    public IntPtr DestroyExecuteBuffer;
    public IntPtr LockExecuteBuffer;
    public IntPtr UnlockExecuteBuffer;
}
Imports System.Runtime.InteropServices

<StructLayout(LayoutKind.Sequential, CharSet:=CharSet.Unicode)>
Public Structure DDHAL_DDEXEBUFCALLBACKS
    Public dwSize As UInteger
    Public dwFlags As UInteger
    Public CanCreateExecuteBuffer As IntPtr
    Public CreateExecuteBuffer As IntPtr
    Public DestroyExecuteBuffer As IntPtr
    Public LockExecuteBuffer As IntPtr
    Public UnlockExecuteBuffer As IntPtr
End Structure
import ctypes
from ctypes import wintypes

class DDHAL_DDEXEBUFCALLBACKS(ctypes.Structure):
    _fields_ = [
        ("dwSize", wintypes.DWORD),
        ("dwFlags", wintypes.DWORD),
        ("CanCreateExecuteBuffer", ctypes.c_void_p),
        ("CreateExecuteBuffer", ctypes.c_void_p),
        ("DestroyExecuteBuffer", ctypes.c_void_p),
        ("LockExecuteBuffer", ctypes.c_void_p),
        ("UnlockExecuteBuffer", ctypes.c_void_p),
    ]
#[repr(C)]
pub struct DDHAL_DDEXEBUFCALLBACKS {
    pub dwSize: u32,
    pub dwFlags: u32,
    pub CanCreateExecuteBuffer: *mut core::ffi::c_void,
    pub CreateExecuteBuffer: *mut core::ffi::c_void,
    pub DestroyExecuteBuffer: *mut core::ffi::c_void,
    pub LockExecuteBuffer: *mut core::ffi::c_void,
    pub UnlockExecuteBuffer: *mut core::ffi::c_void,
}
import "golang.org/x/sys/windows"

type DDHAL_DDEXEBUFCALLBACKS struct {
	dwSize uint32
	dwFlags uint32
	CanCreateExecuteBuffer uintptr
	CreateExecuteBuffer uintptr
	DestroyExecuteBuffer uintptr
	LockExecuteBuffer uintptr
	UnlockExecuteBuffer uintptr
}
type
  DDHAL_DDEXEBUFCALLBACKS = record
    dwSize: DWORD;
    dwFlags: DWORD;
    CanCreateExecuteBuffer: Pointer;
    CreateExecuteBuffer: Pointer;
    DestroyExecuteBuffer: Pointer;
    LockExecuteBuffer: Pointer;
    UnlockExecuteBuffer: Pointer;
  end;
const DDHAL_DDEXEBUFCALLBACKS = extern struct {
    dwSize: u32,
    dwFlags: u32,
    CanCreateExecuteBuffer: ?*anyopaque,
    CreateExecuteBuffer: ?*anyopaque,
    DestroyExecuteBuffer: ?*anyopaque,
    LockExecuteBuffer: ?*anyopaque,
    UnlockExecuteBuffer: ?*anyopaque,
};
type
  DDHAL_DDEXEBUFCALLBACKS {.bycopy.} = object
    dwSize: uint32
    dwFlags: uint32
    CanCreateExecuteBuffer: pointer
    CreateExecuteBuffer: pointer
    DestroyExecuteBuffer: pointer
    LockExecuteBuffer: pointer
    UnlockExecuteBuffer: pointer
struct DDHAL_DDEXEBUFCALLBACKS
{
    uint dwSize;
    uint dwFlags;
    void* CanCreateExecuteBuffer;
    void* CreateExecuteBuffer;
    void* DestroyExecuteBuffer;
    void* LockExecuteBuffer;
    void* UnlockExecuteBuffer;
}

HSP用 定義

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

; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x86 レイアウト)
; DDHAL_DDEXEBUFCALLBACKS サイズ: 28 バイト(x86)
dim st, 7    ; 4byte整数×7(構造体サイズ 28 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; CanCreateExecuteBuffer : LPDDHALEXEBUFCB_CANCREATEEXEBUF (+8, 4byte)  st.2 = 値  /  値 = st.2   (lpoke/lpeek も可)
; CreateExecuteBuffer : LPDDHALEXEBUFCB_CREATEEXEBUF (+12, 4byte)  st.3 = 値  /  値 = st.3   (lpoke/lpeek も可)
; DestroyExecuteBuffer : LPDDHALEXEBUFCB_DESTROYEXEBUF (+16, 4byte)  st.4 = 値  /  値 = st.4   (lpoke/lpeek も可)
; LockExecuteBuffer : LPDDHALEXEBUFCB_LOCKEXEBUF (+20, 4byte)  st.5 = 値  /  値 = st.5   (lpoke/lpeek も可)
; UnlockExecuteBuffer : LPDDHALEXEBUFCB_UNLOCKEXEBUF (+24, 4byte)  st.6 = 値  /  値 = st.6   (lpoke/lpeek も可)
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; HSP3.7/3.8 は構造体機能が無いため、4byte整数の配列変数で操作します。(x64 レイアウト)
; DDHAL_DDEXEBUFCALLBACKS サイズ: 48 バイト(x64)
dim st, 12    ; 4byte整数×12(構造体サイズ 48 / 4 切り上げ)
; dwSize : DWORD (+0, 4byte)  st.0 = 値  /  値 = st.0   (lpoke/lpeek も可)
; dwFlags : DWORD (+4, 4byte)  st.1 = 値  /  値 = st.1   (lpoke/lpeek も可)
; CanCreateExecuteBuffer : LPDDHALEXEBUFCB_CANCREATEEXEBUF (+8, 8byte)  qpoke st,8,値 / qpeek(st,8)  ※IronHSPのみ。3.7/3.8は lpoke st,8,下位 : lpoke st,12,上位
; CreateExecuteBuffer : LPDDHALEXEBUFCB_CREATEEXEBUF (+16, 8byte)  qpoke st,16,値 / qpeek(st,16)  ※IronHSPのみ。3.7/3.8は lpoke st,16,下位 : lpoke st,20,上位
; DestroyExecuteBuffer : LPDDHALEXEBUFCB_DESTROYEXEBUF (+24, 8byte)  qpoke st,24,値 / qpeek(st,24)  ※IronHSPのみ。3.7/3.8は lpoke st,24,下位 : lpoke st,28,上位
; LockExecuteBuffer : LPDDHALEXEBUFCB_LOCKEXEBUF (+32, 8byte)  qpoke st,32,値 / qpeek(st,32)  ※IronHSPのみ。3.7/3.8は lpoke st,32,下位 : lpoke st,36,上位
; UnlockExecuteBuffer : LPDDHALEXEBUFCB_UNLOCKEXEBUF (+40, 8byte)  qpoke st,40,値 / qpeek(st,40)  ※IronHSPのみ。3.7/3.8は lpoke st,40,下位 : lpoke st,44,上位
; ※4byte境界の整数は添字 st.N(N=オフセット/4)で読み書き可。それ以外は peek/poke 系を使用。
; IronHSP は NSTRUCT(構造体)をサポート。32bit/64bit どちらでも同じコードで動作します。
#defstruct global DDHAL_DDEXEBUFCALLBACKS
    #field int dwSize
    #field int dwFlags
    #field intptr CanCreateExecuteBuffer
    #field intptr CreateExecuteBuffer
    #field intptr DestroyExecuteBuffer
    #field intptr LockExecuteBuffer
    #field intptr UnlockExecuteBuffer
#endstruct

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