reactos/dll/directx/ddraw/rosdraw.h

289 lines
7.7 KiB
C
Raw Normal View History

#pragma once
/********* Includes *********/
#include <windows.h>
#include <stdio.h>
#include <ddraw.h>
#include <ddrawi.h>
#include <d3dhal.h>
#include <ddrawgdi.h>
#include <pseh/pseh.h>
modified include/reactos/probe.h Workaround for gcc 4.1.3. See http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38054#c7 modified ntoskrnl/include/internal/mm.h gcc 4.3.2 doesn't like to be told to inline MmAcquirePageListLock modified ntoskrnl/include/internal/probe.h Cleaning up after TSVN's buggy "apply patch" modified subsystems/win32/win32k/ntuser/message.c Silence a gcc 4.3.2 warning (possibly incorrectly) modified dll/directx/ddraw/ddraw.rbuild modified dll/win32/gdi32/gdi32.rbuild modified dll/win32/kernel32/kernel32.rbuild modified dll/win32/psapi/psapi.rbuild modified dll/win32/setupapi/setupapi.rbuild modified dll/win32/syssetup/syssetup.rbuild modified dll/win32/user32/user32.rbuild modified drivers/input/kbdclass/kbdclass.rbuild modified drivers/input/mouclass/mouclass.rbuild modified drivers/network/afd/afd.rbuild modified drivers/network/tcpip/tcpip.rbuild modified lib/rtl/rtl.rbuild modified subsystems/win32/win32k/win32k.rbuild modified subsystems/win32/win32k/objects/gdiobj.c gcc 4.1.3 workarounds. See embedded comments modified base/services/eventlog/eventlog.h modified dll/win32/advapi32/advapi32.h Removed superfluous includes of pseh/pseh.h modified dll/directx/ddraw/Ddraw/ddraw_displaymode.c modified dll/directx/ddraw/Ddraw/ddraw_main.c modified dll/directx/ddraw/Ddraw/ddraw_setcooperativelevel.c modified dll/directx/ddraw/Ddraw/GetCaps.c modified dll/directx/ddraw/Ddraw/GetDeviceIdentifier.c modified dll/directx/ddraw/main.c modified dll/directx/ddraw/rosdraw.h modified dll/directx/ddraw/Surface/surface_main.c ddraw migrated to PSEH 2.0 modified dll/win32/gdi32/include/precomp.h modified dll/win32/gdi32/misc/misc.c modified dll/win32/gdi32/objects/bitmap.c gdi32 migrated to PSEH 2.0 modified dll/win32/kernel32/except/except.c modified dll/win32/kernel32/file/find.c modified dll/win32/kernel32/k32.h modified dll/win32/kernel32/mem/isbad.c modified dll/win32/kernel32/misc/console.c modified dll/win32/kernel32/process/procsup.c modified dll/win32/kernel32/string/lstring.c modified dll/win32/kernel32/thread/thread.c kernel32 migrated to PSEH 2.0 modified dll/win32/psapi/precomp.h modified dll/win32/psapi/psapi.c psapi migrated to PSEH 2.0 modified dll/win32/setupapi/cfgmgr.c modified dll/win32/setupapi/setupapi_private.h setupapi migrated to PSEH 2.0 modified dll/win32/syssetup/wizard.c syssetup migrated to PSEH 2.0 modified dll/win32/user32/include/user32.h modified dll/win32/user32/windows/class.c modified dll/win32/user32/windows/text.c modified dll/win32/user32/windows/window.c user32 migrated to PSEH 2.0 modified drivers/input/kbdclass/kbdclass.c modified drivers/input/kbdclass/kbdclass.h kbdclass migrated to PSEH 2.0 modified drivers/input/mouclass/mouclass.c modified drivers/input/mouclass/mouclass.h mouclass migrated to PSEH 2.0 modified drivers/network/afd/afd/info.c modified drivers/network/afd/afd/lock.c modified drivers/network/afd/afd/tdi.c modified drivers/network/afd/afd/tdiconn.c afd migrated to PSEH 2.0 modified drivers/network/lan/lan/lan.c lan migrated to PSEH 2.0 modified drivers/network/tcpip/tcpip/dispatch.c tcpip migrated to PSEH 2.0 modified lib/rtl/debug.c modified lib/rtl/res.c modified lib/rtl/rtl.h modified lib/rtl/unicode.c modified lib/rtl/workitem.c rtl migrated to PSEH 2.0 modified ntoskrnl/include/precomp.h ntoskrnl migrated to PSEH 2.0 modified subsystems/csr/csrsrv/api.c csrsrv migrated to PSEH 2.0 modified subsystems/win32/win32k/eng/bitblt.c modified subsystems/win32/win32k/eng/mem.c modified subsystems/win32/win32k/include/mmcopy.h modified subsystems/win32/win32k/misc/copy.c modified subsystems/win32/win32k/ntuser/callback.c modified subsystems/win32/win32k/ntuser/class.c modified subsystems/win32/win32k/ntuser/clipboard.c modified subsystems/win32/win32k/ntuser/cursoricon.c modified subsystems/win32/win32k/ntuser/display.c modified subsystems/win32/win32k/ntuser/hook.c modified subsystems/win32/win32k/ntuser/input.c modified subsystems/win32/win32k/ntuser/kbdlayout.c modified subsystems/win32/win32k/ntuser/menu.c modified subsystems/win32/win32k/ntuser/misc.c modified subsystems/win32/win32k/ntuser/ntstubs.c modified subsystems/win32/win32k/ntuser/painting.c modified subsystems/win32/win32k/ntuser/simplecall.c modified subsystems/win32/win32k/ntuser/sysparams.c modified subsystems/win32/win32k/ntuser/window.c modified subsystems/win32/win32k/objects/bitblt.c modified subsystems/win32/win32k/objects/bitmaps.c modified subsystems/win32/win32k/objects/brush.c modified subsystems/win32/win32k/objects/cliprgn.c modified subsystems/win32/win32k/objects/color.c modified subsystems/win32/win32k/objects/coord.c modified subsystems/win32/win32k/objects/dc.c modified subsystems/win32/win32k/objects/dcutil.c modified subsystems/win32/win32k/objects/dibobj.c modified subsystems/win32/win32k/objects/fillshap.c modified subsystems/win32/win32k/objects/font.c modified subsystems/win32/win32k/objects/freetype.c modified subsystems/win32/win32k/objects/icm.c modified subsystems/win32/win32k/objects/line.c modified subsystems/win32/win32k/objects/path.c modified subsystems/win32/win32k/objects/pen.c modified subsystems/win32/win32k/objects/print.c modified subsystems/win32/win32k/objects/region.c modified subsystems/win32/win32k/objects/text.c modified subsystems/win32/win32k/pch.h win32k migrated to PSEH 2.0 svn path=/trunk/; revision=37776
2008-11-30 19:28:11 +00:00
#include <pseh/pseh2.h>
#include "Ddraw/ddraw.h"
#include "Surface/surface.h"
#include "Clipper/clipper.h"
#include "resource.h"
/* DirectDraw startup code only internal use */
extern DDRAWI_DIRECTDRAW_GBL ddgbl;
extern DDRAWI_DDRAWSURFACE_GBL ddSurfGbl;
extern WCHAR classname[128];
extern WNDCLASSW wnd_class;
extern CRITICAL_SECTION ddcs;
extern IDirectDraw7Vtbl DirectDraw7_Vtable;
extern IDirectDraw4Vtbl DirectDraw4_Vtable;
extern IDirectDraw2Vtbl DirectDraw2_Vtable;
extern IDirectDrawVtbl DirectDraw_Vtable;
extern IDirectDrawSurface7Vtbl DirectDrawSurface7_Vtable;
extern IDirectDrawSurface4Vtbl DirectDrawSurface4_Vtable;
extern IDirectDrawSurface3Vtbl DirectDrawSurface3_Vtable;
extern IDirectDrawSurface2Vtbl DirectDrawSurface2_Vtable;
extern IDirectDrawSurfaceVtbl DirectDrawSurface_Vtable;
extern const IDirectDrawPaletteVtbl DirectDrawPalette_Vtable;
extern IDirectDrawClipperVtbl DirectDrawClipper_Vtable;
extern IDirectDrawColorControlVtbl DirectDrawColorControl_Vtable;
extern IDirectDrawGammaControlVtbl DirectDrawGammaControl_Vtable;
extern IDirectDrawKernelVtbl DirectDrawKernel_Vtable;
extern IDirectDrawSurfaceKernelVtbl DirectDrawSurfaceKernel_Vtable;
extern IDirect3DVtbl IDirect3D_Vtbl;
extern IDirect3D2Vtbl IDirect3D2_Vtbl;
extern IDirect3D3Vtbl IDirect3D3_Vtbl;
extern IDirect3D7Vtbl IDirect3D7_Vtbl;
/* Start up direct hal or hel
* iface = a pointer to the com object
* pGUID = guid hardware accelerations or software acceleration this can be NULL
* reenable = FALSE if we whant create a new directdraw com
* = TRUE if we really whant rebuild the whole com interface (not in use)
*/
HRESULT WINAPI
StartDirectDraw(
LPDIRECTDRAW iface,
LPGUID pGUID,
BOOL reenable);
/* iface = a pointer to the com object
* reenable = FALSE / TRUE rebuld dx hal interface, this is need if we doing a mode change
*/
HRESULT WINAPI
StartDirectDrawHal(
LPDIRECTDRAW iface,
BOOL reenable);
/* iface = a pointer to the com object
* reenable = FALSE / TRUE rebuld dx hel interface, this is need if we doing a mode change
*/
HRESULT WINAPI
StartDirectDrawHel(
LPDIRECTDRAW iface,
BOOL reenable);
HRESULT WINAPI
Create_DirectDraw (
LPGUID pGUID,
LPDIRECTDRAW* pIface,
REFIID id,
BOOL ex);
HRESULT WINAPI
ReCreateDirectDraw(LPDIRECTDRAW iface);
HRESULT
Internal_CreateSurface(
LPDDRAWI_DIRECTDRAW_INT pDDraw,
LPDDSURFACEDESC2 pDDSD,
LPDDRAWI_DDRAWSURFACE_INT *ppSurf,
IUnknown *pUnkOuter);
HRESULT
Internal_CreatePalette( LPDDRAWI_DIRECTDRAW_INT pDDraw, DWORD dwFlags,
LPPALETTEENTRY palent, LPDIRECTDRAWPALETTE* ppPalette, LPUNKNOWN pUnkOuter);
/* convert DDSURFACEDESC to DDSURFACEDESC2 */
void CopyDDSurfDescToDDSurfDesc2(LPDDSURFACEDESC2 dst_pDesc, LPDDSURFACEDESC src_pDesc);
/* DirectDraw Cleanup code only internal use */
VOID Cleanup(LPDDRAWI_DIRECTDRAW_INT iface);
/* own macro to alloc memory */
/*
#define DxHeapMemAlloc(m) HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, m)
#define DxHeapMemFree(p) HeapFree(GetProcessHeap(), 0, p); \
p = NULL;
*/
#define DxHeapMemAlloc(p, m) { \
p = malloc(m); \
if (p != NULL) \
{ \
ZeroMemory(p,m); \
} \
}
#define DxHeapMemFree(p) { \
free(p); \
p = NULL; \
}
/******** Main Object ********/
/* Public interface */
VOID WINAPI AcquireDDThreadLock(VOID);
VOID WINAPI ReleaseDDThreadLock(VOID);
ULONG WINAPI DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface);
HRESULT WINAPI DirectDrawClipper_Initialize( LPDIRECTDRAWCLIPPER iface, LPDIRECTDRAW lpDD, DWORD dwFlags);
typedef struct DDRAWI_DDCOLORCONTROL_INT
{
LPVOID lpVtbl;
LPVOID lpLcl;
LPVOID lpLink;
DWORD dwIntRefCnt;
} DDRAWI_DDCOLORCONTROL_INT, *LPDDRAWI_DDCOLORCONTROL_INT;
typedef struct _DDRAWI_DDGAMMACONTROL_INT
{
LPVOID lpVtbl;
LPVOID lpLcl;
LPVOID lpLink;
DWORD dwIntRefCnt;
} DDRAWI_DDGAMMACONTROL_INT, *LPDDRAWI_DDGAMMACONTROL_INT;
typedef struct _DDRAWI_DDKERNEL_INT
{
LPVOID lpVtbl;
LPVOID lpLcl;
LPVOID lpLink;
DWORD dwIntRefCnt;
} DDRAWI_KERNEL_INT, *LPDDRAWI_KERNEL_INT;
typedef struct _DDRAWI_DDKERNELSURFACE_INT
{
LPVOID lpVtbl;
LPVOID lpLcl;
LPVOID lpLink;
DWORD dwIntRefCnt;
} _DDRAWI_DDKERNELSURFACE_INT, *LPDDRAWI_DDKERNELSURFACE_INT;
/* now to real info that are for private use and are our own */
/********* Prototypes **********/
VOID Hal_DirectDraw_Release (LPDIRECTDRAW7);
/* Setting for HEL should be move to ros special reg key ? */
/* setup how much graphic memory should hel be limit, set it now to 64MB */
#define HEL_GRAPHIC_MEMORY_MAX 67108864
/*********** Macros ***********/
/*
use this macro to close
down the debugger text complete
no debuging at all, it will
crash ms debugger in VS
*/
//#define DX_WINDBG_trace()
//#define DX_STUB
//#define DX_STUB_DD_OK return DD_OK;
//#define DX_STUB_str(x)
//#define DX_WINDBG_trace_res
/*
Use this macro if you want debug in visual studio or
if you have a program to look at the _INT struct from
ReactOS ddraw.dll or ms ddraw.dll, so you can see what
value ms are being setup.
This macro will create allot warnings and can not be help when you compile
*/
//#define DX_WINDBG_trace()
//#define DX_STUB
//#define DX_STUB_DD_OK return DD_OK;
//#define DX_STUB_str(x) printf("%s",x);
//#define DX_WINDBG_trace_res
/*
use this if want doing a trace from a program
like a game and ReactOS ddraw.dll in windows
so you can figout what going wrong and what
api are being call or if it hel or is it hal
This marco does not create warnings when you compile
*/
#define DX_STUB \
{ \
static BOOL firstcall = TRUE; \
if (firstcall) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Function %s is not implemented yet (%s:%d)\n", __FUNCTION__,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
firstcall = FALSE; \
} \
} \
return DDERR_UNSUPPORTED;
#define DX_STUB_DD_OK \
{ \
static BOOL firstcall = TRUE; \
if (firstcall) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Function %s is not implemented yet (%s:%d)\n", __FUNCTION__,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
firstcall = FALSE; \
} \
} \
return DD_OK;
#if 1
#define DX_STUB_str(x) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Function %s %s (%s:%d)\n", __FUNCTION__,x,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
}
#define DX_WINDBG_trace() \
static BOOL firstcallx = TRUE; \
if (firstcallx) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Enter Function %s (%s:%d)\n", __FUNCTION__,__FILE__,__LINE__ ); \
OutputDebugStringA(buffer); \
firstcallx = TRUE; \
}
#define DX_WINDBG_trace_res(width,height,bpp, freq) \
static BOOL firstcallxx = TRUE; \
if (firstcallxx) \
{ \
char buffer[1024]; \
sprintf ( buffer, "Setmode have been req width=%ld, height=%ld bpp=%ld freq = %ld\n",width,height,bpp, freq); \
OutputDebugStringA(buffer); \
firstcallxx = TRUE; \
}
#else
#define DX_WINDBG_trace() //
#define DX_WINDBG_trace_res(width,height,bpp, freq) \\
#define DX_STUB_str(x) //
#endif