📄 ddrawi.h
字号:
/*==========================================================================;
*
* Copyright (C) Microsoft Corporation. All Rights Reserved.
*
* File: ddrawi.h
* Content: DirectDraw internal header file
* Used by DirectDraw and by the display drivers.
*
***************************************************************************/
#ifndef __DDRAWI_INCLUDED__
#define __DDRAWI_INCLUDED__
//
// This is a helper for external driver builds.
//
#if (!defined(WIN95)) && (!defined(WINNT))
#define WIN95
#endif
/*
* METAQUESTION: Why are Windows handles stored as DWORDs instead of
* their proper types?
* METAANSWER: To make the thunk to the 16-bit side completely painless.
*/
#define OBJECT_ISROOT 0x80000000l // object is root object
/*
* stuff for drivers
*/
#ifndef _WIN32
typedef long HRESULT;
typedef LPVOID REFIID;
#ifndef GUID_DEFINED
#define GUID_DEFINED
typedef struct _GUID {
ULONG Data1;
unsigned short Data2;
unsigned short Data3;
unsigned char Data4[8];
} GUID;
#endif // !defined(GUID_DEFINED)
typedef GUID FAR *LPGUID;
#define MAKE_HRESULT(sev,fac,code) \
((HRESULT) (((unsigned long)(sev)<<31) | ((unsigned long)(fac)<<16) | ((unsigned long)(code))) )
#endif
/*
* These definitions are required to allow polymorphic structure members (i.e. those
* that are referred to both as DWORDs and as pointers) to resolve into a type
* of correct size to hold the largest of those two types (i.e. pointer) on 64 bit
* systems. For 32 bit environments, ULONG_PTR resolves to a DWORD.
*/
#ifndef MAXULONG_PTR
#define ULONG_PTR DWORD
#define PULONG_PTR LPDWORD
#endif //MAXULONG_PTR
#include "ddraw.h"
#include "dvp.h"
#include "ddkernel.h"
#include "dmemmgr.h"
#ifdef IS_16
// ddraw16 16-bit compiler cannot handle 32-bit d3d headers included by d3dhal.h
// so for ddraw16 build, explicitly list d3dhal ptr types here
#define LPD3DHAL_GLOBALDRIVERDATA ULONG_PTR
#define LPD3DHAL_CALLBACKS ULONG_PTR
#define LPD3DHAL_CALLBACKS2 ULONG_PTR
#define LPD3DHAL_CALLBACKS3 ULONG_PTR
#define LPD3DHAL_D3DEXTENDEDCAPS ULONG_PTR
#define LPD3DHAL_COMMANDBUFFERCALLBACKS ULONG_PTR
#endif
#ifndef _WIN32
/*
* these error codes are DIFFERENT in Win32 and Win16!!!!
*/
#undef E_NOTIMPL
#undef E_OUTOFMEMORY
#undef E_INVALIDARG
#undef E_FAIL
#define E_NOTIMPL 0x80004001L
#define E_OUTOFMEMORY 0x8007000EL
#define E_INVALIDARG 0x80070057L
#define E_FAIL 0x80004005L
#endif
#define DDUNSUPPORTEDMODE ((DWORD) -1)
#define VALID_ALIGNMENT( align ) (!((align == 0) || (align % 2) != 0 ))
#ifdef _WIN32
/*
* These GUIDs are used to identify driver info structures, not interfaces,
* so the prefix GUID_ is used instead of IID_.
*
*/
DEFINE_GUID( GUID_MiscellaneousCallbacks, 0xefd60cc0, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
DEFINE_GUID( GUID_VideoPortCallbacks, 0xefd60cc1, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
DEFINE_GUID( GUID_ColorControlCallbacks, 0xefd60cc2, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
DEFINE_GUID( GUID_VideoPortCaps, 0xefd60cc3, 0x49e7, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
DEFINE_GUID( GUID_D3DCallbacks2, 0x0ba584e1, 0x70b6, 0x11d0, 0x88, 0x9d, 0x00, 0xaa, 0x00, 0xbb, 0xb7, 0x6a);
DEFINE_GUID( GUID_D3DCallbacks3, 0xddf41230, 0xec0a, 0x11d0, 0xa9, 0xb6, 0x00, 0xaa, 0x00, 0xc0, 0x99, 0x3e);
DEFINE_GUID( GUID_NonLocalVidMemCaps, 0x86c4fa80, 0x8d84, 0x11d0, 0x94, 0xe8, 0x00, 0xc0, 0x4f, 0xc3, 0x41, 0x37);
DEFINE_GUID( GUID_KernelCallbacks, 0x80863800, 0x6B06, 0x11D0, 0x9B, 0x06, 0x0, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID( GUID_KernelCaps, 0xFFAA7540, 0x7AA8, 0x11D0, 0x9B, 0x06, 0x00, 0xA0, 0xC9, 0x03, 0xA3, 0xB8);
DEFINE_GUID( GUID_D3DExtendedCaps, 0x7de41f80, 0x9d93, 0x11d0, 0x89, 0xab, 0x0, 0xa0, 0xc9, 0x5, 0x41, 0x29);
DEFINE_GUID( GUID_ZPixelFormats, 0x93869880, 0x36cf, 0x11d1, 0x9b, 0x1b, 0x0, 0xaa, 0x0, 0xbb, 0xb8, 0xae);
DEFINE_GUID( GUID_DDMoreSurfaceCaps, 0x3b8a0466, 0xf269, 0x11d1, 0x88, 0x0b, 0x0, 0xc0, 0x4f, 0xd9, 0x30, 0xc5);
DEFINE_GUID( GUID_DDStereoMode, 0xf828169c, 0xa8e8, 0x11d2, 0xa1, 0xf2, 0x0, 0xa0, 0xc9, 0x83, 0xea, 0xf6);
DEFINE_GUID( GUID_OptSurfaceKmodeInfo, 0xe05c8472, 0x51d4, 0x11d1, 0x8c, 0xce, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID( GUID_OptSurfaceUmodeInfo, 0x9d792804, 0x5fa8, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID( GUID_UserModeDriverInfo, 0xf0b0e8e2, 0x5f97, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID( GUID_UserModeDriverPassword, 0x97f861b6, 0x60a1, 0x11d1, 0x8c, 0xd0, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID(GUID_D3DParseUnknownCommandCallback, 0x2e04ffa0, 0x98e4, 0x11d1, 0x8c, 0xe1, 0x0, 0xa0, 0xc9, 0x6, 0x29, 0xa8);
DEFINE_GUID( GUID_MotionCompCallbacks, 0xb1122b40, 0x5dA5, 0x11d1, 0x8f, 0xcF, 0x00, 0xc0, 0x4f, 0xc2, 0x9b, 0x4e);
DEFINE_GUID( GUID_Miscellaneous2Callbacks, 0x406B2F00, 0x3E5A, 0x11D1, 0xB6, 0x40, 0x00, 0xAA, 0x00, 0xA1, 0xF9, 0x6A);
#endif //_WIN32
// The Callback that the drivers can use to parse unknown commands
// passed to them via the DrawPrimitives2 callback. The driver obtains this
// callback thru a GetDriverInfo call with GUID_D3DParseUnknownCommandCallback
// made by ddraw somewhere around the initialization time.
#ifdef __cplusplus
extern "C"
#endif
HRESULT CALLBACK D3DParseUnknownCommand (LPVOID lpvCommands,
LPVOID *lplpvReturnedCommand);
/*
* This DDPF flag is used by drivers to signify that this format is new and may be
* a candidate for hiding from certain applications
* KEEP THIS DEFINITION IN SYNC WITH THAT OF DDPF_RESERVED1 IN DDRAW.H
*/
#define DDPF_NOVEL_TEXTURE_FORMAT 0x00100000l
/*
* This DDPF flag is used to indicate a DX8+ format capability entry in
* the texture format list. It is not visible to applications.
*/
#define DDPF_D3DFORMAT 0x00200000l
/*
* List of operations supported on formats in DX8+ texture list.
* See the DX8 DDK for a complete description of these flags.
*/
#define D3DFORMAT_OP_TEXTURE 0x00000001L
#define D3DFORMAT_OP_VOLUMETEXTURE 0x00000002L
#define D3DFORMAT_OP_CUBETEXTURE 0x00000004L
#define D3DFORMAT_OP_OFFSCREEN_RENDERTARGET 0x00000008L
#define D3DFORMAT_OP_SAME_FORMAT_RENDERTARGET 0x00000010L
#define D3DFORMAT_OP_ZSTENCIL 0x00000040L
#define D3DFORMAT_OP_ZSTENCIL_WITH_ARBITRARY_COLOR_DEPTH 0x00000080L
// This format can be used as a render target if the current display mode
// is the same depth if the alpha channel is ignored. e.g. if the device
// can render to A8R8G8B8 when the display mode is X8R8G8B8, then the
// format op list entry for A8R8G8B8 should have this cap.
#define D3DFORMAT_OP_SAME_FORMAT_UP_TO_ALPHA_RENDERTARGET 0x00000100L
// This format contains DirectDraw support (including Flip). This flag
// should not to be set on alpha formats.
#define D3DFORMAT_OP_DISPLAYMODE 0x00000400L
// The rasterizer can support some level of Direct3D support in this format
// and implies that the driver can create a Context in this mode (for some
// render target format). When this flag is set, the D3DFORMAT_OP_DISPLAYMODE
// flag must also be set.
#define D3DFORMAT_OP_3DACCELERATION 0x00000800L
// If the driver needs a private format to be D3D or driver manageable,
// then it needs to tell D3D the pixelsize in bits per pixel by setting
// dwPrivateFormatBitCount in DDPIXELFORMAT and by setting the below
// format op. If the below format op is not set, then D3D or the driver
// will NOT be allowed to manage the format.
#define D3DFORMAT_OP_PIXELSIZE 0x00001000L
/*
* List of processes attached to a DirectDraw object
*/
typedef struct _PROCESS_LIST
{
struct _PROCESS_LIST FAR *lpLink;
DWORD dwProcessId;
DWORD dwRefCnt;
DWORD dwAlphaDepth;
DWORD dwZDepth;
} PROCESS_LIST;
typedef PROCESS_LIST FAR *LPPROCESS_LIST;
/*
* Information about the refresh rates that monitor/display card can support
*/
typedef struct _DDMONITORINFO
{
WORD Manufacturer; // Montor manufacturer
WORD Product; // Monitor product ID
DWORD SerialNumber; // Monitor serial number
GUID DeviceIdentifier; // From DDDEVICEIDENTIFIER, describes card/driver
int Mode640x480; // Highest refresh rate support, 0 if none, -1 if untested
int Mode800x600;
int Mode1024x768;
int Mode1280x1024;
int Mode1600x1200;
int ModeReserved1;
int ModeReserved2;
int ModeReserved3;
} DDMONITORINFO, FAR *LPDDMONITORINFO;
/*
* DeleteFromActiveProcessList return codes
*/
#define DELETED_OK 0
#define DELETED_LASTONE 1
#define DELETED_NOTFOUND 2
#define DDBLT_ANYALPHA \
(DDBLT_ALPHASRCSURFACEOVERRIDE | \
DDBLT_ALPHASRCCONSTOVERRIDE | \
DDBLT_ALPHASRC | \
DDBLT_ALPHADESTSURFACEOVERRIDE | \
DDBLT_ALPHADESTCONSTOVERRIDE | \
DDBLT_ALPHADEST)
#define DDOVER_ANYALPHA \
(DDOVER_ALPHASRCSURFACEOVERRIDE | \
DDOVER_ALPHASRCCONSTOVERRIDE | \
DDOVER_ALPHASRC | \
DDOVER_ALPHADESTSURFACEOVERRIDE | \
DDOVER_ALPHADESTCONSTOVERRIDE | \
DDOVER_ALPHADEST)
typedef struct IDirectDrawClipperVtbl DIRECTDRAWCLIPPERCALLBACKS;
typedef struct IDirectDrawPaletteVtbl DIRECTDRAWPALETTECALLBACKS;
typedef struct IDirectDrawSurfaceVtbl DIRECTDRAWSURFACECALLBACKS;
typedef struct IDirectDrawSurface2Vtbl DIRECTDRAWSURFACE2CALLBACKS;
typedef struct IDirectDrawSurface3Vtbl DIRECTDRAWSURFACE3CALLBACKS;
typedef struct IDirectDrawSurface4Vtbl DIRECTDRAWSURFACE4CALLBACKS;
typedef struct IDirectDrawSurface7Vtbl DIRECTDRAWSURFACE7CALLBACKS;
typedef struct IDirectDrawColorControlVtbl DIRECTDRAWCOLORCONTROLCALLBACKS;
typedef struct IDirectDrawVtbl DIRECTDRAWCALLBACKS;
typedef struct IDirectDraw2Vtbl DIRECTDRAW2CALLBACKS;
typedef struct IDirectDraw4Vtbl DIRECTDRAW4CALLBACKS;
typedef struct IDirectDraw7Vtbl DIRECTDRAW7CALLBACKS;
typedef struct IDirectDrawKernelVtbl DIRECTDRAWKERNELCALLBACKS;
typedef struct IDirectDrawSurfaceKernelVtbl DIRECTDRAWSURFACEKERNELCALLBACKS;
typedef struct IDirectDrawGammaControlVtbl DIRECTDRAWGAMMACONTROLCALLBACKS;
typedef DIRECTDRAWCLIPPERCALLBACKS FAR *LPDIRECTDRAWCLIPPERCALLBACKS;
typedef DIRECTDRAWPALETTECALLBACKS FAR *LPDIRECTDRAWPALETTECALLBACKS;
typedef DIRECTDRAWSURFACECALLBACKS FAR *LPDIRECTDRAWSURFACECALLBACKS;
typedef DIRECTDRAWCALLBACKS FAR *LPDIRECTDRAWCALLBACKS;
#ifdef __cplusplus
extern "C" {
#endif
#if defined( IS_32 ) || defined( WIN32 ) || defined( _WIN32 )
#undef IS_32
#define IS_32
#define DDAPI WINAPI
#define EXTERN_DDAPI WINAPI
#else
#define DDAPI __loadds WINAPI
#define EXTERN_DDAPI __export WINAPI
#endif
/*
* DCI escape
*/
#ifndef DCICOMMAND
#define DCICOMMAND 3075 // escape value
#endif
/*
* this is the DirectDraw version
* passed to the driver in DCICMD.dwVersion
*
* Most older HALs will fail if DD_VERSION does not match what they
* are expecting. Therefore, DD_VERSION cannot change if we want DX5+ to
* run on DX2/3 HALs. For this reason, we added a new version call that
* allows the HAL to know the real version of DirectDraw, which is equal
* to DD_RUNTIME_VERSION. This is for informational purposes only. HALs
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -