Home | History | Annotate | Download | only in dshow
      1 /*
      2  * Copyright (C) the Wine project
      3  *
      4  * This library is free software; you can redistribute it and/or
      5  * modify it under the terms of the GNU Lesser General Public
      6  * License as published by the Free Software Foundation; either
      7  * version 2.1 of the License, or (at your option) any later version.
      8  *
      9  * This library is distributed in the hope that it will be useful,
     10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
     12  * Lesser General Public License for more details.
     13  *
     14  * You should have received a copy of the GNU Lesser General Public
     15  * License along with this library; if not, write to the Free Software
     16  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
     17  */
     18 
     19 #ifndef __DDRAW_INCLUDED__
     20 #define __DDRAW_INCLUDED__
     21 
     22 #define COM_NO_WINDOWS_H
     23 #include <objbase.h>
     24 #include <dshow/_mingw_dxhelper.h>
     25 
     26 #ifdef __cplusplus
     27 extern "C" {
     28 #endif /* defined(__cplusplus) */
     29 
     30 #ifndef	DIRECTDRAW_VERSION
     31 #define	DIRECTDRAW_VERSION	0x0700
     32 #endif /* DIRECTDRAW_VERSION */
     33 
     34 /*****************************************************************************
     35  * Predeclare the interfaces
     36  */
     37 #ifndef __DDRAW_GUID_DEFINED__
     38 DEFINE_GUID( CLSID_DirectDraw,		0xD7B70EE0,0x4340,0x11CF,0xB0,0x63,0x00,0x20,0xAF,0xC2,0xCD,0x35 );
     39 DEFINE_GUID( CLSID_DirectDraw7,         0x3C305196,0x50DB,0x11D3,0x9C,0xFE,0x00,0xC0,0x4F,0xD9,0x30,0xC5 );
     40 DEFINE_GUID( CLSID_DirectDrawClipper,	0x593817A0,0x7DB3,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xb9,0x33,0x56 );
     41 DEFINE_GUID( IID_IDirectDraw,		0x6C14DB80,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
     42 DEFINE_GUID( IID_IDirectDraw2,		0xB3A6F3E0,0x2B43,0x11CF,0xA2,0xDE,0x00,0xAA,0x00,0xB9,0x33,0x56 );
     43 DEFINE_GUID( IID_IDirectDraw3,		0x618f8ad4,0x8b7a,0x11d0,0x8f,0xcc,0x0,0xc0,0x4f,0xd9,0x18,0x9d );
     44 DEFINE_GUID( IID_IDirectDraw4,          0x9c59509a,0x39bd,0x11d1,0x8c,0x4a,0x00,0xc0,0x4f,0xd9,0x30,0xc5 );
     45 DEFINE_GUID( IID_IDirectDraw7,          0x15e65ec0,0x3b9c,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
     46 DEFINE_GUID( IID_IDirectDrawSurface,	0x6C14DB81,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
     47 DEFINE_GUID( IID_IDirectDrawSurface2,	0x57805885,0x6eec,0x11cf,0x94,0x41,0xa8,0x23,0x03,0xc1,0x0e,0x27 );
     48 DEFINE_GUID( IID_IDirectDrawSurface3,	0xDA044E00,0x69B2,0x11D0,0xA1,0xD5,0x00,0xAA,0x00,0xB8,0xDF,0xBB );
     49 DEFINE_GUID( IID_IDirectDrawSurface4,   0x0B2B8630,0xAD35,0x11D0,0x8E,0xA6,0x00,0x60,0x97,0x97,0xEA,0x5B );
     50 DEFINE_GUID( IID_IDirectDrawSurface7,   0x06675a80,0x3b9b,0x11d2,0xb9,0x2f,0x00,0x60,0x97,0x97,0xea,0x5b );
     51 DEFINE_GUID( IID_IDirectDrawPalette,	0x6C14DB84,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
     52 DEFINE_GUID( IID_IDirectDrawClipper,	0x6C14DB85,0xA733,0x11CE,0xA5,0x21,0x00,0x20,0xAF,0x0B,0xE5,0x60 );
     53 DEFINE_GUID( IID_IDirectDrawColorControl,0x4B9F0EE0,0x0D7E,0x11D0,0x9B,0x06,0x00,0xA0,0xC9,0x03,0xA3,0xB8 );
     54 DEFINE_GUID( IID_IDirectDrawGammaControl,0x69C11C3E,0xB46B,0x11D1,0xAD,0x7A,0x00,0xC0,0x4F,0xC2,0x9B,0x4E );
     55 #endif
     56 
     57 typedef struct IDirectDraw *LPDIRECTDRAW;
     58 typedef struct IDirectDraw2 *LPDIRECTDRAW2;
     59 typedef struct IDirectDraw3 *LPDIRECTDRAW3;
     60 typedef struct IDirectDraw4 *LPDIRECTDRAW4;
     61 typedef struct IDirectDraw7 *LPDIRECTDRAW7;
     62 typedef struct IDirectDrawClipper *LPDIRECTDRAWCLIPPER;
     63 typedef struct IDirectDrawPalette *LPDIRECTDRAWPALETTE;
     64 typedef struct IDirectDrawSurface *LPDIRECTDRAWSURFACE;
     65 typedef struct IDirectDrawSurface2 *LPDIRECTDRAWSURFACE2;
     66 typedef struct IDirectDrawSurface3 *LPDIRECTDRAWSURFACE3;
     67 typedef struct IDirectDrawSurface4 *LPDIRECTDRAWSURFACE4;
     68 typedef struct IDirectDrawSurface7 *LPDIRECTDRAWSURFACE7;
     69 typedef struct IDirectDrawColorControl *LPDIRECTDRAWCOLORCONTROL;
     70 typedef struct IDirectDrawGammaControl *LPDIRECTDRAWGAMMACONTROL;
     71 
     72 
     73 #define DDENUMRET_CANCEL	0
     74 #define DDENUMRET_OK		1
     75 
     76 #define DD_OK			S_OK
     77 #define DD_FALSE		S_FALSE
     78 
     79 
     80 #define _FACDD		0x876
     81 #define MAKE_DDHRESULT( code )  MAKE_HRESULT( 1, _FACDD, code )
     82 
     83 #define DDERR_ALREADYINITIALIZED		MAKE_DDHRESULT( 5 )
     84 #define DDERR_CANNOTATTACHSURFACE		MAKE_DDHRESULT( 10 )
     85 #define DDERR_CANNOTDETACHSURFACE		MAKE_DDHRESULT( 20 )
     86 #define DDERR_CURRENTLYNOTAVAIL			MAKE_DDHRESULT( 40 )
     87 #define DDERR_EXCEPTION				MAKE_DDHRESULT( 55 )
     88 #define DDERR_GENERIC				E_FAIL
     89 #define DDERR_HEIGHTALIGN			MAKE_DDHRESULT( 90 )
     90 #define DDERR_INCOMPATIBLEPRIMARY		MAKE_DDHRESULT( 95 )
     91 #define DDERR_INVALIDCAPS			MAKE_DDHRESULT( 100 )
     92 #define DDERR_INVALIDCLIPLIST			MAKE_DDHRESULT( 110 )
     93 #define DDERR_INVALIDMODE			MAKE_DDHRESULT( 120 )
     94 #define DDERR_INVALIDOBJECT			MAKE_DDHRESULT( 130 )
     95 #define DDERR_INVALIDPARAMS			E_INVALIDARG
     96 #define DDERR_INVALIDPIXELFORMAT		MAKE_DDHRESULT( 145 )
     97 #define DDERR_INVALIDRECT			MAKE_DDHRESULT( 150 )
     98 #define DDERR_LOCKEDSURFACES			MAKE_DDHRESULT( 160 )
     99 #define DDERR_NO3D				MAKE_DDHRESULT( 170 )
    100 #define DDERR_NOALPHAHW				MAKE_DDHRESULT( 180 )
    101 #define DDERR_NOSTEREOHARDWARE          	MAKE_DDHRESULT( 181 )
    102 #define DDERR_NOSURFACELEFT                     MAKE_DDHRESULT( 182 )
    103 #define DDERR_NOCLIPLIST			MAKE_DDHRESULT( 205 )
    104 #define DDERR_NOCOLORCONVHW			MAKE_DDHRESULT( 210 )
    105 #define DDERR_NOCOOPERATIVELEVELSET		MAKE_DDHRESULT( 212 )
    106 #define DDERR_NOCOLORKEY			MAKE_DDHRESULT( 215 )
    107 #define DDERR_NOCOLORKEYHW			MAKE_DDHRESULT( 220 )
    108 #define DDERR_NODIRECTDRAWSUPPORT		MAKE_DDHRESULT( 222 )
    109 #define DDERR_NOEXCLUSIVEMODE			MAKE_DDHRESULT( 225 )
    110 #define DDERR_NOFLIPHW				MAKE_DDHRESULT( 230 )
    111 #define DDERR_NOGDI				MAKE_DDHRESULT( 240 )
    112 #define DDERR_NOMIRRORHW			MAKE_DDHRESULT( 250 )
    113 #define DDERR_NOTFOUND				MAKE_DDHRESULT( 255 )
    114 #define DDERR_NOOVERLAYHW			MAKE_DDHRESULT( 260 )
    115 #define DDERR_OVERLAPPINGRECTS                  MAKE_DDHRESULT( 270 )
    116 #define DDERR_NORASTEROPHW			MAKE_DDHRESULT( 280 )
    117 #define DDERR_NOROTATIONHW			MAKE_DDHRESULT( 290 )
    118 #define DDERR_NOSTRETCHHW			MAKE_DDHRESULT( 310 )
    119 #define DDERR_NOT4BITCOLOR			MAKE_DDHRESULT( 316 )
    120 #define DDERR_NOT4BITCOLORINDEX			MAKE_DDHRESULT( 317 )
    121 #define DDERR_NOT8BITCOLOR			MAKE_DDHRESULT( 320 )
    122 #define DDERR_NOTEXTUREHW			MAKE_DDHRESULT( 330 )
    123 #define DDERR_NOVSYNCHW				MAKE_DDHRESULT( 335 )
    124 #define DDERR_NOZBUFFERHW			MAKE_DDHRESULT( 340 )
    125 #define DDERR_NOZOVERLAYHW			MAKE_DDHRESULT( 350 )
    126 #define DDERR_OUTOFCAPS				MAKE_DDHRESULT( 360 )
    127 #define DDERR_OUTOFMEMORY			E_OUTOFMEMORY
    128 #define DDERR_OUTOFVIDEOMEMORY			MAKE_DDHRESULT( 380 )
    129 #define DDERR_OVERLAYCANTCLIP			MAKE_DDHRESULT( 382 )
    130 #define DDERR_OVERLAYCOLORKEYONLYONEACTIVE	MAKE_DDHRESULT( 384 )
    131 #define DDERR_PALETTEBUSY			MAKE_DDHRESULT( 387 )
    132 #define DDERR_COLORKEYNOTSET			MAKE_DDHRESULT( 400 )
    133 #define DDERR_SURFACEALREADYATTACHED		MAKE_DDHRESULT( 410 )
    134 #define DDERR_SURFACEALREADYDEPENDENT		MAKE_DDHRESULT( 420 )
    135 #define DDERR_SURFACEBUSY			MAKE_DDHRESULT( 430 )
    136 #define DDERR_CANTLOCKSURFACE			MAKE_DDHRESULT( 435 )
    137 #define DDERR_SURFACEISOBSCURED			MAKE_DDHRESULT( 440 )
    138 #define DDERR_SURFACELOST			MAKE_DDHRESULT( 450 )
    139 #define DDERR_SURFACENOTATTACHED		MAKE_DDHRESULT( 460 )
    140 #define DDERR_TOOBIGHEIGHT			MAKE_DDHRESULT( 470 )
    141 #define DDERR_TOOBIGSIZE			MAKE_DDHRESULT( 480 )
    142 #define DDERR_TOOBIGWIDTH			MAKE_DDHRESULT( 490 )
    143 #define DDERR_UNSUPPORTED			E_NOTIMPL
    144 #define DDERR_UNSUPPORTEDFORMAT			MAKE_DDHRESULT( 510 )
    145 #define DDERR_UNSUPPORTEDMASK			MAKE_DDHRESULT( 520 )
    146 #define DDERR_INVALIDSTREAM                     MAKE_DDHRESULT( 521 )
    147 #define DDERR_VERTICALBLANKINPROGRESS		MAKE_DDHRESULT( 537 )
    148 #define DDERR_WASSTILLDRAWING			MAKE_DDHRESULT( 540 )
    149 #define DDERR_DDSCAPSCOMPLEXREQUIRED            MAKE_DDHRESULT( 542 )
    150 #define DDERR_XALIGN				MAKE_DDHRESULT( 560 )
    151 #define DDERR_INVALIDDIRECTDRAWGUID		MAKE_DDHRESULT( 561 )
    152 #define DDERR_DIRECTDRAWALREADYCREATED		MAKE_DDHRESULT( 562 )
    153 #define DDERR_NODIRECTDRAWHW			MAKE_DDHRESULT( 563 )
    154 #define DDERR_PRIMARYSURFACEALREADYEXISTS	MAKE_DDHRESULT( 564 )
    155 #define DDERR_NOEMULATION			MAKE_DDHRESULT( 565 )
    156 #define DDERR_REGIONTOOSMALL			MAKE_DDHRESULT( 566 )
    157 #define DDERR_CLIPPERISUSINGHWND		MAKE_DDHRESULT( 567 )
    158 #define DDERR_NOCLIPPERATTACHED			MAKE_DDHRESULT( 568 )
    159 #define DDERR_NOHWND				MAKE_DDHRESULT( 569 )
    160 #define DDERR_HWNDSUBCLASSED			MAKE_DDHRESULT( 570 )
    161 #define DDERR_HWNDALREADYSET			MAKE_DDHRESULT( 571 )
    162 #define DDERR_NOPALETTEATTACHED			MAKE_DDHRESULT( 572 )
    163 #define DDERR_NOPALETTEHW			MAKE_DDHRESULT( 573 )
    164 #define DDERR_BLTFASTCANTCLIP			MAKE_DDHRESULT( 574 )
    165 #define DDERR_NOBLTHW				MAKE_DDHRESULT( 575 )
    166 #define DDERR_NODDROPSHW			MAKE_DDHRESULT( 576 )
    167 #define DDERR_OVERLAYNOTVISIBLE			MAKE_DDHRESULT( 577 )
    168 #define DDERR_NOOVERLAYDEST			MAKE_DDHRESULT( 578 )
    169 #define DDERR_INVALIDPOSITION			MAKE_DDHRESULT( 579 )
    170 #define DDERR_NOTAOVERLAYSURFACE		MAKE_DDHRESULT( 580 )
    171 #define DDERR_EXCLUSIVEMODEALREADYSET		MAKE_DDHRESULT( 581 )
    172 #define DDERR_NOTFLIPPABLE			MAKE_DDHRESULT( 582 )
    173 #define DDERR_CANTDUPLICATE			MAKE_DDHRESULT( 583 )
    174 #define DDERR_NOTLOCKED				MAKE_DDHRESULT( 584 )
    175 #define DDERR_CANTCREATEDC			MAKE_DDHRESULT( 585 )
    176 #define DDERR_NODC				MAKE_DDHRESULT( 586 )
    177 #define DDERR_WRONGMODE				MAKE_DDHRESULT( 587 )
    178 #define DDERR_IMPLICITLYCREATED			MAKE_DDHRESULT( 588 )
    179 #define DDERR_NOTPALETTIZED			MAKE_DDHRESULT( 589 )
    180 #define DDERR_UNSUPPORTEDMODE			MAKE_DDHRESULT( 590 )
    181 #define DDERR_NOMIPMAPHW			MAKE_DDHRESULT( 591 )
    182 #define DDERR_INVALIDSURFACETYPE		MAKE_DDHRESULT( 592 )
    183 #define DDERR_NOOPTIMIZEHW			MAKE_DDHRESULT( 600 )
    184 #define DDERR_NOTLOADED				MAKE_DDHRESULT( 601 )
    185 #define DDERR_NOFOCUSWINDOW			MAKE_DDHRESULT( 602 )
    186 #define DDERR_NOTONMIPMAPSUBLEVEL               MAKE_DDHRESULT( 603 )
    187 #define DDERR_DCALREADYCREATED			MAKE_DDHRESULT( 620 )
    188 #define DDERR_NONONLOCALVIDMEM			MAKE_DDHRESULT( 630 )
    189 #define DDERR_CANTPAGELOCK			MAKE_DDHRESULT( 640 )
    190 #define DDERR_CANTPAGEUNLOCK			MAKE_DDHRESULT( 660 )
    191 #define DDERR_NOTPAGELOCKED			MAKE_DDHRESULT( 680 )
    192 #define DDERR_MOREDATA				MAKE_DDHRESULT( 690 )
    193 #define DDERR_EXPIRED                           MAKE_DDHRESULT( 691 )
    194 #define DDERR_TESTFINISHED                      MAKE_DDHRESULT( 692 )
    195 #define DDERR_NEWMODE                           MAKE_DDHRESULT( 693 )
    196 #define DDERR_D3DNOTINITIALIZED                 MAKE_DDHRESULT( 694 )
    197 #define DDERR_VIDEONOTACTIVE			MAKE_DDHRESULT( 695 )
    198 #define DDERR_NOMONITORINFORMATION              MAKE_DDHRESULT( 696 )
    199 #define DDERR_NODRIVERSUPPORT                   MAKE_DDHRESULT( 697 )
    200 #define DDERR_DEVICEDOESNTOWNSURFACE		MAKE_DDHRESULT( 699 )
    201 #define DDERR_NOTINITIALIZED			CO_E_NOTINITIALIZED
    202 
    203 /* dwFlags for Blt* */
    204 #define DDBLT_ALPHADEST				0x00000001
    205 #define DDBLT_ALPHADESTCONSTOVERRIDE		0x00000002
    206 #define DDBLT_ALPHADESTNEG			0x00000004
    207 #define DDBLT_ALPHADESTSURFACEOVERRIDE		0x00000008
    208 #define DDBLT_ALPHAEDGEBLEND			0x00000010
    209 #define DDBLT_ALPHASRC				0x00000020
    210 #define DDBLT_ALPHASRCCONSTOVERRIDE		0x00000040
    211 #define DDBLT_ALPHASRCNEG			0x00000080
    212 #define DDBLT_ALPHASRCSURFACEOVERRIDE		0x00000100
    213 #define DDBLT_ASYNC				0x00000200
    214 #define DDBLT_COLORFILL				0x00000400
    215 #define DDBLT_DDFX				0x00000800
    216 #define DDBLT_DDROPS				0x00001000
    217 #define DDBLT_KEYDEST				0x00002000
    218 #define DDBLT_KEYDESTOVERRIDE			0x00004000
    219 #define DDBLT_KEYSRC				0x00008000
    220 #define DDBLT_KEYSRCOVERRIDE			0x00010000
    221 #define DDBLT_ROP				0x00020000
    222 #define DDBLT_ROTATIONANGLE			0x00040000
    223 #define DDBLT_ZBUFFER				0x00080000
    224 #define DDBLT_ZBUFFERDESTCONSTOVERRIDE		0x00100000
    225 #define DDBLT_ZBUFFERDESTOVERRIDE		0x00200000
    226 #define DDBLT_ZBUFFERSRCCONSTOVERRIDE		0x00400000
    227 #define DDBLT_ZBUFFERSRCOVERRIDE		0x00800000
    228 #define DDBLT_WAIT				0x01000000
    229 #define DDBLT_DEPTHFILL				0x02000000
    230 #define DDBLT_DONOTWAIT                         0x08000000
    231 
    232 /* dwTrans for BltFast */
    233 #define DDBLTFAST_NOCOLORKEY			0x00000000
    234 #define DDBLTFAST_SRCCOLORKEY			0x00000001
    235 #define DDBLTFAST_DESTCOLORKEY			0x00000002
    236 #define DDBLTFAST_WAIT				0x00000010
    237 #define DDBLTFAST_DONOTWAIT                     0x00000020
    238 
    239 /* dwFlags for Flip */
    240 #define DDFLIP_WAIT		0x00000001
    241 #define DDFLIP_EVEN		0x00000002 /* only valid for overlay */
    242 #define DDFLIP_ODD		0x00000004 /* only valid for overlay */
    243 #define DDFLIP_NOVSYNC		0x00000008
    244 #define DDFLIP_STEREO		0x00000010
    245 #define DDFLIP_DONOTWAIT	0x00000020
    246 #define DDFLIP_INTERVAL2	0x02000000
    247 #define DDFLIP_INTERVAL3	0x03000000
    248 #define DDFLIP_INTERVAL4	0x04000000
    249 
    250 
    251 /* dwFlags for GetBltStatus */
    252 #define DDGBS_CANBLT				0x00000001
    253 #define DDGBS_ISBLTDONE				0x00000002
    254 
    255 /* dwFlags for IDirectDrawSurface7::GetFlipStatus */
    256 #define DDGFS_CANFLIP		1L
    257 #define DDGFS_ISFLIPDONE	2L
    258 
    259 /* dwFlags for IDirectDrawSurface7::SetPrivateData */
    260 #define DDSPD_IUNKNOWNPOINTER	1L
    261 #define DDSPD_VOLATILE		2L
    262 
    263 /* DDSCAPS.dwCaps */
    264 /* reserved1, was 3d capable */
    265 #define DDSCAPS_RESERVED1		0x00000001
    266 /* surface contains alpha information */
    267 #define DDSCAPS_ALPHA			0x00000002
    268 /* this surface is a backbuffer */
    269 #define DDSCAPS_BACKBUFFER		0x00000004
    270 /* complex surface structure */
    271 #define DDSCAPS_COMPLEX			0x00000008
    272 /* part of surface flipping structure */
    273 #define DDSCAPS_FLIP			0x00000010
    274 /* this surface is the frontbuffer surface */
    275 #define DDSCAPS_FRONTBUFFER		0x00000020
    276 /* this is a plain offscreen surface */
    277 #define DDSCAPS_OFFSCREENPLAIN		0x00000040
    278 /* overlay */
    279 #define DDSCAPS_OVERLAY			0x00000080
    280 /* palette objects can be created and attached to us */
    281 #define DDSCAPS_PALETTE			0x00000100
    282 /* primary surface (the one the user looks at currently)(right eye)*/
    283 #define DDSCAPS_PRIMARYSURFACE		0x00000200
    284 /* primary surface for left eye */
    285 #define DDSCAPS_PRIMARYSURFACELEFT	0x00000400
    286 /* surface exists in systemmemory */
    287 #define DDSCAPS_SYSTEMMEMORY		0x00000800
    288 /* surface can be used as a texture */
    289 #define DDSCAPS_TEXTURE		        0x00001000
    290 /* surface may be destination for 3d rendering */
    291 #define DDSCAPS_3DDEVICE		0x00002000
    292 /* surface exists in videomemory */
    293 #define DDSCAPS_VIDEOMEMORY		0x00004000
    294 /* surface changes immediately visible */
    295 #define DDSCAPS_VISIBLE			0x00008000
    296 /* write only surface */
    297 #define DDSCAPS_WRITEONLY		0x00010000
    298 /* zbuffer surface */
    299 #define DDSCAPS_ZBUFFER			0x00020000
    300 /* has its own DC */
    301 #define DDSCAPS_OWNDC			0x00040000
    302 /* surface should be able to receive live video */
    303 #define DDSCAPS_LIVEVIDEO		0x00080000
    304 /* should be able to have a hw codec decompress stuff into it */
    305 #define DDSCAPS_HWCODEC			0x00100000
    306 /* mode X (320x200 or 320x240) surface */
    307 #define DDSCAPS_MODEX			0x00200000
    308 /* one mipmap surface (1 level) */
    309 #define DDSCAPS_MIPMAP			0x00400000
    310 #define DDSCAPS_RESERVED2		0x00800000
    311 /* memory allocation delayed until Load() */
    312 #define DDSCAPS_ALLOCONLOAD		0x04000000
    313 /* Indicates that the surface will receive data from a video port */
    314 #define DDSCAPS_VIDEOPORT		0x08000000
    315 /* surface is in local videomemory */
    316 #define DDSCAPS_LOCALVIDMEM		0x10000000
    317 /* surface is in nonlocal videomemory */
    318 #define DDSCAPS_NONLOCALVIDMEM		0x20000000
    319 /* surface is a standard VGA mode surface (NOT ModeX) */
    320 #define DDSCAPS_STANDARDVGAMODE		0x40000000
    321 /* optimized? surface */
    322 #define DDSCAPS_OPTIMIZED		0x80000000
    323 
    324 typedef struct _DDSCAPS {
    325     DWORD	dwCaps;	/* capabilities of surface wanted */
    326 } DDSCAPS,*LPDDSCAPS;
    327 
    328 /* DDSCAPS2.dwCaps2 */
    329 /* indicates the surface will receive data from a video port using
    330    deinterlacing hardware. */
    331 #define DDSCAPS2_HARDWAREDEINTERLACE	0x00000002
    332 /* indicates the surface will be locked very frequently. */
    333 #define DDSCAPS2_HINTDYNAMIC		0x00000004
    334 /* indicates surface can be re-ordered or retiled on load() */
    335 #define DDSCAPS2_HINTSTATIC             0x00000008
    336 /* indicates surface to be managed by directdraw/direct3D */
    337 #define DDSCAPS2_TEXTUREMANAGE          0x00000010
    338 /* reserved bits */
    339 #define DDSCAPS2_RESERVED1              0x00000020
    340 #define DDSCAPS2_RESERVED2              0x00000040
    341 /* indicates surface will never be locked again */
    342 #define DDSCAPS2_OPAQUE                 0x00000080
    343 /* set at CreateSurface() time to indicate antialiasing will be used */
    344 #define DDSCAPS2_HINTANTIALIASING       0x00000100
    345 /* set at CreateSurface() time to indicate cubic environment map */
    346 #define DDSCAPS2_CUBEMAP                0x00000200
    347 /* face flags for cube maps */
    348 #define DDSCAPS2_CUBEMAP_POSITIVEX      0x00000400
    349 #define DDSCAPS2_CUBEMAP_NEGATIVEX      0x00000800
    350 #define DDSCAPS2_CUBEMAP_POSITIVEY      0x00001000
    351 #define DDSCAPS2_CUBEMAP_NEGATIVEY      0x00002000
    352 #define DDSCAPS2_CUBEMAP_POSITIVEZ      0x00004000
    353 #define DDSCAPS2_CUBEMAP_NEGATIVEZ      0x00008000
    354 /* specifies all faces of a cube for CreateSurface() */
    355 #define DDSCAPS2_CUBEMAP_ALLFACES ( DDSCAPS2_CUBEMAP_POSITIVEX |\
    356                                     DDSCAPS2_CUBEMAP_NEGATIVEX |\
    357                                     DDSCAPS2_CUBEMAP_POSITIVEY |\
    358                                     DDSCAPS2_CUBEMAP_NEGATIVEY |\
    359                                     DDSCAPS2_CUBEMAP_POSITIVEZ |\
    360                                     DDSCAPS2_CUBEMAP_NEGATIVEZ )
    361 /* set for mipmap sublevels on DirectX7 and later.  ignored by CreateSurface() */
    362 #define DDSCAPS2_MIPMAPSUBLEVEL         0x00010000
    363 /* indicates texture surface to be managed by Direct3D *only* */
    364 #define DDSCAPS2_D3DTEXTUREMANAGE       0x00020000
    365 /* indicates managed surface that can safely be lost */
    366 #define DDSCAPS2_DONOTPERSIST           0x00040000
    367 /* indicates surface is part of a stereo flipping chain */
    368 #define DDSCAPS2_STEREOSURFACELEFT      0x00080000
    369 
    370 typedef struct _DDSCAPS2 {
    371     DWORD	dwCaps;	/* capabilities of surface wanted */
    372     DWORD   dwCaps2; /* additional capabilities */
    373     DWORD   dwCaps3; /* reserved capabilities */
    374     __extension__ union {
    375       DWORD dwCaps4; /* low word is the depth for a volume texture */
    376       DWORD dwVolumeDepth;
    377     } DUMMYUNIONNAME1;
    378 } DDSCAPS2,*LPDDSCAPS2;
    379 
    380 typedef struct _DDSCAPSEX {
    381     DWORD	dwCaps2;
    382     DWORD	dwCaps3;
    383     __extension__ union {
    384     DWORD	dwCaps4;
    385     DWORD	dwVolumeDepth;
    386     } DUMMYUNIONNAME1;
    387 } DDSCAPSEX,*LPDDSCAPSEX;
    388 
    389 #define	DD_ROP_SPACE	(256/32)	/* space required to store ROP array */
    390 
    391 typedef struct _DDCAPS_DX7		/* DirectX 7 version of caps struct */
    392 {
    393     DWORD	dwSize;                 /* size of the DDDRIVERCAPS structure */
    394     DWORD	dwCaps;                 /* driver specific capabilities */
    395     DWORD	dwCaps2;                /* more driver specific capabilities */
    396     DWORD	dwCKeyCaps;             /* color key capabilities of the surface */
    397     DWORD	dwFXCaps;               /* driver specific stretching and effects capabilities */
    398     DWORD	dwFXAlphaCaps;          /* alpha driver specific capabilities */
    399     DWORD	dwPalCaps;              /* palette capabilities */
    400     DWORD	dwSVCaps;               /* stereo vision capabilities */
    401     DWORD	dwAlphaBltConstBitDepths;       /* DDBD_2,4,8 */
    402     DWORD	dwAlphaBltPixelBitDepths;       /* DDBD_1,2,4,8 */
    403     DWORD	dwAlphaBltSurfaceBitDepths;     /* DDBD_1,2,4,8 */
    404     DWORD	dwAlphaOverlayConstBitDepths;   /* DDBD_2,4,8 */
    405     DWORD	dwAlphaOverlayPixelBitDepths;   /* DDBD_1,2,4,8 */
    406     DWORD	dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
    407     DWORD	dwZBufferBitDepths;             /* DDBD_8,16,24,32 */
    408     DWORD	dwVidMemTotal;          /* total amount of video memory */
    409     DWORD	dwVidMemFree;           /* amount of free video memory */
    410     DWORD	dwMaxVisibleOverlays;   /* maximum number of visible overlays */
    411     DWORD	dwCurrVisibleOverlays;  /* current number of visible overlays */
    412     DWORD	dwNumFourCCCodes;       /* number of four cc codes */
    413     DWORD	dwAlignBoundarySrc;     /* source rectangle alignment */
    414     DWORD	dwAlignSizeSrc;         /* source rectangle byte size */
    415     DWORD	dwAlignBoundaryDest;    /* dest rectangle alignment */
    416     DWORD	dwAlignSizeDest;        /* dest rectangle byte size */
    417     DWORD	dwAlignStrideAlign;     /* stride alignment */
    418     DWORD	dwRops[DD_ROP_SPACE];   /* ROPs supported */
    419     DDSCAPS	ddsOldCaps;             /* old DDSCAPS - superseded for DirectX6+ */
    420     DWORD	dwMinOverlayStretch;    /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    421     DWORD	dwMaxOverlayStretch;    /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    422     DWORD	dwMinLiveVideoStretch;  /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    423     DWORD	dwMaxLiveVideoStretch;  /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    424     DWORD	dwMinHwCodecStretch;    /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    425     DWORD	dwMaxHwCodecStretch;    /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    426     DWORD	dwReserved1;
    427     DWORD	dwReserved2;
    428     DWORD	dwReserved3;
    429     DWORD	dwSVBCaps;              /* driver specific capabilities for System->Vmem blts */
    430     DWORD	dwSVBCKeyCaps;          /* driver color key capabilities for System->Vmem blts */
    431     DWORD	dwSVBFXCaps;            /* driver FX capabilities for System->Vmem blts */
    432     DWORD	dwSVBRops[DD_ROP_SPACE];/* ROPs supported for System->Vmem blts */
    433     DWORD	dwVSBCaps;              /* driver specific capabilities for Vmem->System blts */
    434     DWORD	dwVSBCKeyCaps;          /* driver color key capabilities for Vmem->System blts */
    435     DWORD	dwVSBFXCaps;            /* driver FX capabilities for Vmem->System blts */
    436     DWORD	dwVSBRops[DD_ROP_SPACE];/* ROPs supported for Vmem->System blts */
    437     DWORD	dwSSBCaps;              /* driver specific capabilities for System->System blts */
    438     DWORD	dwSSBCKeyCaps;          /* driver color key capabilities for System->System blts */
    439     DWORD	dwSSBFXCaps;            /* driver FX capabilities for System->System blts */
    440     DWORD	dwSSBRops[DD_ROP_SPACE];/* ROPs supported for System->System blts */
    441     DWORD       dwMaxVideoPorts;        /* maximum number of usable video ports */
    442     DWORD   	dwCurrVideoPorts;       /* current number of video ports used */
    443     DWORD   	dwSVBCaps2;             /* more driver specific capabilities for System->Vmem blts */
    444     DWORD   	dwNLVBCaps;             /* driver specific capabilities for non-local->local vidmem blts */
    445     DWORD   	dwNLVBCaps2;            /* more driver specific capabilities non-local->local vidmem blts */
    446     DWORD   	dwNLVBCKeyCaps;         /* driver color key capabilities for non-local->local vidmem blts */
    447     DWORD   	dwNLVBFXCaps;           /* driver FX capabilities for non-local->local blts */
    448     DWORD   	dwNLVBRops[DD_ROP_SPACE]; /* ROPs supported for non-local->local blts */
    449     DDSCAPS2    ddsCaps;		/* surface capabilities */
    450 } DDCAPS_DX7,*LPDDCAPS_DX7;
    451 
    452 typedef struct _DDCAPS_DX6		/* DirectX 6 version of caps struct */
    453 {
    454     DWORD	dwSize;                 /* size of the DDDRIVERCAPS structure */
    455     DWORD	dwCaps;                 /* driver specific capabilities */
    456     DWORD	dwCaps2;                /* more driver specific capabilities */
    457     DWORD	dwCKeyCaps;             /* color key capabilities of the surface */
    458     DWORD	dwFXCaps;               /* driver specific stretching and effects capabilities */
    459     DWORD	dwFXAlphaCaps;          /* alpha driver specific capabilities */
    460     DWORD	dwPalCaps;              /* palette capabilities */
    461     DWORD	dwSVCaps;               /* stereo vision capabilities */
    462     DWORD	dwAlphaBltConstBitDepths;       /* DDBD_2,4,8 */
    463     DWORD	dwAlphaBltPixelBitDepths;       /* DDBD_1,2,4,8 */
    464     DWORD	dwAlphaBltSurfaceBitDepths;     /* DDBD_1,2,4,8 */
    465     DWORD	dwAlphaOverlayConstBitDepths;   /* DDBD_2,4,8 */
    466     DWORD	dwAlphaOverlayPixelBitDepths;   /* DDBD_1,2,4,8 */
    467     DWORD	dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
    468     DWORD	dwZBufferBitDepths;             /* DDBD_8,16,24,32 */
    469     DWORD	dwVidMemTotal;          /* total amount of video memory */
    470     DWORD	dwVidMemFree;           /* amount of free video memory */
    471     DWORD	dwMaxVisibleOverlays;   /* maximum number of visible overlays */
    472     DWORD	dwCurrVisibleOverlays;  /* current number of visible overlays */
    473     DWORD	dwNumFourCCCodes;       /* number of four cc codes */
    474     DWORD	dwAlignBoundarySrc;     /* source rectangle alignment */
    475     DWORD	dwAlignSizeSrc;         /* source rectangle byte size */
    476     DWORD	dwAlignBoundaryDest;    /* dest rectangle alignment */
    477     DWORD	dwAlignSizeDest;        /* dest rectangle byte size */
    478     DWORD	dwAlignStrideAlign;     /* stride alignment */
    479     DWORD	dwRops[DD_ROP_SPACE];   /* ROPs supported */
    480     DDSCAPS	ddsOldCaps;             /* old DDSCAPS - superseded for DirectX6+ */
    481     DWORD	dwMinOverlayStretch;    /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    482     DWORD	dwMaxOverlayStretch;    /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    483     DWORD	dwMinLiveVideoStretch;  /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    484     DWORD	dwMaxLiveVideoStretch;  /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    485     DWORD	dwMinHwCodecStretch;    /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    486     DWORD	dwMaxHwCodecStretch;    /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    487     DWORD	dwReserved1;
    488     DWORD	dwReserved2;
    489     DWORD	dwReserved3;
    490     DWORD	dwSVBCaps;              /* driver specific capabilities for System->Vmem blts */
    491     DWORD	dwSVBCKeyCaps;          /* driver color key capabilities for System->Vmem blts */
    492     DWORD	dwSVBFXCaps;            /* driver FX capabilities for System->Vmem blts */
    493     DWORD	dwSVBRops[DD_ROP_SPACE];/* ROPs supported for System->Vmem blts */
    494     DWORD	dwVSBCaps;              /* driver specific capabilities for Vmem->System blts */
    495     DWORD	dwVSBCKeyCaps;          /* driver color key capabilities for Vmem->System blts */
    496     DWORD	dwVSBFXCaps;            /* driver FX capabilities for Vmem->System blts */
    497     DWORD	dwVSBRops[DD_ROP_SPACE];/* ROPs supported for Vmem->System blts */
    498     DWORD	dwSSBCaps;              /* driver specific capabilities for System->System blts */
    499     DWORD	dwSSBCKeyCaps;          /* driver color key capabilities for System->System blts */
    500     DWORD	dwSSBFXCaps;            /* driver FX capabilities for System->System blts */
    501     DWORD	dwSSBRops[DD_ROP_SPACE];/* ROPs supported for System->System blts */
    502     DWORD       dwMaxVideoPorts;        /* maximum number of usable video ports */
    503     DWORD   	dwCurrVideoPorts;       /* current number of video ports used */
    504     DWORD   	dwSVBCaps2;             /* more driver specific capabilities for System->Vmem blts */
    505     DWORD   	dwNLVBCaps;             /* driver specific capabilities for non-local->local vidmem blts */
    506     DWORD   	dwNLVBCaps2;            /* more driver specific capabilities non-local->local vidmem blts */
    507     DWORD   	dwNLVBCKeyCaps;         /* driver color key capabilities for non-local->local vidmem blts */
    508     DWORD   	dwNLVBFXCaps;           /* driver FX capabilities for non-local->local blts */
    509     DWORD   	dwNLVBRops[DD_ROP_SPACE]; /* ROPs supported for non-local->local blts */
    510     /* and one new member for DirectX 6 */
    511     DDSCAPS2    ddsCaps;		/* surface capabilities */
    512 } DDCAPS_DX6,*LPDDCAPS_DX6;
    513 
    514 typedef struct _DDCAPS_DX5		/* DirectX5 version of caps struct */
    515 {
    516     DWORD	dwSize;                 /* size of the DDDRIVERCAPS structure */
    517     DWORD	dwCaps;                 /* driver specific capabilities */
    518     DWORD	dwCaps2;                /* more driver specific capabilities */
    519     DWORD	dwCKeyCaps;             /* color key capabilities of the surface */
    520     DWORD	dwFXCaps;               /* driver specific stretching and effects capabilities */
    521     DWORD	dwFXAlphaCaps;          /* alpha driver specific capabilities */
    522     DWORD	dwPalCaps;              /* palette capabilities */
    523     DWORD	dwSVCaps;               /* stereo vision capabilities */
    524     DWORD	dwAlphaBltConstBitDepths;       /* DDBD_2,4,8 */
    525     DWORD	dwAlphaBltPixelBitDepths;       /* DDBD_1,2,4,8 */
    526     DWORD	dwAlphaBltSurfaceBitDepths;     /* DDBD_1,2,4,8 */
    527     DWORD	dwAlphaOverlayConstBitDepths;   /* DDBD_2,4,8 */
    528     DWORD	dwAlphaOverlayPixelBitDepths;   /* DDBD_1,2,4,8 */
    529     DWORD	dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
    530     DWORD	dwZBufferBitDepths;             /* DDBD_8,16,24,32 */
    531     DWORD	dwVidMemTotal;          /* total amount of video memory */
    532     DWORD	dwVidMemFree;           /* amount of free video memory */
    533     DWORD	dwMaxVisibleOverlays;   /* maximum number of visible overlays */
    534     DWORD	dwCurrVisibleOverlays;  /* current number of visible overlays */
    535     DWORD	dwNumFourCCCodes;       /* number of four cc codes */
    536     DWORD	dwAlignBoundarySrc;     /* source rectangle alignment */
    537     DWORD	dwAlignSizeSrc;         /* source rectangle byte size */
    538     DWORD	dwAlignBoundaryDest;    /* dest rectangle alignment */
    539     DWORD	dwAlignSizeDest;        /* dest rectangle byte size */
    540     DWORD	dwAlignStrideAlign;     /* stride alignment */
    541     DWORD	dwRops[DD_ROP_SPACE];   /* ROPs supported */
    542     DDSCAPS	ddsCaps;                /* DDSCAPS structure has all the general capabilities */
    543     DWORD	dwMinOverlayStretch;    /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    544     DWORD	dwMaxOverlayStretch;    /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    545     DWORD	dwMinLiveVideoStretch;  /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    546     DWORD	dwMaxLiveVideoStretch;  /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    547     DWORD	dwMinHwCodecStretch;    /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    548     DWORD	dwMaxHwCodecStretch;    /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    549     DWORD	dwReserved1;
    550     DWORD	dwReserved2;
    551     DWORD	dwReserved3;
    552     DWORD	dwSVBCaps;              /* driver specific capabilities for System->Vmem blts */
    553     DWORD	dwSVBCKeyCaps;          /* driver color key capabilities for System->Vmem blts */
    554     DWORD	dwSVBFXCaps;            /* driver FX capabilities for System->Vmem blts */
    555     DWORD	dwSVBRops[DD_ROP_SPACE];/* ROPs supported for System->Vmem blts */
    556     DWORD	dwVSBCaps;              /* driver specific capabilities for Vmem->System blts */
    557     DWORD	dwVSBCKeyCaps;          /* driver color key capabilities for Vmem->System blts */
    558     DWORD	dwVSBFXCaps;            /* driver FX capabilities for Vmem->System blts */
    559     DWORD	dwVSBRops[DD_ROP_SPACE];/* ROPs supported for Vmem->System blts */
    560     DWORD	dwSSBCaps;              /* driver specific capabilities for System->System blts */
    561     DWORD	dwSSBCKeyCaps;          /* driver color key capabilities for System->System blts */
    562     DWORD	dwSSBFXCaps;            /* driver FX capabilities for System->System blts */
    563     DWORD	dwSSBRops[DD_ROP_SPACE];/* ROPs supported for System->System blts */
    564     /* the following are the new DirectX 5 members */
    565     DWORD       dwMaxVideoPorts;        /* maximum number of usable video ports */
    566     DWORD   	dwCurrVideoPorts;       /* current number of video ports used */
    567     DWORD   	dwSVBCaps2;             /* more driver specific capabilities for System->Vmem blts */
    568     DWORD   	dwNLVBCaps;             /* driver specific capabilities for non-local->local vidmem blts */
    569     DWORD   	dwNLVBCaps2;            /* more driver specific capabilities non-local->local vidmem blts */
    570     DWORD   	dwNLVBCKeyCaps;         /* driver color key capabilities for non-local->local vidmem blts */
    571     DWORD   	dwNLVBFXCaps;           /* driver FX capabilities for non-local->local blts */
    572     DWORD   	dwNLVBRops[DD_ROP_SPACE]; /* ROPs supported for non-local->local blts */
    573 } DDCAPS_DX5,*LPDDCAPS_DX5;
    574 
    575 typedef struct _DDCAPS_DX3		/* DirectX3 version of caps struct */
    576 {
    577     DWORD	dwSize;                 /* size of the DDDRIVERCAPS structure */
    578     DWORD	dwCaps;                 /* driver specific capabilities */
    579     DWORD	dwCaps2;                /* more driver specific capabilities */
    580     DWORD	dwCKeyCaps;             /* color key capabilities of the surface */
    581     DWORD	dwFXCaps;               /* driver specific stretching and effects capabilities */
    582     DWORD	dwFXAlphaCaps;          /* alpha driver specific capabilities */
    583     DWORD	dwPalCaps;              /* palette capabilities */
    584     DWORD	dwSVCaps;               /* stereo vision capabilities */
    585     DWORD	dwAlphaBltConstBitDepths;       /* DDBD_2,4,8 */
    586     DWORD	dwAlphaBltPixelBitDepths;       /* DDBD_1,2,4,8 */
    587     DWORD	dwAlphaBltSurfaceBitDepths;     /* DDBD_1,2,4,8 */
    588     DWORD	dwAlphaOverlayConstBitDepths;   /* DDBD_2,4,8 */
    589     DWORD	dwAlphaOverlayPixelBitDepths;   /* DDBD_1,2,4,8 */
    590     DWORD	dwAlphaOverlaySurfaceBitDepths; /* DDBD_1,2,4,8 */
    591     DWORD	dwZBufferBitDepths;             /* DDBD_8,16,24,32 */
    592     DWORD	dwVidMemTotal;          /* total amount of video memory */
    593     DWORD	dwVidMemFree;           /* amount of free video memory */
    594     DWORD	dwMaxVisibleOverlays;   /* maximum number of visible overlays */
    595     DWORD	dwCurrVisibleOverlays;  /* current number of visible overlays */
    596     DWORD	dwNumFourCCCodes;       /* number of four cc codes */
    597     DWORD	dwAlignBoundarySrc;     /* source rectangle alignment */
    598     DWORD	dwAlignSizeSrc;         /* source rectangle byte size */
    599     DWORD	dwAlignBoundaryDest;    /* dest rectangle alignment */
    600     DWORD	dwAlignSizeDest;        /* dest rectangle byte size */
    601     DWORD	dwAlignStrideAlign;     /* stride alignment */
    602     DWORD	dwRops[DD_ROP_SPACE];   /* ROPs supported */
    603     DDSCAPS	ddsCaps;                /* DDSCAPS structure has all the general capabilities */
    604     DWORD	dwMinOverlayStretch;    /* minimum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    605     DWORD	dwMaxOverlayStretch;    /* maximum overlay stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    606     DWORD	dwMinLiveVideoStretch;  /* minimum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    607     DWORD	dwMaxLiveVideoStretch;  /* maximum live video stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    608     DWORD	dwMinHwCodecStretch;    /* minimum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    609     DWORD	dwMaxHwCodecStretch;    /* maximum hardware codec stretch factor multiplied by 1000, eg 1000 == 1.0, 1300 == 1.3 */
    610     DWORD	dwReserved1;
    611     DWORD	dwReserved2;
    612     DWORD	dwReserved3;
    613     DWORD	dwSVBCaps;              /* driver specific capabilities for System->Vmem blts */
    614     DWORD	dwSVBCKeyCaps;          /* driver color key capabilities for System->Vmem blts */
    615     DWORD	dwSVBFXCaps;            /* driver FX capabilities for System->Vmem blts */
    616     DWORD	dwSVBRops[DD_ROP_SPACE];/* ROPs supported for System->Vmem blts */
    617     DWORD	dwVSBCaps;              /* driver specific capabilities for Vmem->System blts */
    618     DWORD	dwVSBCKeyCaps;          /* driver color key capabilities for Vmem->System blts */
    619     DWORD	dwVSBFXCaps;            /* driver FX capabilities for Vmem->System blts */
    620     DWORD	dwVSBRops[DD_ROP_SPACE];/* ROPs supported for Vmem->System blts */
    621     DWORD	dwSSBCaps;              /* driver specific capabilities for System->System blts */
    622     DWORD	dwSSBCKeyCaps;          /* driver color key capabilities for System->System blts */
    623     DWORD	dwSSBFXCaps;            /* driver FX capabilities for System->System blts */
    624     DWORD	dwSSBRops[DD_ROP_SPACE];/* ROPs supported for System->System blts */
    625     DWORD	dwReserved4;
    626     DWORD	dwReserved5;
    627     DWORD	dwReserved6;
    628 } DDCAPS_DX3,*LPDDCAPS_DX3;
    629 
    630 /* set caps struct according to DIRECTDRAW_VERSION */
    631 
    632 #if DIRECTDRAW_VERSION <= 0x300
    633 typedef DDCAPS_DX3 DDCAPS;
    634 #elif DIRECTDRAW_VERSION <= 0x500
    635 typedef DDCAPS_DX5 DDCAPS;
    636 #elif DIRECTDRAW_VERSION <= 0x600
    637 typedef DDCAPS_DX6 DDCAPS;
    638 #else
    639 typedef DDCAPS_DX7 DDCAPS;
    640 #endif
    641 
    642 typedef DDCAPS *LPDDCAPS;
    643 
    644 /* DDCAPS.dwCaps */
    645 #define DDCAPS_3D			0x00000001
    646 #define DDCAPS_ALIGNBOUNDARYDEST	0x00000002
    647 #define DDCAPS_ALIGNSIZEDEST		0x00000004
    648 #define DDCAPS_ALIGNBOUNDARYSRC		0x00000008
    649 #define DDCAPS_ALIGNSIZESRC		0x00000010
    650 #define DDCAPS_ALIGNSTRIDE		0x00000020
    651 #define DDCAPS_BLT			0x00000040
    652 #define DDCAPS_BLTQUEUE			0x00000080
    653 #define DDCAPS_BLTFOURCC		0x00000100
    654 #define DDCAPS_BLTSTRETCH		0x00000200
    655 #define DDCAPS_GDI			0x00000400
    656 #define DDCAPS_OVERLAY			0x00000800
    657 #define DDCAPS_OVERLAYCANTCLIP		0x00001000
    658 #define DDCAPS_OVERLAYFOURCC		0x00002000
    659 #define DDCAPS_OVERLAYSTRETCH		0x00004000
    660 #define DDCAPS_PALETTE			0x00008000
    661 #define DDCAPS_PALETTEVSYNC		0x00010000
    662 #define DDCAPS_READSCANLINE		0x00020000
    663 #define DDCAPS_STEREOVIEW		0x00040000
    664 #define DDCAPS_VBI			0x00080000
    665 #define DDCAPS_ZBLTS			0x00100000
    666 #define DDCAPS_ZOVERLAYS		0x00200000
    667 #define DDCAPS_COLORKEY			0x00400000
    668 #define DDCAPS_ALPHA			0x00800000
    669 #define DDCAPS_COLORKEYHWASSIST		0x01000000
    670 #define DDCAPS_NOHARDWARE		0x02000000
    671 #define DDCAPS_BLTCOLORFILL		0x04000000
    672 #define DDCAPS_BANKSWITCHED		0x08000000
    673 #define DDCAPS_BLTDEPTHFILL		0x10000000
    674 #define DDCAPS_CANCLIP			0x20000000
    675 #define DDCAPS_CANCLIPSTRETCHED		0x40000000
    676 #define DDCAPS_CANBLTSYSMEM		0x80000000
    677 
    678 /* DDCAPS.dwCaps2 */
    679 #define DDCAPS2_CERTIFIED		0x00000001
    680 #define DDCAPS2_NO2DDURING3DSCENE       0x00000002
    681 #define DDCAPS2_VIDEOPORT		0x00000004
    682 #define DDCAPS2_AUTOFLIPOVERLAY		0x00000008
    683 #define DDCAPS2_CANBOBINTERLEAVED	0x00000010
    684 #define DDCAPS2_CANBOBNONINTERLEAVED	0x00000020
    685 #define DDCAPS2_COLORCONTROLOVERLAY	0x00000040
    686 #define DDCAPS2_COLORCONTROLPRIMARY	0x00000080
    687 #define DDCAPS2_CANDROPZ16BIT		0x00000100
    688 #define DDCAPS2_NONLOCALVIDMEM		0x00000200
    689 #define DDCAPS2_NONLOCALVIDMEMCAPS	0x00000400
    690 #define DDCAPS2_NOPAGELOCKREQUIRED	0x00000800
    691 #define DDCAPS2_WIDESURFACES		0x00001000
    692 #define DDCAPS2_CANFLIPODDEVEN		0x00002000
    693 #define DDCAPS2_CANBOBHARDWARE		0x00004000
    694 #define DDCAPS2_COPYFOURCC              0x00008000
    695 #define DDCAPS2_PRIMARYGAMMA            0x00020000
    696 #define DDCAPS2_CANRENDERWINDOWED       0x00080000
    697 #define DDCAPS2_CANCALIBRATEGAMMA       0x00100000
    698 #define DDCAPS2_FLIPINTERVAL            0x00200000
    699 #define DDCAPS2_FLIPNOVSYNC             0x00400000
    700 #define DDCAPS2_CANMANAGETEXTURE        0x00800000
    701 #define DDCAPS2_TEXMANINNONLOCALVIDMEM  0x01000000
    702 #define DDCAPS2_STEREO                  0x02000000
    703 #define DDCAPS2_SYSTONONLOCAL_AS_SYSTOLOCAL   0x04000000
    704 
    705 
    706 /* Set/Get Colour Key Flags */
    707 #define DDCKEY_COLORSPACE  0x00000001  /* Struct is single colour space */
    708 #define DDCKEY_DESTBLT     0x00000002  /* To be used as dest for blt */
    709 #define DDCKEY_DESTOVERLAY 0x00000004  /* To be used as dest for CK overlays */
    710 #define DDCKEY_SRCBLT      0x00000008  /* To be used as src for blt */
    711 #define DDCKEY_SRCOVERLAY  0x00000010  /* To be used as src for CK overlays */
    712 
    713 typedef struct _DDCOLORKEY
    714 {
    715     DWORD	dwColorSpaceLowValue;/* low boundary of color space that is to
    716                                       * be treated as Color Key, inclusive
    717                       */
    718     DWORD	dwColorSpaceHighValue;/* high boundary of color space that is
    719                                        * to be treated as Color Key, inclusive
    720                        */
    721 } DDCOLORKEY,*LPDDCOLORKEY;
    722 
    723 /* ddCKEYCAPS bits */
    724 #define DDCKEYCAPS_DESTBLT			0x00000001
    725 #define DDCKEYCAPS_DESTBLTCLRSPACE		0x00000002
    726 #define DDCKEYCAPS_DESTBLTCLRSPACEYUV		0x00000004
    727 #define DDCKEYCAPS_DESTBLTYUV			0x00000008
    728 #define DDCKEYCAPS_DESTOVERLAY			0x00000010
    729 #define DDCKEYCAPS_DESTOVERLAYCLRSPACE		0x00000020
    730 #define DDCKEYCAPS_DESTOVERLAYCLRSPACEYUV	0x00000040
    731 #define DDCKEYCAPS_DESTOVERLAYONEACTIVE		0x00000080
    732 #define DDCKEYCAPS_DESTOVERLAYYUV		0x00000100
    733 #define DDCKEYCAPS_SRCBLT			0x00000200
    734 #define DDCKEYCAPS_SRCBLTCLRSPACE		0x00000400
    735 #define DDCKEYCAPS_SRCBLTCLRSPACEYUV		0x00000800
    736 #define DDCKEYCAPS_SRCBLTYUV			0x00001000
    737 #define DDCKEYCAPS_SRCOVERLAY			0x00002000
    738 #define DDCKEYCAPS_SRCOVERLAYCLRSPACE		0x00004000
    739 #define DDCKEYCAPS_SRCOVERLAYCLRSPACEYUV	0x00008000
    740 #define DDCKEYCAPS_SRCOVERLAYONEACTIVE		0x00010000
    741 #define DDCKEYCAPS_SRCOVERLAYYUV		0x00020000
    742 #define DDCKEYCAPS_NOCOSTOVERLAY		0x00040000
    743 
    744 typedef struct _DDPIXELFORMAT {
    745     DWORD	dwSize;                 /* 0: size of structure */
    746     DWORD	dwFlags;                /* 4: pixel format flags */
    747     DWORD	dwFourCC;               /* 8: (FOURCC code) */
    748     __extension__ union {
    749     DWORD	dwRGBBitCount;          /* C: how many bits per pixel */
    750     DWORD	dwYUVBitCount;          /* C: how many bits per pixel */
    751     DWORD	dwZBufferBitDepth;      /* C: how many bits for z buffers */
    752     DWORD	dwAlphaBitDepth;        /* C: how many bits for alpha channels*/
    753     DWORD	dwLuminanceBitCount;
    754     DWORD	dwBumpBitCount;
    755     } DUMMYUNIONNAME1;
    756     __extension__ union {
    757     DWORD	dwRBitMask;             /* 10: mask for red bit*/
    758     DWORD	dwYBitMask;             /* 10: mask for Y bits*/
    759     DWORD	dwStencilBitDepth;
    760     DWORD	dwLuminanceBitMask;
    761     DWORD	dwBumpDuBitMask;
    762     } DUMMYUNIONNAME2;
    763     __extension__ union {
    764     DWORD	dwGBitMask;             /* 14: mask for green bits*/
    765     DWORD	dwUBitMask;             /* 14: mask for U bits*/
    766     DWORD	dwZBitMask;
    767     DWORD	dwBumpDvBitMask;
    768     } DUMMYUNIONNAME3;
    769     __extension__ union {
    770     DWORD   dwBBitMask;             /* 18: mask for blue bits*/
    771     DWORD   dwVBitMask;             /* 18: mask for V bits*/
    772     DWORD	dwStencilBitMask;
    773     DWORD	dwBumpLuminanceBitMask;
    774     } DUMMYUNIONNAME4;
    775     __extension__ union {
    776         DWORD	dwRGBAlphaBitMask;	/* 1C: mask for alpha channel */
    777         DWORD	dwYUVAlphaBitMask;	/* 1C: mask for alpha channel */
    778     DWORD	dwLuminanceAlphaBitMask;
    779     DWORD	dwRGBZBitMask;		/* 1C: mask for Z channel */
    780     DWORD	dwYUVZBitMask;		/* 1C: mask for Z channel */
    781     } DUMMYUNIONNAME5;
    782                         /* 20: next structure */
    783 } DDPIXELFORMAT,*LPDDPIXELFORMAT;
    784 
    785 #ifndef MAKEFOURCC
    786 #define MAKEFOURCC(ch0, ch1, ch2, ch3)  \
    787     ((DWORD)(BYTE)(ch0) | ((DWORD)(BYTE)(ch1) << 8) |  \
    788     ((DWORD)(BYTE)(ch2) << 16) | ((DWORD)(BYTE)(ch3) << 24 ))
    789 #endif /* MAKEFOURCC */
    790 
    791 /* DDCAPS.dwFXCaps */
    792 #define DDFXCAPS_BLTALPHA               0x00000001
    793 #define DDFXCAPS_OVERLAYALPHA           0x00000004
    794 #define DDFXCAPS_BLTARITHSTRETCHYN	0x00000010
    795 #define DDFXCAPS_BLTARITHSTRETCHY	0x00000020
    796 #define DDFXCAPS_BLTMIRRORLEFTRIGHT	0x00000040
    797 #define DDFXCAPS_BLTMIRRORUPDOWN	0x00000080
    798 #define DDFXCAPS_BLTROTATION		0x00000100
    799 #define DDFXCAPS_BLTROTATION90		0x00000200
    800 #define DDFXCAPS_BLTSHRINKX		0x00000400
    801 #define DDFXCAPS_BLTSHRINKXN		0x00000800
    802 #define DDFXCAPS_BLTSHRINKY		0x00001000
    803 #define DDFXCAPS_BLTSHRINKYN		0x00002000
    804 #define DDFXCAPS_BLTSTRETCHX		0x00004000
    805 #define DDFXCAPS_BLTSTRETCHXN		0x00008000
    806 #define DDFXCAPS_BLTSTRETCHY		0x00010000
    807 #define DDFXCAPS_BLTSTRETCHYN		0x00020000
    808 #define DDFXCAPS_OVERLAYARITHSTRETCHY	0x00040000
    809 #define DDFXCAPS_OVERLAYARITHSTRETCHYN	0x00000008
    810 #define DDFXCAPS_OVERLAYSHRINKX		0x00080000
    811 #define DDFXCAPS_OVERLAYSHRINKXN	0x00100000
    812 #define DDFXCAPS_OVERLAYSHRINKY		0x00200000
    813 #define DDFXCAPS_OVERLAYSHRINKYN	0x00400000
    814 #define DDFXCAPS_OVERLAYSTRETCHX	0x00800000
    815 #define DDFXCAPS_OVERLAYSTRETCHXN	0x01000000
    816 #define DDFXCAPS_OVERLAYSTRETCHY	0x02000000
    817 #define DDFXCAPS_OVERLAYSTRETCHYN	0x04000000
    818 #define DDFXCAPS_OVERLAYMIRRORLEFTRIGHT	0x08000000
    819 #define DDFXCAPS_OVERLAYMIRRORUPDOWN	0x10000000
    820 
    821 #define DDFXCAPS_OVERLAYFILTER          DDFXCAPS_OVERLAYARITHSTRETCHY
    822 
    823 /* DDCAPS.dwFXAlphaCaps */
    824 #define DDFXALPHACAPS_BLTALPHAEDGEBLEND		0x00000001
    825 #define DDFXALPHACAPS_BLTALPHAPIXELS		0x00000002
    826 #define DDFXALPHACAPS_BLTALPHAPIXELSNEG		0x00000004
    827 #define DDFXALPHACAPS_BLTALPHASURFACES		0x00000008
    828 #define DDFXALPHACAPS_BLTALPHASURFACESNEG	0x00000010
    829 #define DDFXALPHACAPS_OVERLAYALPHAEDGEBLEND	0x00000020
    830 #define DDFXALPHACAPS_OVERLAYALPHAPIXELS	0x00000040
    831 #define DDFXALPHACAPS_OVERLAYALPHAPIXELSNEG	0x00000080
    832 #define DDFXALPHACAPS_OVERLAYALPHASURFACES	0x00000100
    833 #define DDFXALPHACAPS_OVERLAYALPHASURFACESNEG	0x00000200
    834 
    835 /* DDCAPS.dwPalCaps */
    836 #define DDPCAPS_4BIT			0x00000001
    837 #define DDPCAPS_8BITENTRIES		0x00000002
    838 #define DDPCAPS_8BIT			0x00000004
    839 #define DDPCAPS_INITIALIZE		0x00000008
    840 #define DDPCAPS_PRIMARYSURFACE		0x00000010
    841 #define DDPCAPS_PRIMARYSURFACELEFT	0x00000020
    842 #define DDPCAPS_ALLOW256		0x00000040
    843 #define DDPCAPS_VSYNC			0x00000080
    844 #define DDPCAPS_1BIT			0x00000100
    845 #define DDPCAPS_2BIT			0x00000200
    846 #define DDPCAPS_ALPHA                   0x00000400
    847 
    848 /* DDCAPS.dwSVCaps */
    849 /* the first 4 of these are now obsolete */
    850 #if DIRECTDRAW_VERSION >= 0x700	/* FIXME: I'm not sure when this switch occurred */
    851 #define DDSVCAPS_RESERVED1		0x00000001
    852 #define DDSVCAPS_RESERVED2		0x00000002
    853 #define DDSVCAPS_RESERVED3		0x00000004
    854 #define DDSVCAPS_RESERVED4		0x00000008
    855 #else
    856 #define DDSVCAPS_ENIGMA			0x00000001
    857 #define DDSVCAPS_FLICKER		0x00000002
    858 #define DDSVCAPS_REDBLUE		0x00000004
    859 #define DDSVCAPS_SPLIT			0x00000008
    860 #endif
    861 #define DDSVCAPS_STEREOSEQUENTIAL       0x00000010
    862 
    863 /* BitDepths */
    864 #define DDBD_1				0x00004000
    865 #define DDBD_2				0x00002000
    866 #define DDBD_4				0x00001000
    867 #define DDBD_8				0x00000800
    868 #define DDBD_16				0x00000400
    869 #define DDBD_24				0x00000200
    870 #define DDBD_32				0x00000100
    871 
    872 /* DDOVERLAYFX.dwDDFX */
    873 #define DDOVERFX_ARITHSTRETCHY		0x00000001
    874 #define DDOVERFX_MIRRORLEFTRIGHT	0x00000002
    875 #define DDOVERFX_MIRRORUPDOWN		0x00000004
    876 
    877 /* UpdateOverlay flags */
    878 #define DDOVER_ALPHADEST                        0x00000001
    879 #define DDOVER_ALPHADESTCONSTOVERRIDE           0x00000002
    880 #define DDOVER_ALPHADESTNEG                     0x00000004
    881 #define DDOVER_ALPHADESTSURFACEOVERRIDE         0x00000008
    882 #define DDOVER_ALPHAEDGEBLEND                   0x00000010
    883 #define DDOVER_ALPHASRC                         0x00000020
    884 #define DDOVER_ALPHASRCCONSTOVERRIDE            0x00000040
    885 #define DDOVER_ALPHASRCNEG                      0x00000080
    886 #define DDOVER_ALPHASRCSURFACEOVERRIDE          0x00000100
    887 #define DDOVER_HIDE                             0x00000200
    888 #define DDOVER_KEYDEST                          0x00000400
    889 #define DDOVER_KEYDESTOVERRIDE                  0x00000800
    890 #define DDOVER_KEYSRC                           0x00001000
    891 #define DDOVER_KEYSRCOVERRIDE                   0x00002000
    892 #define DDOVER_SHOW                             0x00004000
    893 #define DDOVER_ADDDIRTYRECT                     0x00008000
    894 #define DDOVER_REFRESHDIRTYRECTS                0x00010000
    895 #define DDOVER_REFRESHALL                       0x00020000
    896 #define DDOVER_DDFX                             0x00080000
    897 #define DDOVER_AUTOFLIP                         0x00100000
    898 #define DDOVER_BOB                              0x00200000
    899 #define DDOVER_OVERRIDEBOBWEAVE                 0x00400000
    900 #define DDOVER_INTERLEAVED                      0x00800000
    901 
    902 /* DDCOLORKEY.dwFlags */
    903 #define DDPF_ALPHAPIXELS		0x00000001
    904 #define DDPF_ALPHA			0x00000002
    905 #define DDPF_FOURCC			0x00000004
    906 #define DDPF_PALETTEINDEXED4		0x00000008
    907 #define DDPF_PALETTEINDEXEDTO8		0x00000010
    908 #define DDPF_PALETTEINDEXED8		0x00000020
    909 #define DDPF_RGB			0x00000040
    910 #define DDPF_COMPRESSED			0x00000080
    911 #define DDPF_RGBTOYUV			0x00000100
    912 #define DDPF_YUV			0x00000200
    913 #define DDPF_ZBUFFER			0x00000400
    914 #define DDPF_PALETTEINDEXED1		0x00000800
    915 #define DDPF_PALETTEINDEXED2		0x00001000
    916 #define DDPF_ZPIXELS			0x00002000
    917 #define DDPF_STENCILBUFFER              0x00004000
    918 #define DDPF_ALPHAPREMULT               0x00008000
    919 #define DDPF_LUMINANCE                  0x00020000
    920 #define DDPF_BUMPLUMINANCE              0x00040000
    921 #define DDPF_BUMPDUDV                   0x00080000
    922 
    923 /* SetCooperativeLevel dwFlags */
    924 #define DDSCL_FULLSCREEN		0x00000001
    925 #define DDSCL_ALLOWREBOOT		0x00000002
    926 #define DDSCL_NOWINDOWCHANGES		0x00000004
    927 #define DDSCL_NORMAL			0x00000008
    928 #define DDSCL_EXCLUSIVE			0x00000010
    929 #define DDSCL_ALLOWMODEX		0x00000040
    930 #define DDSCL_SETFOCUSWINDOW		0x00000080
    931 #define DDSCL_SETDEVICEWINDOW		0x00000100
    932 #define DDSCL_CREATEDEVICEWINDOW	0x00000200
    933 #define DDSCL_MULTITHREADED             0x00000400
    934 #define DDSCL_FPUSETUP                  0x00000800
    935 #define DDSCL_FPUPRESERVE               0x00001000
    936 
    937 
    938 /* DDSURFACEDESC.dwFlags */
    939 #define	DDSD_CAPS		0x00000001
    940 #define	DDSD_HEIGHT		0x00000002
    941 #define	DDSD_WIDTH		0x00000004
    942 #define	DDSD_PITCH		0x00000008
    943 #define	DDSD_BACKBUFFERCOUNT	0x00000020
    944 #define	DDSD_ZBUFFERBITDEPTH	0x00000040
    945 #define	DDSD_ALPHABITDEPTH	0x00000080
    946 #define	DDSD_LPSURFACE		0x00000800
    947 #define	DDSD_PIXELFORMAT	0x00001000
    948 #define	DDSD_CKDESTOVERLAY	0x00002000
    949 #define	DDSD_CKDESTBLT		0x00004000
    950 #define	DDSD_CKSRCOVERLAY	0x00008000
    951 #define	DDSD_CKSRCBLT		0x00010000
    952 #define	DDSD_MIPMAPCOUNT	0x00020000
    953 #define	DDSD_REFRESHRATE	0x00040000
    954 #define	DDSD_LINEARSIZE		0x00080000
    955 #define DDSD_TEXTURESTAGE       0x00100000
    956 #define DDSD_FVF                0x00200000
    957 #define DDSD_SRCVBHANDLE        0x00400000
    958 #define DDSD_DEPTH              0x00800000
    959 #define DDSD_ALL                0x00fff9ee
    960 
    961 /* EnumSurfaces flags */
    962 #define DDENUMSURFACES_ALL          0x00000001
    963 #define DDENUMSURFACES_MATCH        0x00000002
    964 #define DDENUMSURFACES_NOMATCH      0x00000004
    965 #define DDENUMSURFACES_CANBECREATED 0x00000008
    966 #define DDENUMSURFACES_DOESEXIST    0x00000010
    967 
    968 /* SetDisplayMode flags */
    969 #define DDSDM_STANDARDVGAMODE	0x00000001
    970 
    971 /* EnumDisplayModes flags */
    972 #define DDEDM_REFRESHRATES	0x00000001
    973 #define DDEDM_STANDARDVGAMODES	0x00000002
    974 
    975 /* WaitForVerticalDisplay flags */
    976 
    977 #define DDWAITVB_BLOCKBEGIN		0x00000001
    978 #define DDWAITVB_BLOCKBEGINEVENT	0x00000002
    979 #define DDWAITVB_BLOCKEND		0x00000004
    980 
    981 typedef struct _DDSURFACEDESC
    982 {
    983     DWORD	dwSize;		/* 0: size of the DDSURFACEDESC structure*/
    984     DWORD	dwFlags;	/* 4: determines what fields are valid*/
    985     DWORD	dwHeight;	/* 8: height of surface to be created*/
    986     DWORD	dwWidth;	/* C: width of input surface*/
    987     __extension__ union {
    988         LONG	lPitch;	/* 10: distance to start of next line (return value only)*/
    989         DWORD	dwLinearSize;
    990     } DUMMYUNIONNAME1;
    991     DWORD	dwBackBufferCount;/* 14: number of back buffers requested*/
    992     __extension__ union {
    993         DWORD	dwMipMapCount;/* 18:number of mip-map levels requested*/
    994         DWORD	dwZBufferBitDepth;/*18: depth of Z buffer requested*/
    995         DWORD	dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
    996     } DUMMYUNIONNAME2;
    997     DWORD	dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
    998     DWORD	dwReserved;	/* 20:reserved*/
    999     LPVOID	lpSurface;	/* 24:pointer to the associated surface memory*/
   1000     DDCOLORKEY	ddckCKDestOverlay;/* 28: CK for dest overlay use*/
   1001     DDCOLORKEY	ddckCKDestBlt;	/* 30: CK for destination blt use*/
   1002     DDCOLORKEY	ddckCKSrcOverlay;/* 38: CK for source overlay use*/
   1003     DDCOLORKEY	ddckCKSrcBlt;	/* 40: CK for source blt use*/
   1004     DDPIXELFORMAT	ddpfPixelFormat;/* 48: pixel format description of the surface*/
   1005     DDSCAPS		ddsCaps;	/* 68: direct draw surface caps */
   1006 } DDSURFACEDESC,*LPDDSURFACEDESC;
   1007 
   1008 typedef struct _DDSURFACEDESC2
   1009 {
   1010     DWORD	dwSize;		/* 0: size of the DDSURFACEDESC2 structure*/
   1011     DWORD	dwFlags;	/* 4: determines what fields are valid*/
   1012     DWORD	dwHeight;	/* 8: height of surface to be created*/
   1013     DWORD	dwWidth;	/* C: width of input surface*/
   1014     __extension__ union {
   1015         LONG	lPitch;	      /*10: distance to start of next line (return value only)*/
   1016         DWORD   dwLinearSize; /*10: formless late-allocated optimized surface size */
   1017     } DUMMYUNIONNAME1;
   1018     DWORD	dwBackBufferCount;/* 14: number of back buffers requested*/
   1019     __extension__ union {
   1020         DWORD	dwMipMapCount;/* 18:number of mip-map levels requested*/
   1021         DWORD	dwRefreshRate;/* 18:refresh rate (used when display mode is described)*/
   1022         DWORD   dwSrcVBHandle;/* 18:source used in VB::Optimize */
   1023     } DUMMYUNIONNAME2;
   1024     DWORD	dwAlphaBitDepth;/* 1C:depth of alpha buffer requested*/
   1025     DWORD	dwReserved;	/* 20:reserved*/
   1026     LPVOID	lpSurface;	/* 24:pointer to the associated surface memory*/
   1027     __extension__ union {
   1028         DDCOLORKEY	ddckCKDestOverlay; /* 28: CK for dest overlay use*/
   1029         DWORD 		dwEmptyFaceColor;  /* 28: color for empty cubemap faces */
   1030     } DUMMYUNIONNAME3;
   1031     DDCOLORKEY	ddckCKDestBlt;	/* 30: CK for destination blt use*/
   1032     DDCOLORKEY	ddckCKSrcOverlay;/* 38: CK for source overlay use*/
   1033     DDCOLORKEY	ddckCKSrcBlt;	/* 40: CK for source blt use*/
   1034 
   1035     __extension__ union {
   1036         DDPIXELFORMAT	ddpfPixelFormat;/* 48: pixel format description of the surface*/
   1037         DWORD 		dwFVF;	/* 48: vertex format description of vertex buffers */
   1038     } DUMMYUNIONNAME4;
   1039     DDSCAPS2	ddsCaps;  /* 68: DDraw surface caps */
   1040     DWORD		dwTextureStage; /* 78: stage in multitexture cascade */
   1041 } DDSURFACEDESC2,*LPDDSURFACEDESC2;
   1042 
   1043 
   1044 typedef struct _DDARGB {
   1045     BYTE	blue;
   1046     BYTE	green;
   1047     BYTE	red;
   1048     BYTE	alpha;
   1049 } DDARGB, *LPDDARGB;
   1050 
   1051 typedef struct _DDRGBA {
   1052     BYTE	red;
   1053     BYTE	green;
   1054     BYTE	blue;
   1055     BYTE	alpha;
   1056 } DDRGBA, *LPDDRGBA;
   1057 
   1058 
   1059 /* DDCOLORCONTROL.dwFlags */
   1060 #define DDCOLOR_BRIGHTNESS	0x00000001
   1061 #define DDCOLOR_CONTRAST	0x00000002
   1062 #define DDCOLOR_HUE		0x00000004
   1063 #define DDCOLOR_SATURATION	0x00000008
   1064 #define DDCOLOR_SHARPNESS	0x00000010
   1065 #define DDCOLOR_GAMMA		0x00000020
   1066 #define DDCOLOR_COLORENABLE	0x00000040
   1067 
   1068 typedef struct {
   1069     DWORD	dwSize;
   1070     DWORD	dwFlags;
   1071     LONG	lBrightness;
   1072     LONG	lContrast;
   1073     LONG	lHue;
   1074     LONG	lSaturation;
   1075     LONG	lSharpness;
   1076     LONG	lGamma;
   1077     LONG	lColorEnable;
   1078     DWORD	dwReserved1;
   1079 } DDCOLORCONTROL,*LPDDCOLORCONTROL;
   1080 
   1081 typedef struct {
   1082     WORD	red[256];
   1083     WORD	green[256];
   1084     WORD	blue[256];
   1085 } DDGAMMARAMP,*LPDDGAMMARAMP;
   1086 
   1087 typedef BOOL (CALLBACK *LPDDENUMCALLBACKA)(GUID *, LPSTR, LPSTR, LPVOID);
   1088 typedef BOOL (CALLBACK *LPDDENUMCALLBACKW)(GUID *, LPWSTR, LPWSTR, LPVOID);
   1089 DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACK)
   1090 
   1091 typedef HRESULT (CALLBACK *LPDDENUMMODESCALLBACK)(LPDDSURFACEDESC, LPVOID);
   1092 typedef HRESULT (CALLBACK *LPDDENUMMODESCALLBACK2)(LPDDSURFACEDESC2, LPVOID);
   1093 typedef HRESULT (CALLBACK *LPDDENUMSURFACESCALLBACK)(LPDIRECTDRAWSURFACE, LPDDSURFACEDESC, LPVOID);
   1094 typedef HRESULT (CALLBACK *LPDDENUMSURFACESCALLBACK2)(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2, LPVOID);
   1095 typedef HRESULT (CALLBACK *LPDDENUMSURFACESCALLBACK7)(LPDIRECTDRAWSURFACE7, LPDDSURFACEDESC2, LPVOID);
   1096 
   1097 typedef BOOL (CALLBACK *LPDDENUMCALLBACKEXA)(GUID *, LPSTR, LPSTR, LPVOID, HMONITOR);
   1098 typedef BOOL (CALLBACK *LPDDENUMCALLBACKEXW)(GUID *, LPWSTR, LPWSTR, LPVOID, HMONITOR);
   1099 DECL_WINELIB_TYPE_AW(LPDDENUMCALLBACKEX)
   1100 
   1101 HRESULT WINAPI DirectDrawEnumerateA(LPDDENUMCALLBACKA,LPVOID);
   1102 HRESULT WINAPI DirectDrawEnumerateW(LPDDENUMCALLBACKW,LPVOID);
   1103 #define DirectDrawEnumerate WINELIB_NAME_AW(DirectDrawEnumerate)
   1104 
   1105 HRESULT WINAPI DirectDrawEnumerateExA( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
   1106 HRESULT WINAPI DirectDrawEnumerateExW( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
   1107 #define DirectDrawEnumerateEx WINELIB_NAME_AW(DirectDrawEnumerateEx)
   1108 
   1109 typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXA)( LPDDENUMCALLBACKEXA lpCallback, LPVOID lpContext, DWORD dwFlags);
   1110 typedef HRESULT (WINAPI * LPDIRECTDRAWENUMERATEEXW)( LPDDENUMCALLBACKEXW lpCallback, LPVOID lpContext, DWORD dwFlags);
   1111 DECL_WINELIB_TYPE_AW(LPDIRECTDRAWENUMERATEEX)
   1112 
   1113 /* flags for DirectDrawEnumerateEx */
   1114 #define DDENUM_ATTACHEDSECONDARYDEVICES	0x00000001
   1115 #define DDENUM_DETACHEDSECONDARYDEVICES	0x00000002
   1116 #define DDENUM_NONDISPLAYDEVICES	0x00000004
   1117 
   1118 /* flags for DirectDrawCreate or IDirectDraw::Initialize */
   1119 #define DDCREATE_HARDWAREONLY	1L
   1120 #define DDCREATE_EMULATIONONLY	2L
   1121 
   1122 typedef struct _DDBLTFX
   1123 {
   1124     DWORD       dwSize;                         /* size of structure */
   1125     DWORD       dwDDFX;                         /* FX operations */
   1126     DWORD       dwROP;                          /* Win32 raster operations */
   1127     DWORD       dwDDROP;                        /* Raster operations new for DirectDraw */
   1128     DWORD       dwRotationAngle;                /* Rotation angle for blt */
   1129     DWORD       dwZBufferOpCode;                /* ZBuffer compares */
   1130     DWORD       dwZBufferLow;                   /* Low limit of Z buffer */
   1131     DWORD       dwZBufferHigh;                  /* High limit of Z buffer */
   1132     DWORD       dwZBufferBaseDest;              /* Destination base value */
   1133     DWORD       dwZDestConstBitDepth;           /* Bit depth used to specify Z constant for destination */
   1134     __extension__ union
   1135     {
   1136         DWORD   dwZDestConst;                   /* Constant to use as Z buffer for dest */
   1137         LPDIRECTDRAWSURFACE lpDDSZBufferDest;   /* Surface to use as Z buffer for dest */
   1138     } DUMMYUNIONNAME1;
   1139     DWORD       dwZSrcConstBitDepth;            /* Bit depth used to specify Z constant for source */
   1140     __extension__ union
   1141     {
   1142         DWORD   dwZSrcConst;                    /* Constant to use as Z buffer for src */
   1143         LPDIRECTDRAWSURFACE lpDDSZBufferSrc;    /* Surface to use as Z buffer for src */
   1144     } DUMMYUNIONNAME2;
   1145     DWORD       dwAlphaEdgeBlendBitDepth;       /* Bit depth used to specify constant for alpha edge blend */
   1146     DWORD       dwAlphaEdgeBlend;               /* Alpha for edge blending */
   1147     DWORD       dwReserved;
   1148     DWORD       dwAlphaDestConstBitDepth;       /* Bit depth used to specify alpha constant for destination */
   1149     __extension__ union
   1150     {
   1151         DWORD   dwAlphaDestConst;               /* Constant to use as Alpha Channel */
   1152         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     /* Surface to use as Alpha Channel */
   1153     } DUMMYUNIONNAME3;
   1154     DWORD       dwAlphaSrcConstBitDepth;        /* Bit depth used to specify alpha constant for source */
   1155     __extension__ union
   1156     {
   1157         DWORD   dwAlphaSrcConst;                /* Constant to use as Alpha Channel */
   1158         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      /* Surface to use as Alpha Channel */
   1159     } DUMMYUNIONNAME4;
   1160     __extension__ union
   1161     {
   1162         DWORD   dwFillColor;                    /* color in RGB or Palettized */
   1163         DWORD   dwFillDepth;                    /* depth value for z-buffer */
   1164     DWORD   dwFillPixel;			/* pixel val for RGBA or RGBZ */
   1165         LPDIRECTDRAWSURFACE lpDDSPattern;       /* Surface to use as pattern */
   1166     } DUMMYUNIONNAME5;
   1167     DDCOLORKEY  ddckDestColorkey;               /* DestColorkey override */
   1168     DDCOLORKEY  ddckSrcColorkey;                /* SrcColorkey override */
   1169 } DDBLTFX,*LPDDBLTFX;
   1170 
   1171 /* dwDDFX */
   1172 /* arithmetic stretching along y axis */
   1173 #define DDBLTFX_ARITHSTRETCHY			0x00000001
   1174 /* mirror on y axis */
   1175 #define DDBLTFX_MIRRORLEFTRIGHT			0x00000002
   1176 /* mirror on x axis */
   1177 #define DDBLTFX_MIRRORUPDOWN			0x00000004
   1178 /* do not tear */
   1179 #define DDBLTFX_NOTEARING			0x00000008
   1180 /* 180 degrees clockwise rotation */
   1181 #define DDBLTFX_ROTATE180			0x00000010
   1182 /* 270 degrees clockwise rotation */
   1183 #define DDBLTFX_ROTATE270			0x00000020
   1184 /* 90 degrees clockwise rotation */
   1185 #define DDBLTFX_ROTATE90			0x00000040
   1186 /* dwZBufferLow and dwZBufferHigh specify limits to the copied Z values */
   1187 #define DDBLTFX_ZBUFFERRANGE			0x00000080
   1188 /* add dwZBufferBaseDest to every source z value before compare */
   1189 #define DDBLTFX_ZBUFFERBASEDEST			0x00000100
   1190 
   1191 typedef struct _DDOVERLAYFX
   1192 {
   1193     DWORD       dwSize;                         /* size of structure */
   1194     DWORD       dwAlphaEdgeBlendBitDepth;       /* Bit depth used to specify constant for alpha edge blend */
   1195     DWORD       dwAlphaEdgeBlend;               /* Constant to use as alpha for edge blend */
   1196     DWORD       dwReserved;
   1197     DWORD       dwAlphaDestConstBitDepth;       /* Bit depth used to specify alpha constant for destination */
   1198     __extension__ union
   1199     {
   1200         DWORD   dwAlphaDestConst;               /* Constant to use as alpha channel for dest */
   1201         LPDIRECTDRAWSURFACE lpDDSAlphaDest;     /* Surface to use as alpha channel for dest */
   1202     } DUMMYUNIONNAME1;
   1203     DWORD       dwAlphaSrcConstBitDepth;        /* Bit depth used to specify alpha constant for source */
   1204     __extension__ union
   1205     {
   1206         DWORD   dwAlphaSrcConst;                /* Constant to use as alpha channel for src */
   1207         LPDIRECTDRAWSURFACE lpDDSAlphaSrc;      /* Surface to use as alpha channel for src */
   1208     } DUMMYUNIONNAME2;
   1209     DDCOLORKEY  dckDestColorkey;                /* DestColorkey override */
   1210     DDCOLORKEY  dckSrcColorkey;                 /* DestColorkey override */
   1211     DWORD       dwDDFX;                         /* Overlay FX */
   1212     DWORD       dwFlags;                        /* flags */
   1213 } DDOVERLAYFX,*LPDDOVERLAYFX;
   1214 
   1215 typedef struct _DDBLTBATCH
   1216 {
   1217     LPRECT		lprDest;
   1218     LPDIRECTDRAWSURFACE	lpDDSSrc;
   1219     LPRECT		lprSrc;
   1220     DWORD		dwFlags;
   1221     LPDDBLTFX		lpDDBltFx;
   1222 } DDBLTBATCH,*LPDDBLTBATCH;
   1223 
   1224 #define MAX_DDDEVICEID_STRING          512
   1225 
   1226 #define DDGDI_GETHOSTIDENTIFIER 1
   1227 
   1228 typedef struct tagDDDEVICEIDENTIFIER {
   1229   char    szDriver[MAX_DDDEVICEID_STRING];
   1230   char    szDescription[MAX_DDDEVICEID_STRING];
   1231   LARGE_INTEGER  liDriverVersion;
   1232   DWORD   dwVendorId;
   1233   DWORD   dwDeviceId;
   1234   DWORD   dwSubSysId;
   1235   DWORD   dwRevision;
   1236   GUID    guidDeviceIdentifier;
   1237 } DDDEVICEIDENTIFIER, * LPDDDEVICEIDENTIFIER;
   1238 
   1239 typedef struct tagDDDEVICEIDENTIFIER2 {
   1240   char    szDriver[MAX_DDDEVICEID_STRING];	/* user readable driver name */
   1241   char    szDescription[MAX_DDDEVICEID_STRING]; /* user readable description */
   1242   LARGE_INTEGER  liDriverVersion;		/* driver version */
   1243   DWORD   dwVendorId;				/* vendor ID, zero if unknown */
   1244   DWORD   dwDeviceId;				/* chipset ID, zero if unknown */
   1245   DWORD   dwSubSysId;				/* board ID, zero if unknown */
   1246   DWORD   dwRevision;				/* chipset version, zero if unknown */
   1247   GUID    guidDeviceIdentifier;			/* unique ID for this driver/chipset combination */
   1248   DWORD   dwWHQLLevel;				/* Windows Hardware Quality Lab certification level */
   1249 } DDDEVICEIDENTIFIER2, * LPDDDEVICEIDENTIFIER2;
   1250 
   1251 /*****************************************************************************
   1252  * IDirectDrawPalette interface
   1253  */
   1254 #undef INTERFACE
   1255 #define INTERFACE IDirectDrawPalette
   1256 DECLARE_INTERFACE_(IDirectDrawPalette,IUnknown)
   1257 {
   1258     /*** IUnknown methods ***/
   1259     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1260     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1261     STDMETHOD_(ULONG,Release)(THIS) PURE;
   1262     /*** IDirectDrawPalette methods ***/
   1263     STDMETHOD(GetCaps)(THIS_ LPDWORD lpdwCaps) PURE;
   1264     STDMETHOD(GetEntries)(THIS_ DWORD dwFlags, DWORD dwBase, DWORD dwNumEntries, LPPALETTEENTRY lpEntries) PURE;
   1265     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags, LPPALETTEENTRY lpDDColorTable) PURE;
   1266     STDMETHOD(SetEntries)(THIS_ DWORD dwFlags, DWORD dwStartingEntry, DWORD dwCount, LPPALETTEENTRY lpEntries) PURE;
   1267 };
   1268 #undef INTERFACE
   1269 
   1270 #if !defined(__cplusplus) || defined(CINTERFACE)
   1271 /*** IUnknown methods ***/
   1272 #define IDirectDrawPalette_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1273 #define IDirectDrawPalette_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1274 #define IDirectDrawPalette_Release(p)            (p)->lpVtbl->Release(p)
   1275 /*** IDirectDrawPalette methods ***/
   1276 #define IDirectDrawPalette_GetCaps(p,a)          (p)->lpVtbl->GetCaps(p,a)
   1277 #define IDirectDrawPalette_GetEntries(p,a,b,c,d) (p)->lpVtbl->GetEntries(p,a,b,c,d)
   1278 #define IDirectDrawPalette_Initialize(p,a,b,c)   (p)->lpVtbl->Initialize(p,a,b,c)
   1279 #define IDirectDrawPalette_SetEntries(p,a,b,c,d) (p)->lpVtbl->SetEntries(p,a,b,c,d)
   1280 #else
   1281 /*** IUnknown methods ***/
   1282 #define IDirectDrawPalette_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1283 #define IDirectDrawPalette_AddRef(p)             (p)->AddRef()
   1284 #define IDirectDrawPalette_Release(p)            (p)->Release()
   1285 /*** IDirectDrawPalette methods ***/
   1286 #define IDirectDrawPalette_GetCaps(p,a)          (p)->GetCaps(a)
   1287 #define IDirectDrawPalette_GetEntries(p,a,b,c,d) (p)->GetEntries(a,b,c,d)
   1288 #define IDirectDrawPalette_Initialize(p,a,b,c)   (p)->Initialize(a,b,c)
   1289 #define IDirectDrawPalette_SetEntries(p,a,b,c,d) (p)->SetEntries(a,b,c,d)
   1290 #endif
   1291 
   1292 
   1293 /*****************************************************************************
   1294  * IDirectDrawClipper interface
   1295  */
   1296 #define INTERFACE IDirectDrawClipper
   1297 DECLARE_INTERFACE_(IDirectDrawClipper,IUnknown)
   1298 {
   1299     /*** IUnknown methods ***/
   1300     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1301     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1302     STDMETHOD_(ULONG,Release)(THIS) PURE;
   1303     /*** IDirectDrawClipper methods ***/
   1304     STDMETHOD(GetClipList)(THIS_ LPRECT lpRect, LPRGNDATA lpClipList, LPDWORD lpdwSize) PURE;
   1305     STDMETHOD(GetHWnd)(THIS_ HWND *lphWnd) PURE;
   1306     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, DWORD dwFlags) PURE;
   1307     STDMETHOD(IsClipListChanged)(THIS_ BOOL *lpbChanged) PURE;
   1308     STDMETHOD(SetClipList)(THIS_ LPRGNDATA lpClipList, DWORD dwFlags) PURE;
   1309     STDMETHOD(SetHWnd)(THIS_ DWORD dwFlags, HWND hWnd) PURE;
   1310 };
   1311 #undef INTERFACE
   1312 
   1313 #if !defined(__cplusplus) || defined(CINTERFACE)
   1314 /*** IUnknown methods ***/
   1315 #define IDirectDrawClipper_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1316 #define IDirectDrawClipper_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1317 #define IDirectDrawClipper_Release(p)            (p)->lpVtbl->Release(p)
   1318 /*** IDirectDrawClipper methods ***/
   1319 #define IDirectDrawClipper_GetClipList(p,a,b,c)   (p)->lpVtbl->GetClipList(p,a,b,c)
   1320 #define IDirectDrawClipper_GetHWnd(p,a)           (p)->lpVtbl->GetHWnd(p,a)
   1321 #define IDirectDrawClipper_Initialize(p,a,b)      (p)->lpVtbl->Initialize(p,a,b)
   1322 #define IDirectDrawClipper_IsClipListChanged(p,a) (p)->lpVtbl->IsClipListChanged(p,a)
   1323 #define IDirectDrawClipper_SetClipList(p,a,b)     (p)->lpVtbl->SetClipList(p,a,b)
   1324 #define IDirectDrawClipper_SetHWnd(p,a,b)         (p)->lpVtbl->SetHWnd(p,a,b)
   1325 #else
   1326 /*** IUnknown methods ***/
   1327 #define IDirectDrawClipper_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1328 #define IDirectDrawClipper_AddRef(p)             (p)->AddRef()
   1329 #define IDirectDrawClipper_Release(p)            (p)->Release()
   1330 /*** IDirectDrawClipper methods ***/
   1331 #define IDirectDrawClipper_GetClipList(p,a,b,c)   (p)->GetClipList(a,b,c)
   1332 #define IDirectDrawClipper_GetHWnd(p,a)           (p)->GetHWnd(a)
   1333 #define IDirectDrawClipper_Initialize(p,a,b)      (p)->Initialize(a,b)
   1334 #define IDirectDrawClipper_IsClipListChanged(p,a) (p)->IsClipListChanged(a)
   1335 #define IDirectDrawClipper_SetClipList(p,a,b)     (p)->SetClipList(a,b)
   1336 #define IDirectDrawClipper_SetHWnd(p,a,b)         (p)->SetHWnd(a,b)
   1337 #endif
   1338 
   1339 
   1340 /*****************************************************************************
   1341  * IDirectDraw interface
   1342  */
   1343 #define INTERFACE IDirectDraw
   1344 DECLARE_INTERFACE_(IDirectDraw,IUnknown)
   1345 {
   1346     /*** IUnknown methods ***/
   1347     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1348     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1349     STDMETHOD_(ULONG,Release)(THIS) PURE;
   1350     /*** IDirectDraw methods ***/
   1351     STDMETHOD(Compact)(THIS) PURE;
   1352     STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, IUnknown *pUnkOuter) PURE;
   1353     STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE *lplpDDPalette, IUnknown *pUnkOuter) PURE;
   1354     STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE *lplpDDSurface, IUnknown *pUnkOuter) PURE;
   1355     STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE *lplpDupDDSurface) PURE;
   1356     STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
   1357     STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
   1358     STDMETHOD(FlipToGDISurface)(THIS) PURE;
   1359     STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
   1360     STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   1361     STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
   1362     STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE *lplpGDIDDSurface) PURE;
   1363     STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
   1364     STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
   1365     STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL *lpbIsInVB) PURE;
   1366     STDMETHOD(Initialize)(THIS_ GUID *lpGUID) PURE;
   1367     STDMETHOD(RestoreDisplayMode)(THIS) PURE;
   1368     STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
   1369     STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP) PURE;
   1370     STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
   1371 };
   1372 #undef INTERFACE
   1373 
   1374 #if !defined(__cplusplus) || defined(CINTERFACE)
   1375 /*** IUnknown methods ***/
   1376 #define IDirectDraw_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1377 #define IDirectDraw_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1378 #define IDirectDraw_Release(p)            (p)->lpVtbl->Release(p)
   1379 /*** IDirectDraw methods ***/
   1380 #define IDirectDraw_Compact(p)                  (p)->lpVtbl->Compact(p)
   1381 #define IDirectDraw_CreateClipper(p,a,b,c)      (p)->lpVtbl->CreateClipper(p,a,b,c)
   1382 #define IDirectDraw_CreatePalette(p,a,b,c,d)    (p)->lpVtbl->CreatePalette(p,a,b,c,d)
   1383 #define IDirectDraw_CreateSurface(p,a,b,c)      (p)->lpVtbl->CreateSurface(p,a,b,c)
   1384 #define IDirectDraw_DuplicateSurface(p,a,b)     (p)->lpVtbl->DuplicateSurface(p,a,b)
   1385 #define IDirectDraw_EnumDisplayModes(p,a,b,c,d) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d)
   1386 #define IDirectDraw_EnumSurfaces(p,a,b,c,d)     (p)->lpVtbl->EnumSurfaces(p,a,b,c,d)
   1387 #define IDirectDraw_FlipToGDISurface(p)         (p)->lpVtbl->FlipToGDISurface(p)
   1388 #define IDirectDraw_GetCaps(p,a,b)              (p)->lpVtbl->GetCaps(p,a,b)
   1389 #define IDirectDraw_GetDisplayMode(p,a)         (p)->lpVtbl->GetDisplayMode(p,a)
   1390 #define IDirectDraw_GetFourCCCodes(p,a,b)       (p)->lpVtbl->GetFourCCCodes(p,a,b)
   1391 #define IDirectDraw_GetGDISurface(p,a)          (p)->lpVtbl->GetGDISurface(p,a)
   1392 #define IDirectDraw_GetMonitorFrequency(p,a)    (p)->lpVtbl->GetMonitorFrequency(p,a)
   1393 #define IDirectDraw_GetScanLine(p,a)            (p)->lpVtbl->GetScanLine(p,a)
   1394 #define IDirectDraw_GetVerticalBlankStatus(p,a) (p)->lpVtbl->GetVerticalBlankStatus(p,a)
   1395 #define IDirectDraw_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
   1396 #define IDirectDraw_RestoreDisplayMode(p)       (p)->lpVtbl->RestoreDisplayMode(p)
   1397 #define IDirectDraw_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
   1398 #define IDirectDraw_SetDisplayMode(p,a,b,c)     (p)->lpVtbl->SetDisplayMode(p,a,b,c)
   1399 #define IDirectDraw_WaitForVerticalBlank(p,a,b) (p)->lpVtbl->WaitForVerticalBlank(p,a,b)
   1400 #else
   1401 /*** IUnknown methods ***/
   1402 #define IDirectDraw_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1403 #define IDirectDraw_AddRef(p)             (p)->AddRef()
   1404 #define IDirectDraw_Release(p)            (p)->Release()
   1405 /*** IDirectDraw methods ***/
   1406 #define IDirectDraw_Compact(p)                  (p)->Compact()
   1407 #define IDirectDraw_CreateClipper(p,a,b,c)      (p)->CreateClipper(a,b,c)
   1408 #define IDirectDraw_CreatePalette(p,a,b,c,d)    (p)->CreatePalette(a,b,c,d)
   1409 #define IDirectDraw_CreateSurface(p,a,b,c)      (p)->CreateSurface(a,b,c)
   1410 #define IDirectDraw_DuplicateSurface(p,a,b)     (p)->DuplicateSurface(a,b)
   1411 #define IDirectDraw_EnumDisplayModes(p,a,b,c,d) (p)->EnumDisplayModes(a,b,c,d)
   1412 #define IDirectDraw_EnumSurfaces(p,a,b,c,d)     (p)->EnumSurfaces(a,b,c,d)
   1413 #define IDirectDraw_FlipToGDISurface(p)         (p)->FlipToGDISurface()
   1414 #define IDirectDraw_GetCaps(p,a,b)              (p)->GetCaps(a,b)
   1415 #define IDirectDraw_GetDisplayMode(p,a)         (p)->GetDisplayMode(a)
   1416 #define IDirectDraw_GetFourCCCodes(p,a,b)       (p)->GetFourCCCodes(a,b)
   1417 #define IDirectDraw_GetGDISurface(p,a)          (p)->GetGDISurface(a)
   1418 #define IDirectDraw_GetMonitorFrequency(p,a)    (p)->GetMonitorFrequency(a)
   1419 #define IDirectDraw_GetScanLine(p,a)            (p)->GetScanLine(a)
   1420 #define IDirectDraw_GetVerticalBlankStatus(p,a) (p)->GetVerticalBlankStatus(a)
   1421 #define IDirectDraw_Initialize(p,a)             (p)->Initialize(a)
   1422 #define IDirectDraw_RestoreDisplayMode(p)       (p)->RestoreDisplayMode()
   1423 #define IDirectDraw_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
   1424 #define IDirectDraw_SetDisplayMode(p,a,b,c)     (p)->SetDisplayMode(a,b,c)
   1425 #define IDirectDraw_WaitForVerticalBlank(p,a,b) (p)->WaitForVerticalBlank(a,b)
   1426 #endif
   1427 
   1428 
   1429 /* flags for Lock() */
   1430 #define DDLOCK_SURFACEMEMORYPTR	0x00000000
   1431 #define DDLOCK_WAIT		0x00000001
   1432 #define DDLOCK_EVENT		0x00000002
   1433 #define DDLOCK_READONLY		0x00000010
   1434 #define DDLOCK_WRITEONLY	0x00000020
   1435 #define DDLOCK_NOSYSLOCK	0x00000800
   1436 #define DDLOCK_NOOVERWRITE      0x00001000
   1437 #define DDLOCK_DISCARDCONTENTS  0x00002000
   1438 
   1439 
   1440 /*****************************************************************************
   1441  * IDirectDraw2 interface
   1442  */
   1443 /* Note: IDirectDraw2 cannot derive from IDirectDraw because the number of
   1444  * arguments of SetDisplayMode has changed !
   1445  */
   1446 #define INTERFACE IDirectDraw2
   1447 DECLARE_INTERFACE_(IDirectDraw2,IUnknown)
   1448 {
   1449           /*** IUnknown methods ***/
   1450 /*00*/    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1451 /*04*/    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1452 /*08*/    STDMETHOD_(ULONG,Release)(THIS) PURE;
   1453           /*** IDirectDraw2 methods ***/
   1454 /*0c*/    STDMETHOD(Compact)(THIS) PURE;
   1455 /*10*/    STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, IUnknown *pUnkOuter) PURE;
   1456 /*14*/    STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE *lplpDDPalette, IUnknown *pUnkOuter) PURE;
   1457 /*18*/    STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE *lplpDDSurface, IUnknown *pUnkOuter) PURE;
   1458 /*1c*/    STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE *lplpDupDDSurface) PURE;
   1459 /*20*/    STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
   1460 /*24*/    STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
   1461 /*28*/    STDMETHOD(FlipToGDISurface)(THIS) PURE;
   1462 /*2c*/    STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
   1463 /*30*/    STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   1464 /*34*/    STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
   1465 /*38*/    STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE *lplpGDIDDSurface) PURE;
   1466 /*3c*/    STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
   1467 /*40*/    STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
   1468 /*44*/    STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL *lpbIsInVB) PURE;
   1469 /*48*/    STDMETHOD(Initialize)(THIS_ GUID *lpGUID) PURE;
   1470 /*4c*/    STDMETHOD(RestoreDisplayMode)(THIS) PURE;
   1471 /*50*/    STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
   1472 /*54*/    STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
   1473 /*58*/    STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
   1474           /* added in v2 */
   1475 /*5c*/    STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE;
   1476 };
   1477 #undef INTERFACE
   1478 
   1479 #if !defined(__cplusplus) || defined(CINTERFACE)
   1480 /*** IUnknown methods ***/
   1481 #define IDirectDraw2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1482 #define IDirectDraw2_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1483 #define IDirectDraw2_Release(p)            (p)->lpVtbl->Release(p)
   1484 /*** IDirectDraw methods ***/
   1485 #define IDirectDraw2_Compact(p)                  (p)->lpVtbl->Compact(p)
   1486 #define IDirectDraw2_CreateClipper(p,a,b,c)      (p)->lpVtbl->CreateClipper(p,a,b,c)
   1487 #define IDirectDraw2_CreatePalette(p,a,b,c,d)    (p)->lpVtbl->CreatePalette(p,a,b,c,d)
   1488 #define IDirectDraw2_CreateSurface(p,a,b,c)      (p)->lpVtbl->CreateSurface(p,a,b,c)
   1489 #define IDirectDraw2_DuplicateSurface(p,a,b)     (p)->lpVtbl->DuplicateSurface(p,a,b)
   1490 #define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d)
   1491 #define IDirectDraw2_EnumSurfaces(p,a,b,c,d)     (p)->lpVtbl->EnumSurfaces(p,a,b,c,d)
   1492 #define IDirectDraw2_FlipToGDISurface(p)         (p)->lpVtbl->FlipToGDISurface(p)
   1493 #define IDirectDraw2_GetCaps(p,a,b)              (p)->lpVtbl->GetCaps(p,a,b)
   1494 #define IDirectDraw2_GetDisplayMode(p,a)         (p)->lpVtbl->GetDisplayMode(p,a)
   1495 #define IDirectDraw2_GetFourCCCodes(p,a,b)       (p)->lpVtbl->GetFourCCCodes(p,a,b)
   1496 #define IDirectDraw2_GetGDISurface(p,a)          (p)->lpVtbl->GetGDISurface(p,a)
   1497 #define IDirectDraw2_GetMonitorFrequency(p,a)    (p)->lpVtbl->GetMonitorFrequency(p,a)
   1498 #define IDirectDraw2_GetScanLine(p,a)            (p)->lpVtbl->GetScanLine(p,a)
   1499 #define IDirectDraw2_GetVerticalBlankStatus(p,a) (p)->lpVtbl->GetVerticalBlankStatus(p,a)
   1500 #define IDirectDraw2_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
   1501 #define IDirectDraw2_RestoreDisplayMode(p)       (p)->lpVtbl->RestoreDisplayMode(p)
   1502 #define IDirectDraw2_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
   1503 #define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) (p)->lpVtbl->SetDisplayMode(p,a,b,c,d,e)
   1504 #define IDirectDraw2_WaitForVerticalBlank(p,a,b) (p)->lpVtbl->WaitForVerticalBlank(p,a,b)
   1505 /*** IDirectDraw2 methods ***/
   1506 #define IDirectDraw2_GetAvailableVidMem(p,a,b,c) (p)->lpVtbl->GetAvailableVidMem(p,a,b,c)
   1507 #else
   1508 /*** IUnknown methods ***/
   1509 #define IDirectDraw2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1510 #define IDirectDraw2_AddRef(p)             (p)->AddRef()
   1511 #define IDirectDraw2_Release(p)            (p)->Release()
   1512 /*** IDirectDraw methods ***/
   1513 #define IDirectDraw2_Compact(p)                  (p)->Compact()
   1514 #define IDirectDraw2_CreateClipper(p,a,b,c)      (p)->CreateClipper(a,b,c)
   1515 #define IDirectDraw2_CreatePalette(p,a,b,c,d)    (p)->CreatePalette(a,b,c,d)
   1516 #define IDirectDraw2_CreateSurface(p,a,b,c)      (p)->CreateSurface(a,b,c)
   1517 #define IDirectDraw2_DuplicateSurface(p,a,b)     (p)->DuplicateSurface(a,b)
   1518 #define IDirectDraw2_EnumDisplayModes(p,a,b,c,d) (p)->EnumDisplayModes(a,b,c,d)
   1519 #define IDirectDraw2_EnumSurfaces(p,a,b,c,d)     (p)->EnumSurfaces(a,b,c,d)
   1520 #define IDirectDraw2_FlipToGDISurface(p)         (p)->FlipToGDISurface()
   1521 #define IDirectDraw2_GetCaps(p,a,b)              (p)->GetCaps(a,b)
   1522 #define IDirectDraw2_GetDisplayMode(p,a)         (p)->GetDisplayMode(a)
   1523 #define IDirectDraw2_GetFourCCCodes(p,a,b)       (p)->GetFourCCCodes(a,b)
   1524 #define IDirectDraw2_GetGDISurface(p,a)          (p)->GetGDISurface(a)
   1525 #define IDirectDraw2_GetMonitorFrequency(p,a)    (p)->GetMonitorFrequency(a)
   1526 #define IDirectDraw2_GetScanLine(p,a)            (p)->GetScanLine(a)
   1527 #define IDirectDraw2_GetVerticalBlankStatus(p,a) (p)->GetVerticalBlankStatus(a)
   1528 #define IDirectDraw2_Initialize(p,a)             (p)->Initialize(a)
   1529 #define IDirectDraw2_RestoreDisplayMode(p)       (p)->RestoreDisplayMode()
   1530 #define IDirectDraw2_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
   1531 #define IDirectDraw2_SetDisplayMode(p,a,b,c,d,e) (p)->SetDisplayMode(a,b,c,d,e)
   1532 #define IDirectDraw2_WaitForVerticalBlank(p,a,b) (p)->WaitForVerticalBlank(a,b)
   1533 /*** IDirectDraw2 methods ***/
   1534 #define IDirectDraw2_GetAvailableVidMem(p,a,b,c) (p)->GetAvailableVidMem(a,b,c)
   1535 #endif
   1536 
   1537 
   1538 /*****************************************************************************
   1539  * IDirectDraw3 interface
   1540  */
   1541 #define INTERFACE IDirectDraw3
   1542 DECLARE_INTERFACE_(IDirectDraw3,IUnknown)
   1543 {
   1544           /*** IUnknown methods ***/
   1545 /*00*/    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1546 /*04*/    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1547 /*08*/    STDMETHOD_(ULONG,Release)(THIS) PURE;
   1548           /*** IDirectDraw2 methods ***/
   1549 /*0c*/    STDMETHOD(Compact)(THIS) PURE;
   1550 /*10*/    STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, IUnknown *pUnkOuter) PURE;
   1551 /*14*/    STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE *lplpDDPalette, IUnknown *pUnkOuter) PURE;
   1552 /*18*/    STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc, LPDIRECTDRAWSURFACE *lplpDDSurface, IUnknown *pUnkOuter) PURE;
   1553 /*1c*/    STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSurface, LPDIRECTDRAWSURFACE *lplpDupDDSurface) PURE;
   1554 /*20*/    STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK lpEnumModesCallback) PURE;
   1555 /*24*/    STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
   1556 /*28*/    STDMETHOD(FlipToGDISurface)(THIS) PURE;
   1557 /*2c*/    STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
   1558 /*30*/    STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   1559 /*34*/    STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
   1560 /*38*/    STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE *lplpGDIDDSurface) PURE;
   1561 /*3c*/    STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
   1562 /*40*/    STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
   1563 /*44*/    STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL *lpbIsInVB) PURE;
   1564 /*48*/    STDMETHOD(Initialize)(THIS_ GUID *lpGUID) PURE;
   1565 /*4c*/    STDMETHOD(RestoreDisplayMode)(THIS) PURE;
   1566 /*50*/    STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
   1567 /*54*/    STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
   1568 /*58*/    STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
   1569           /* added in v2 */
   1570 /*5c*/    STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE;
   1571           /* added in v3 */
   1572 /*60*/    STDMETHOD(GetSurfaceFromDC)(THIS_ HDC hdc, LPDIRECTDRAWSURFACE *pSurf) PURE;
   1573 };
   1574 #undef INTERFACE
   1575 
   1576 #if !defined(__cplusplus) || defined(CINTERFACE)
   1577 /*** IUnknown methods ***/
   1578 #define IDirectDraw3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1579 #define IDirectDraw3_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1580 #define IDirectDraw3_Release(p)            (p)->lpVtbl->Release(p)
   1581 /*** IDirectDraw methods ***/
   1582 #define IDirectDraw3_Compact(p)                  (p)->lpVtbl->Compact(p)
   1583 #define IDirectDraw3_CreateClipper(p,a,b,c)      (p)->lpVtbl->CreateClipper(p,a,b,c)
   1584 #define IDirectDraw3_CreatePalette(p,a,b,c,d)    (p)->lpVtbl->CreatePalette(p,a,b,c,d)
   1585 #define IDirectDraw3_CreateSurface(p,a,b,c)      (p)->lpVtbl->CreateSurface(p,a,b,c)
   1586 #define IDirectDraw3_DuplicateSurface(p,a,b)     (p)->lpVtbl->DuplicateSurface(p,a,b)
   1587 #define IDirectDraw3_EnumDisplayModes(p,a,b,c,d) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d)
   1588 #define IDirectDraw3_EnumSurfaces(p,a,b,c,d)     (p)->lpVtbl->EnumSurfaces(p,a,b,c,d)
   1589 #define IDirectDraw3_FlipToGDISurface(p)         (p)->lpVtbl->FlipToGDISurface(p)
   1590 #define IDirectDraw3_GetCaps(p,a,b)              (p)->lpVtbl->GetCaps(p,a,b)
   1591 #define IDirectDraw3_GetDisplayMode(p,a)         (p)->lpVtbl->GetDisplayMode(p,a)
   1592 #define IDirectDraw3_GetFourCCCodes(p,a,b)       (p)->lpVtbl->GetFourCCCodes(p,a,b)
   1593 #define IDirectDraw3_GetGDISurface(p,a)          (p)->lpVtbl->GetGDISurface(p,a)
   1594 #define IDirectDraw3_GetMonitorFrequency(p,a)    (p)->lpVtbl->GetMonitorFrequency(p,a)
   1595 #define IDirectDraw3_GetScanLine(p,a)            (p)->lpVtbl->GetScanLine(p,a)
   1596 #define IDirectDraw3_GetVerticalBlankStatus(p,a) (p)->lpVtbl->GetVerticalBlankStatus(p,a)
   1597 #define IDirectDraw3_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
   1598 #define IDirectDraw3_RestoreDisplayMode(p)       (p)->lpVtbl->RestoreDisplayMode(p)
   1599 #define IDirectDraw3_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
   1600 #define IDirectDraw3_SetDisplayMode(p,a,b,c,d,e) (p)->lpVtbl->SetDisplayMode(p,a,b,c,d,e)
   1601 #define IDirectDraw3_WaitForVerticalBlank(p,a,b) (p)->lpVtbl->WaitForVerticalBlank(p,a,b)
   1602 /*** IDirectDraw2 methods ***/
   1603 #define IDirectDraw3_GetAvailableVidMem(p,a,b,c) (p)->lpVtbl->GetAvailableVidMem(p,a,b,c)
   1604 /*** IDirectDraw3 methods ***/
   1605 #define IDirectDraw3_GetSurfaceFromDC(p,a,b)    (p)->lpVtbl->GetSurfaceFromDC(p,a,b)
   1606 #else
   1607 /*** IUnknown methods ***/
   1608 #define IDirectDraw3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1609 #define IDirectDraw3_AddRef(p)             (p)->AddRef()
   1610 #define IDirectDraw3_Release(p)            (p)->Release()
   1611 /*** IDirectDraw methods ***/
   1612 #define IDirectDraw3_Compact(p)                  (p)->Compact()
   1613 #define IDirectDraw3_CreateClipper(p,a,b,c)      (p)->CreateClipper(a,b,c)
   1614 #define IDirectDraw3_CreatePalette(p,a,b,c,d)    (p)->CreatePalette(a,b,c,d)
   1615 #define IDirectDraw3_CreateSurface(p,a,b,c)      (p)->CreateSurface(a,b,c)
   1616 #define IDirectDraw3_DuplicateSurface(p,a,b)     (p)->DuplicateSurface(a,b)
   1617 #define IDirectDraw3_EnumDisplayModes(p,a,b,c,d) (p)->EnumDisplayModes(a,b,c,d)
   1618 #define IDirectDraw3_EnumSurfaces(p,a,b,c,d)     (p)->EnumSurfaces(a,b,c,d)
   1619 #define IDirectDraw3_FlipToGDISurface(p)         (p)->FlipToGDISurface()
   1620 #define IDirectDraw3_GetCaps(p,a,b)              (p)->GetCaps(a,b)
   1621 #define IDirectDraw3_GetDisplayMode(p,a)         (p)->GetDisplayMode(a)
   1622 #define IDirectDraw3_GetFourCCCodes(p,a,b)       (p)->GetFourCCCodes(a,b)
   1623 #define IDirectDraw3_GetGDISurface(p,a)          (p)->GetGDISurface(a)
   1624 #define IDirectDraw3_GetMonitorFrequency(p,a)    (p)->GetMonitorFrequency(a)
   1625 #define IDirectDraw3_GetScanLine(p,a)            (p)->GetScanLine(a)
   1626 #define IDirectDraw3_GetVerticalBlankStatus(p,a) (p)->GetVerticalBlankStatus(a)
   1627 #define IDirectDraw3_Initialize(p,a)             (p)->Initialize(a)
   1628 #define IDirectDraw3_RestoreDisplayMode(p)       (p)->RestoreDisplayMode()
   1629 #define IDirectDraw3_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
   1630 #define IDirectDraw3_SetDisplayMode(p,a,b,c,d,e) (p)->SetDisplayMode(a,b,c,d,e)
   1631 #define IDirectDraw3_WaitForVerticalBlank(p,a,b) (p)->WaitForVerticalBlank(a,b)
   1632 /*** IDirectDraw2 methods ***/
   1633 #define IDirectDraw3_GetAvailableVidMem(p,a,b,c) (p)->GetAvailableVidMem(a,b,c)
   1634 /*** IDirectDraw3 methods ***/
   1635 #define IDirectDraw3_GetSurfaceFromDC(p,a,b)    (p)->GetSurfaceFromDC(a,b)
   1636 #endif
   1637 
   1638 
   1639 /*****************************************************************************
   1640  * IDirectDraw4 interface
   1641  */
   1642 #define INTERFACE IDirectDraw4
   1643 DECLARE_INTERFACE_(IDirectDraw4,IUnknown)
   1644 {
   1645           /*** IUnknown methods ***/
   1646 /*00*/    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1647 /*04*/    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1648 /*08*/    STDMETHOD_(ULONG,Release)(THIS) PURE;
   1649           /*** IDirectDraw4 methods ***/
   1650 /*0c*/    STDMETHOD(Compact)(THIS) PURE;
   1651 /*10*/    STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, IUnknown *pUnkOuter) PURE;
   1652 /*14*/    STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE *lplpDDPalette, IUnknown *pUnkOuter) PURE;
   1653 /*18*/    STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE4 *lplpDDSurface, IUnknown *pUnkOuter) PURE;
   1654 /*1c*/    STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurface, LPDIRECTDRAWSURFACE4 *lplpDupDDSurface) PURE;
   1655 /*20*/    STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE;
   1656 /*24*/    STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback) PURE;
   1657 /*28*/    STDMETHOD(FlipToGDISurface)(THIS) PURE;
   1658 /*2c*/    STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
   1659 /*30*/    STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
   1660 /*34*/    STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
   1661 /*38*/    STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE4 *lplpGDIDDSurface) PURE;
   1662 /*3c*/    STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
   1663 /*40*/    STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
   1664 /*44*/    STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL *lpbIsInVB) PURE;
   1665 /*48*/    STDMETHOD(Initialize)(THIS_ GUID *lpGUID) PURE;
   1666 /*4c*/    STDMETHOD(RestoreDisplayMode)(THIS) PURE;
   1667 /*50*/    STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
   1668 /*54*/    STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
   1669 /*58*/    STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
   1670           /* added in v2 */
   1671 /*5c*/    STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE;
   1672           /* added in v4 */
   1673 /*60*/    STDMETHOD(GetSurfaceFromDC)(THIS_ HDC hdc, LPDIRECTDRAWSURFACE4 *pSurf) PURE;
   1674 /*64*/    STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
   1675 /*68*/    STDMETHOD(TestCooperativeLevel)(THIS) PURE;
   1676 /*6c*/    STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags) PURE;
   1677 };
   1678 #undef INTERFACE
   1679 
   1680 #if !defined(__cplusplus) || defined(CINTERFACE)
   1681 /*** IUnknown methods ***/
   1682 #define IDirectDraw4_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1683 #define IDirectDraw4_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1684 #define IDirectDraw4_Release(p)            (p)->lpVtbl->Release(p)
   1685 /*** IDirectDraw methods ***/
   1686 #define IDirectDraw4_Compact(p)                  (p)->lpVtbl->Compact(p)
   1687 #define IDirectDraw4_CreateClipper(p,a,b,c)      (p)->lpVtbl->CreateClipper(p,a,b,c)
   1688 #define IDirectDraw4_CreatePalette(p,a,b,c,d)    (p)->lpVtbl->CreatePalette(p,a,b,c,d)
   1689 #define IDirectDraw4_CreateSurface(p,a,b,c)      (p)->lpVtbl->CreateSurface(p,a,b,c)
   1690 #define IDirectDraw4_DuplicateSurface(p,a,b)     (p)->lpVtbl->DuplicateSurface(p,a,b)
   1691 #define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d)
   1692 #define IDirectDraw4_EnumSurfaces(p,a,b,c,d)     (p)->lpVtbl->EnumSurfaces(p,a,b,c,d)
   1693 #define IDirectDraw4_FlipToGDISurface(p)         (p)->lpVtbl->FlipToGDISurface(p)
   1694 #define IDirectDraw4_GetCaps(p,a,b)              (p)->lpVtbl->GetCaps(p,a,b)
   1695 #define IDirectDraw4_GetDisplayMode(p,a)         (p)->lpVtbl->GetDisplayMode(p,a)
   1696 #define IDirectDraw4_GetFourCCCodes(p,a,b)       (p)->lpVtbl->GetFourCCCodes(p,a,b)
   1697 #define IDirectDraw4_GetGDISurface(p,a)          (p)->lpVtbl->GetGDISurface(p,a)
   1698 #define IDirectDraw4_GetMonitorFrequency(p,a)    (p)->lpVtbl->GetMonitorFrequency(p,a)
   1699 #define IDirectDraw4_GetScanLine(p,a)            (p)->lpVtbl->GetScanLine(p,a)
   1700 #define IDirectDraw4_GetVerticalBlankStatus(p,a) (p)->lpVtbl->GetVerticalBlankStatus(p,a)
   1701 #define IDirectDraw4_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
   1702 #define IDirectDraw4_RestoreDisplayMode(p)       (p)->lpVtbl->RestoreDisplayMode(p)
   1703 #define IDirectDraw4_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
   1704 #define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) (p)->lpVtbl->SetDisplayMode(p,a,b,c,d,e)
   1705 #define IDirectDraw4_WaitForVerticalBlank(p,a,b) (p)->lpVtbl->WaitForVerticalBlank(p,a,b)
   1706 /*** IDirectDraw2 methods ***/
   1707 #define IDirectDraw4_GetAvailableVidMem(p,a,b,c) (p)->lpVtbl->GetAvailableVidMem(p,a,b,c)
   1708 /*** IDirectDraw4 methods ***/
   1709 #define IDirectDraw4_GetSurfaceFromDC(p,a,b)    (p)->lpVtbl->GetSurfaceFromDC(p,a,b)
   1710 #define IDirectDraw4_RestoreAllSurfaces(p)      (p)->lpVtbl->RestoreAllSurfaces(p)
   1711 #define IDirectDraw4_TestCooperativeLevel(p)    (p)->lpVtbl->TestCooperativeLevel(p)
   1712 #define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b)
   1713 #else
   1714 /*** IUnknown methods ***/
   1715 #define IDirectDraw4_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1716 #define IDirectDraw4_AddRef(p)             (p)->AddRef()
   1717 #define IDirectDraw4_Release(p)            (p)->Release()
   1718 /*** IDirectDraw methods ***/
   1719 #define IDirectDraw4_Compact(p)                  (p)->Compact()
   1720 #define IDirectDraw4_CreateClipper(p,a,b,c)      (p)->CreateClipper(a,b,c)
   1721 #define IDirectDraw4_CreatePalette(p,a,b,c,d)    (p)->CreatePalette(a,b,c,d)
   1722 #define IDirectDraw4_CreateSurface(p,a,b,c)      (p)->CreateSurface(a,b,c)
   1723 #define IDirectDraw4_DuplicateSurface(p,a,b)     (p)->DuplicateSurface(a,b)
   1724 #define IDirectDraw4_EnumDisplayModes(p,a,b,c,d) (p)->EnumDisplayModes(a,b,c,d)
   1725 #define IDirectDraw4_EnumSurfaces(p,a,b,c,d)     (p)->EnumSurfaces(a,b,c,d)
   1726 #define IDirectDraw4_FlipToGDISurface(p)         (p)->FlipToGDISurface()
   1727 #define IDirectDraw4_GetCaps(p,a,b)              (p)->GetCaps(a,b)
   1728 #define IDirectDraw4_GetDisplayMode(p,a)         (p)->GetDisplayMode(a)
   1729 #define IDirectDraw4_GetFourCCCodes(p,a,b)       (p)->GetFourCCCodes(a,b)
   1730 #define IDirectDraw4_GetGDISurface(p,a)          (p)->GetGDISurface(a)
   1731 #define IDirectDraw4_GetMonitorFrequency(p,a)    (p)->GetMonitorFrequency(a)
   1732 #define IDirectDraw4_GetScanLine(p,a)            (p)->GetScanLine(a)
   1733 #define IDirectDraw4_GetVerticalBlankStatus(p,a) (p)->GetVerticalBlankStatus(a)
   1734 #define IDirectDraw4_Initialize(p,a)             (p)->Initialize(a)
   1735 #define IDirectDraw4_RestoreDisplayMode(p)       (p)->RestoreDisplayMode()
   1736 #define IDirectDraw4_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
   1737 #define IDirectDraw4_SetDisplayMode(p,a,b,c,d,e) (p)->SetDisplayMode(a,b,c,d,e)
   1738 #define IDirectDraw4_WaitForVerticalBlank(p,a,b) (p)->WaitForVerticalBlank(a,b)
   1739 /*** IDirectDraw2 methods ***/
   1740 #define IDirectDraw4_GetAvailableVidMem(p,a,b,c) (p)->GetAvailableVidMem(a,b,c)
   1741 /*** IDirectDraw4 methods ***/
   1742 #define IDirectDraw4_GetSurfaceFromDC(p,a,b)    (p)->GetSurfaceFromDC(a,b)
   1743 #define IDirectDraw4_RestoreAllSurfaces(pc)     (p)->RestoreAllSurfaces()
   1744 #define IDirectDraw4_TestCooperativeLevel(p)    (p)->TestCooperativeLevel()
   1745 #define IDirectDraw4_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b)
   1746 #endif
   1747 
   1748 
   1749 /*****************************************************************************
   1750  * IDirectDraw7 interface
   1751  */
   1752 /* Note: IDirectDraw7 cannot derive from IDirectDraw4; it is even documented
   1753  * as not interchangeable with earlier DirectDraw interfaces.
   1754  */
   1755 #define INTERFACE IDirectDraw7
   1756 DECLARE_INTERFACE_(IDirectDraw7,IUnknown)
   1757 {
   1758           /*** IUnknown methods ***/
   1759 /*00*/    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1760 /*04*/    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1761 /*08*/    STDMETHOD_(ULONG,Release)(THIS) PURE;
   1762           /*** IDirectDraw7 methods ***/
   1763 /*0c*/    STDMETHOD(Compact)(THIS) PURE;
   1764 /*10*/    STDMETHOD(CreateClipper)(THIS_ DWORD dwFlags, LPDIRECTDRAWCLIPPER *lplpDDClipper, IUnknown *pUnkOuter) PURE;
   1765 /*14*/    STDMETHOD(CreatePalette)(THIS_ DWORD dwFlags, LPPALETTEENTRY lpColorTable, LPDIRECTDRAWPALETTE *lplpDDPalette, IUnknown *pUnkOuter) PURE;
   1766 /*18*/    STDMETHOD(CreateSurface)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc, LPDIRECTDRAWSURFACE7 *lplpDDSurface, IUnknown *pUnkOuter) PURE;
   1767 /*1c*/    STDMETHOD(DuplicateSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurface, LPDIRECTDRAWSURFACE7 *lplpDupDDSurface) PURE;
   1768 /*20*/    STDMETHOD(EnumDisplayModes)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSurfaceDesc, LPVOID lpContext, LPDDENUMMODESCALLBACK2 lpEnumModesCallback) PURE;
   1769 /*24*/    STDMETHOD(EnumSurfaces)(THIS_ DWORD dwFlags, LPDDSURFACEDESC2 lpDDSD, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE;
   1770 /*28*/    STDMETHOD(FlipToGDISurface)(THIS) PURE;
   1771 /*2c*/    STDMETHOD(GetCaps)(THIS_ LPDDCAPS lpDDDriverCaps, LPDDCAPS lpDDHELCaps) PURE;
   1772 /*30*/    STDMETHOD(GetDisplayMode)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
   1773 /*34*/    STDMETHOD(GetFourCCCodes)(THIS_ LPDWORD lpNumCodes, LPDWORD lpCodes) PURE;
   1774 /*38*/    STDMETHOD(GetGDISurface)(THIS_ LPDIRECTDRAWSURFACE7 *lplpGDIDDSurface) PURE;
   1775 /*3c*/    STDMETHOD(GetMonitorFrequency)(THIS_ LPDWORD lpdwFrequency) PURE;
   1776 /*40*/    STDMETHOD(GetScanLine)(THIS_ LPDWORD lpdwScanLine) PURE;
   1777 /*44*/    STDMETHOD(GetVerticalBlankStatus)(THIS_ BOOL *lpbIsInVB) PURE;
   1778 /*48*/    STDMETHOD(Initialize)(THIS_ GUID *lpGUID) PURE;
   1779 /*4c*/    STDMETHOD(RestoreDisplayMode)(THIS) PURE;
   1780 /*50*/    STDMETHOD(SetCooperativeLevel)(THIS_ HWND hWnd, DWORD dwFlags) PURE;
   1781 /*54*/    STDMETHOD(SetDisplayMode)(THIS_ DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD dwRefreshRate, DWORD dwFlags) PURE;
   1782 /*58*/    STDMETHOD(WaitForVerticalBlank)(THIS_ DWORD dwFlags, HANDLE hEvent) PURE;
   1783           /* added in v2 */
   1784 /*5c*/    STDMETHOD(GetAvailableVidMem)(THIS_ LPDDSCAPS2 lpDDCaps, LPDWORD lpdwTotal, LPDWORD lpdwFree) PURE;
   1785           /* added in v4 */
   1786 /*60*/    STDMETHOD(GetSurfaceFromDC)(THIS_ HDC hdc, LPDIRECTDRAWSURFACE7 *pSurf) PURE;
   1787 /*64*/    STDMETHOD(RestoreAllSurfaces)(THIS) PURE;
   1788 /*68*/    STDMETHOD(TestCooperativeLevel)(THIS) PURE;
   1789 /*6c*/    STDMETHOD(GetDeviceIdentifier)(THIS_ LPDDDEVICEIDENTIFIER2 pDDDI, DWORD dwFlags) PURE;
   1790           /* added in v7 */
   1791 /*70*/    STDMETHOD(StartModeTest)(THIS_ LPSIZE pModes, DWORD dwNumModes, DWORD dwFlags) PURE;
   1792 /*74*/    STDMETHOD(EvaluateMode)(THIS_ DWORD dwFlags, DWORD  *pTimeout) PURE;
   1793 };
   1794 #undef INTERFACE
   1795 
   1796 #if !defined(__cplusplus) || defined(CINTERFACE)
   1797 /*** IUnknown methods ***/
   1798 #define IDirectDraw7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1799 #define IDirectDraw7_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1800 #define IDirectDraw7_Release(p)            (p)->lpVtbl->Release(p)
   1801 /*** IDirectDraw methods ***/
   1802 #define IDirectDraw7_Compact(p)                  (p)->lpVtbl->Compact(p)
   1803 #define IDirectDraw7_CreateClipper(p,a,b,c)      (p)->lpVtbl->CreateClipper(p,a,b,c)
   1804 #define IDirectDraw7_CreatePalette(p,a,b,c,d)    (p)->lpVtbl->CreatePalette(p,a,b,c,d)
   1805 #define IDirectDraw7_CreateSurface(p,a,b,c)      (p)->lpVtbl->CreateSurface(p,a,b,c)
   1806 #define IDirectDraw7_DuplicateSurface(p,a,b)     (p)->lpVtbl->DuplicateSurface(p,a,b)
   1807 #define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) (p)->lpVtbl->EnumDisplayModes(p,a,b,c,d)
   1808 #define IDirectDraw7_EnumSurfaces(p,a,b,c,d)     (p)->lpVtbl->EnumSurfaces(p,a,b,c,d)
   1809 #define IDirectDraw7_FlipToGDISurface(p)         (p)->lpVtbl->FlipToGDISurface(p)
   1810 #define IDirectDraw7_GetCaps(p,a,b)              (p)->lpVtbl->GetCaps(p,a,b)
   1811 #define IDirectDraw7_GetDisplayMode(p,a)         (p)->lpVtbl->GetDisplayMode(p,a)
   1812 #define IDirectDraw7_GetFourCCCodes(p,a,b)       (p)->lpVtbl->GetFourCCCodes(p,a,b)
   1813 #define IDirectDraw7_GetGDISurface(p,a)          (p)->lpVtbl->GetGDISurface(p,a)
   1814 #define IDirectDraw7_GetMonitorFrequency(p,a)    (p)->lpVtbl->GetMonitorFrequency(p,a)
   1815 #define IDirectDraw7_GetScanLine(p,a)            (p)->lpVtbl->GetScanLine(p,a)
   1816 #define IDirectDraw7_GetVerticalBlankStatus(p,a) (p)->lpVtbl->GetVerticalBlankStatus(p,a)
   1817 #define IDirectDraw7_Initialize(p,a)             (p)->lpVtbl->Initialize(p,a)
   1818 #define IDirectDraw7_RestoreDisplayMode(p)       (p)->lpVtbl->RestoreDisplayMode(p)
   1819 #define IDirectDraw7_SetCooperativeLevel(p,a,b)  (p)->lpVtbl->SetCooperativeLevel(p,a,b)
   1820 #define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) (p)->lpVtbl->SetDisplayMode(p,a,b,c,d,e)
   1821 #define IDirectDraw7_WaitForVerticalBlank(p,a,b) (p)->lpVtbl->WaitForVerticalBlank(p,a,b)
   1822 /*** added in IDirectDraw2 ***/
   1823 #define IDirectDraw7_GetAvailableVidMem(p,a,b,c) (p)->lpVtbl->GetAvailableVidMem(p,a,b,c)
   1824 /*** added in IDirectDraw4 ***/
   1825 #define IDirectDraw7_GetSurfaceFromDC(p,a,b)    (p)->lpVtbl->GetSurfaceFromDC(p,a,b)
   1826 #define IDirectDraw7_RestoreAllSurfaces(p)     (p)->lpVtbl->RestoreAllSurfaces(p)
   1827 #define IDirectDraw7_TestCooperativeLevel(p)    (p)->lpVtbl->TestCooperativeLevel(p)
   1828 #define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->lpVtbl->GetDeviceIdentifier(p,a,b)
   1829 /*** added in IDirectDraw 7 ***/
   1830 #define IDirectDraw7_StartModeTest(p,a,b,c)     (p)->lpVtbl->StartModeTest(p,a,b,c)
   1831 #define IDirectDraw7_EvaluateMode(p,a,b)        (p)->lpVtbl->EvaluateMode(p,a,b)
   1832 #else
   1833 /*** IUnknown methods ***/
   1834 #define IDirectDraw7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1835 #define IDirectDraw7_AddRef(p)             (p)->AddRef()
   1836 #define IDirectDraw7_Release(p)            (p)->Release()
   1837 /*** IDirectDraw methods ***/
   1838 #define IDirectDraw7_Compact(p)                  (p)->Compact()
   1839 #define IDirectDraw7_CreateClipper(p,a,b,c)      (p)->CreateClipper(a,b,c)
   1840 #define IDirectDraw7_CreatePalette(p,a,b,c,d)    (p)->CreatePalette(a,b,c,d)
   1841 #define IDirectDraw7_CreateSurface(p,a,b,c)      (p)->CreateSurface(a,b,c)
   1842 #define IDirectDraw7_DuplicateSurface(p,a,b)     (p)->DuplicateSurface(a,b)
   1843 #define IDirectDraw7_EnumDisplayModes(p,a,b,c,d) (p)->EnumDisplayModes(a,b,c,d)
   1844 #define IDirectDraw7_EnumSurfaces(p,a,b,c,d)     (p)->EnumSurfaces(a,b,c,d)
   1845 #define IDirectDraw7_FlipToGDISurface(p)         (p)->FlipToGDISurface()
   1846 #define IDirectDraw7_GetCaps(p,a,b)              (p)->GetCaps(a,b)
   1847 #define IDirectDraw7_GetDisplayMode(p,a)         (p)->GetDisplayMode(a)
   1848 #define IDirectDraw7_GetFourCCCodes(p,a,b)       (p)->GetFourCCCodes(a,b)
   1849 #define IDirectDraw7_GetGDISurface(p,a)          (p)->GetGDISurface(a)
   1850 #define IDirectDraw7_GetMonitorFrequency(p,a)    (p)->GetMonitorFrequency(a)
   1851 #define IDirectDraw7_GetScanLine(p,a)            (p)->GetScanLine(a)
   1852 #define IDirectDraw7_GetVerticalBlankStatus(p,a) (p)->GetVerticalBlankStatus(a)
   1853 #define IDirectDraw7_Initialize(p,a)             (p)->Initialize(a)
   1854 #define IDirectDraw7_RestoreDisplayMode(p)       (p)->RestoreDisplayMode()
   1855 #define IDirectDraw7_SetCooperativeLevel(p,a,b)  (p)->SetCooperativeLevel(a,b)
   1856 #define IDirectDraw7_SetDisplayMode(p,a,b,c,d,e) (p)->SetDisplayMode(a,b,c,d,e)
   1857 #define IDirectDraw7_WaitForVerticalBlank(p,a,b) (p)->WaitForVerticalBlank(a,b)
   1858 /*** added in IDirectDraw2 ***/
   1859 #define IDirectDraw7_GetAvailableVidMem(p,a,b,c) (p)->GetAvailableVidMem(a,b,c)
   1860 /*** added in IDirectDraw4 ***/
   1861 #define IDirectDraw7_GetSurfaceFromDC(p,a,b)    (p)->GetSurfaceFromDC(a,b)
   1862 #define IDirectDraw7_RestoreAllSurfaces(p)     (p)->RestoreAllSurfaces()
   1863 #define IDirectDraw7_TestCooperativeLevel(p)    (p)->TestCooperativeLevel()
   1864 #define IDirectDraw7_GetDeviceIdentifier(p,a,b) (p)->GetDeviceIdentifier(a,b)
   1865 /*** added in IDirectDraw 7 ***/
   1866 #define IDirectDraw7_StartModeTest(p,a,b,c)     (p)->StartModeTest(a,b,c)
   1867 #define IDirectDraw7_EvaluateMode(p,a,b)        (p)->EvaluateMode(a,b)
   1868 #endif
   1869 
   1870 
   1871 /*****************************************************************************
   1872  * IDirectDrawSurface interface
   1873  */
   1874 #define INTERFACE IDirectDrawSurface
   1875 DECLARE_INTERFACE_(IDirectDrawSurface,IUnknown)
   1876 {
   1877           /*** IUnknown methods ***/
   1878 /*00*/    STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   1879 /*04*/    STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   1880 /*08*/    STDMETHOD_(ULONG,Release)(THIS) PURE;
   1881           /*** IDirectDrawSurface methods ***/
   1882 /*0c*/    STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE;
   1883 /*10*/    STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
   1884 /*14*/    STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
   1885 /*18*/    STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
   1886 /*1c*/    STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
   1887 /*20*/    STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSAttachedSurface) PURE;
   1888 /*24*/    STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
   1889 /*28*/    STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE;
   1890 /*2c*/    STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
   1891 /*30*/    STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE *lplpDDAttachedSurface) PURE;
   1892 /*34*/    STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
   1893 /*38*/    STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE;
   1894 /*3c*/    STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER *lplpDDClipper) PURE;
   1895 /*40*/    STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   1896 /*44*/    STDMETHOD(GetDC)(THIS_ HDC *lphDC) PURE;
   1897 /*48*/    STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
   1898 /*4c*/    STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
   1899 /*50*/    STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE *lplpDDPalette) PURE;
   1900 /*54*/    STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
   1901 /*58*/    STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   1902 /*5c*/    STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   1903 /*60*/    STDMETHOD(IsLost)(THIS) PURE;
   1904 /*64*/    STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
   1905 /*68*/    STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
   1906 /*6c*/    STDMETHOD(Restore)(THIS) PURE;
   1907 /*70*/    STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
   1908 /*74*/    STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   1909 /*78*/    STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
   1910 /*7c*/    STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
   1911 /*80*/    STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE;
   1912 /*84*/    STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
   1913 /*88*/    STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
   1914 /*8c*/    STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE lpDDSReference) PURE;
   1915 };
   1916 #undef INTERFACE
   1917 
   1918 #if !defined(__cplusplus) || defined(CINTERFACE)
   1919 /*** IUnknown methods ***/
   1920 #define IDirectDrawSurface_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   1921 #define IDirectDrawSurface_AddRef(p)             (p)->lpVtbl->AddRef(p)
   1922 #define IDirectDrawSurface_Release(p)            (p)->lpVtbl->Release(p)
   1923 /*** IDirectDrawSurface methods ***/
   1924 #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
   1925 #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
   1926 #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
   1927 #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
   1928 #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
   1929 #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
   1930 #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
   1931 #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
   1932 #define IDirectDrawSurface_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
   1933 #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
   1934 #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
   1935 #define IDirectDrawSurface_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
   1936 #define IDirectDrawSurface_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
   1937 #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
   1938 #define IDirectDrawSurface_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
   1939 #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
   1940 #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
   1941 #define IDirectDrawSurface_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
   1942 #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
   1943 #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
   1944 #define IDirectDrawSurface_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
   1945 #define IDirectDrawSurface_IsLost(p)                    (p)->lpVtbl->IsLost(p)
   1946 #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
   1947 #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
   1948 #define IDirectDrawSurface_Restore(p)                   (p)->lpVtbl->Restore(p)
   1949 #define IDirectDrawSurface_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
   1950 #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
   1951 #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
   1952 #define IDirectDrawSurface_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
   1953 #define IDirectDrawSurface_Unlock(p,a)                  (p)->lpVtbl->Unlock(p,a)
   1954 #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
   1955 #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
   1956 #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
   1957 #else
   1958 /*** IUnknown methods ***/
   1959 #define IDirectDrawSurface_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   1960 #define IDirectDrawSurface_AddRef(p)             (p)->AddRef()
   1961 #define IDirectDrawSurface_Release(p)            (p)->Release()
   1962 /*** IDirectDrawSurface methods ***/
   1963 #define IDirectDrawSurface_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
   1964 #define IDirectDrawSurface_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
   1965 #define IDirectDrawSurface_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
   1966 #define IDirectDrawSurface_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
   1967 #define IDirectDrawSurface_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
   1968 #define IDirectDrawSurface_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
   1969 #define IDirectDrawSurface_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
   1970 #define IDirectDrawSurface_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
   1971 #define IDirectDrawSurface_Flip(p,a,b)                  (p)->Flip(a,b)
   1972 #define IDirectDrawSurface_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
   1973 #define IDirectDrawSurface_GetBltStatus(p,a)            (p)->GetBltStatus(a)
   1974 #define IDirectDrawSurface_GetCaps(p,a)                 (p)->GetCaps(a)
   1975 #define IDirectDrawSurface_GetClipper(p,a)              (p)->GetClipper(a)
   1976 #define IDirectDrawSurface_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
   1977 #define IDirectDrawSurface_GetDC(p,a)                   (p)->GetDC(a)
   1978 #define IDirectDrawSurface_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
   1979 #define IDirectDrawSurface_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
   1980 #define IDirectDrawSurface_GetPalette(p,a)              (p)->GetPalette(a)
   1981 #define IDirectDrawSurface_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
   1982 #define IDirectDrawSurface_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
   1983 #define IDirectDrawSurface_Initialize(p,a,b)            (p)->Initialize(a,b)
   1984 #define IDirectDrawSurface_IsLost(p)                    (p)->IsLost()
   1985 #define IDirectDrawSurface_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
   1986 #define IDirectDrawSurface_ReleaseDC(p,a)               (p)->ReleaseDC(a)
   1987 #define IDirectDrawSurface_Restore(p)                   (p)->Restore()
   1988 #define IDirectDrawSurface_SetClipper(p,a)              (p)->SetClipper(a)
   1989 #define IDirectDrawSurface_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
   1990 #define IDirectDrawSurface_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
   1991 #define IDirectDrawSurface_SetPalette(p,a)              (p)->SetPalette(a)
   1992 #define IDirectDrawSurface_Unlock(p,a)                  (p)->Unlock(a)
   1993 #define IDirectDrawSurface_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
   1994 #define IDirectDrawSurface_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
   1995 #define IDirectDrawSurface_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
   1996 #endif
   1997 
   1998 
   1999 /*****************************************************************************
   2000  * IDirectDrawSurface2 interface
   2001  */
   2002 /* Cannot inherit from IDirectDrawSurface because the LPDIRECTDRAWSURFACE parameters
   2003  * have been converted to LPDIRECTDRAWSURFACE2.
   2004  */
   2005 #define INTERFACE IDirectDrawSurface2
   2006 DECLARE_INTERFACE_(IDirectDrawSurface2,IUnknown)
   2007 {
   2008     /*** IUnknown methods ***/
   2009     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   2010     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   2011     STDMETHOD_(ULONG,Release)(THIS) PURE;
   2012     /*** IDirectDrawSurface2 methods ***/
   2013     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE;
   2014     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
   2015     STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
   2016     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
   2017     STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE2 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
   2018     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSAttachedSurface) PURE;
   2019     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
   2020     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE;
   2021     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE2 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
   2022     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE2 *lplpDDAttachedSurface) PURE;
   2023     STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
   2024     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE;
   2025     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER *lplpDDClipper) PURE;
   2026     STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2027     STDMETHOD(GetDC)(THIS_ HDC *lphDC) PURE;
   2028     STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
   2029     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
   2030     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE *lplpDDPalette) PURE;
   2031     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
   2032     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   2033     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   2034     STDMETHOD(IsLost)(THIS) PURE;
   2035     STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
   2036     STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
   2037     STDMETHOD(Restore)(THIS) PURE;
   2038     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
   2039     STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2040     STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
   2041     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
   2042     STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE;
   2043     STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE2 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
   2044     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
   2045     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE2 lpDDSReference) PURE;
   2046     /* added in v2 */
   2047     STDMETHOD(GetDDInterface)(THIS_ LPVOID *lplpDD) PURE;
   2048     STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
   2049     STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
   2050 };
   2051 #undef INTERFACE
   2052 
   2053 #if !defined(__cplusplus) || defined(CINTERFACE)
   2054 /*** IUnknown methods ***/
   2055 #define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   2056 #define IDirectDrawSurface2_AddRef(p)             (p)->lpVtbl->AddRef(p)
   2057 #define IDirectDrawSurface2_Release(p)            (p)->lpVtbl->Release(p)
   2058 /*** IDirectDrawSurface methods (almost) ***/
   2059 #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
   2060 #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
   2061 #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
   2062 #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
   2063 #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
   2064 #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
   2065 #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
   2066 #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
   2067 #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
   2068 #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
   2069 #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
   2070 #define IDirectDrawSurface2_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
   2071 #define IDirectDrawSurface2_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
   2072 #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
   2073 #define IDirectDrawSurface2_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
   2074 #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
   2075 #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
   2076 #define IDirectDrawSurface2_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
   2077 #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
   2078 #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
   2079 #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
   2080 #define IDirectDrawSurface2_IsLost(p)                    (p)->lpVtbl->IsLost(p)
   2081 #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
   2082 #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
   2083 #define IDirectDrawSurface2_Restore(p)                   (p)->lpVtbl->Restore(p)
   2084 #define IDirectDrawSurface2_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
   2085 #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
   2086 #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
   2087 #define IDirectDrawSurface2_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
   2088 #define IDirectDrawSurface2_Unlock(p,a)                  (p)->lpVtbl->Unlock(p,a)
   2089 #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
   2090 #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
   2091 #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
   2092 /*** IDirectDrawSurface2 methods ***/
   2093 #define IDirectDrawSurface2_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a)
   2094 #define IDirectDrawSurface2_PageLock(p,a)       (p)->lpVtbl->PageLock(p,a)
   2095 #define IDirectDrawSurface2_PageUnlock(p,a)     (p)->lpVtbl->PageUnlock(p,a)
   2096 #else
   2097 /*** IUnknown methods ***/
   2098 #define IDirectDrawSurface2_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   2099 #define IDirectDrawSurface2_AddRef(p)             (p)->AddRef()
   2100 #define IDirectDrawSurface2_Release(p)            (p)->Release()
   2101 /*** IDirectDrawSurface methods (almost) ***/
   2102 #define IDirectDrawSurface2_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
   2103 #define IDirectDrawSurface2_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
   2104 #define IDirectDrawSurface2_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
   2105 #define IDirectDrawSurface2_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
   2106 #define IDirectDrawSurface2_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
   2107 #define IDirectDrawSurface2_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
   2108 #define IDirectDrawSurface2_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
   2109 #define IDirectDrawSurface2_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
   2110 #define IDirectDrawSurface2_Flip(p,a,b)                  (p)->Flip(a,b)
   2111 #define IDirectDrawSurface2_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
   2112 #define IDirectDrawSurface2_GetBltStatus(p,a)            (p)->GetBltStatus(a)
   2113 #define IDirectDrawSurface2_GetCaps(p,a)                 (p)->GetCaps(a)
   2114 #define IDirectDrawSurface2_GetClipper(p,a)              (p)->GetClipper(a)
   2115 #define IDirectDrawSurface2_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
   2116 #define IDirectDrawSurface2_GetDC(p,a)                   (p)->GetDC(a)
   2117 #define IDirectDrawSurface2_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
   2118 #define IDirectDrawSurface2_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
   2119 #define IDirectDrawSurface2_GetPalette(p,a)              (p)->GetPalette(a)
   2120 #define IDirectDrawSurface2_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
   2121 #define IDirectDrawSurface2_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
   2122 #define IDirectDrawSurface2_Initialize(p,a,b)            (p)->Initialize(a,b)
   2123 #define IDirectDrawSurface2_IsLost(p)                    (p)->IsLost()
   2124 #define IDirectDrawSurface2_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
   2125 #define IDirectDrawSurface2_ReleaseDC(p,a)               (p)->ReleaseDC(a)
   2126 #define IDirectDrawSurface2_Restore(p)                   (p)->Restore()
   2127 #define IDirectDrawSurface2_SetClipper(p,a)              (p)->SetClipper(a)
   2128 #define IDirectDrawSurface2_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
   2129 #define IDirectDrawSurface2_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
   2130 #define IDirectDrawSurface2_SetPalette(p,a)              (p)->SetPalette(a)
   2131 #define IDirectDrawSurface2_Unlock(p,a)                  (p)->Unlock(a)
   2132 #define IDirectDrawSurface2_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
   2133 #define IDirectDrawSurface2_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
   2134 #define IDirectDrawSurface2_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
   2135 /*** IDirectDrawSurface2 methods ***/
   2136 #define IDirectDrawSurface2_GetDDInterface(p,a) (p)->GetDDInterface(a)
   2137 #define IDirectDrawSurface2_PageLock(p,a)       (p)->PageLock(a)
   2138 #define IDirectDrawSurface2_PageUnlock(p,a)     (p)->PageUnlock(a)
   2139 #endif
   2140 
   2141 
   2142 /*****************************************************************************
   2143  * IDirectDrawSurface3 interface
   2144  */
   2145 /* Cannot inherit from IDirectDrawSurface2 because the LPDIRECTDRAWSURFACE2 parameters
   2146  * have been converted to LPDIRECTDRAWSURFACE3.
   2147  */
   2148 #define INTERFACE IDirectDrawSurface3
   2149 DECLARE_INTERFACE_(IDirectDrawSurface3,IUnknown)
   2150 {
   2151     /*** IUnknown methods ***/
   2152     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   2153     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   2154     STDMETHOD_(ULONG,Release)(THIS) PURE;
   2155     /*** IDirectDrawSurface3 methods ***/
   2156     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE;
   2157     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
   2158     STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
   2159     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
   2160     STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE3 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
   2161     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSAttachedSurface) PURE;
   2162     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpEnumSurfacesCallback) PURE;
   2163     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK lpfnCallback) PURE;
   2164     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE3 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
   2165     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS lpDDSCaps, LPDIRECTDRAWSURFACE3 *lplpDDAttachedSurface) PURE;
   2166     STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
   2167     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS lpDDSCaps) PURE;
   2168     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER *lplpDDClipper) PURE;
   2169     STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2170     STDMETHOD(GetDC)(THIS_ HDC *lphDC) PURE;
   2171     STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
   2172     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
   2173     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE *lplpDDPalette) PURE;
   2174     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
   2175     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   2176     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC lpDDSurfaceDesc) PURE;
   2177     STDMETHOD(IsLost)(THIS) PURE;
   2178     STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
   2179     STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
   2180     STDMETHOD(Restore)(THIS) PURE;
   2181     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
   2182     STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2183     STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
   2184     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
   2185     STDMETHOD(Unlock)(THIS_ LPVOID lpSurfaceData) PURE;
   2186     STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE3 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
   2187     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
   2188     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE3 lpDDSReference) PURE;
   2189     /* added in v2 */
   2190     STDMETHOD(GetDDInterface)(THIS_ LPVOID *lplpDD) PURE;
   2191     STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
   2192     STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
   2193     /* added in v3 */
   2194     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC lpDDSD, DWORD dwFlags) PURE;
   2195 };
   2196 #undef INTERFACE
   2197 
   2198 #if !defined(__cplusplus) || defined(CINTERFACE)
   2199 /*** IUnknown methods ***/
   2200 #define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   2201 #define IDirectDrawSurface3_AddRef(p)             (p)->lpVtbl->AddRef(p)
   2202 #define IDirectDrawSurface3_Release(p)            (p)->lpVtbl->Release(p)
   2203 /*** IDirectDrawSurface methods (almost) ***/
   2204 #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
   2205 #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
   2206 #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
   2207 #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
   2208 #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
   2209 #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
   2210 #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
   2211 #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
   2212 #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
   2213 #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
   2214 #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
   2215 #define IDirectDrawSurface3_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
   2216 #define IDirectDrawSurface3_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
   2217 #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
   2218 #define IDirectDrawSurface3_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
   2219 #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
   2220 #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
   2221 #define IDirectDrawSurface3_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
   2222 #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
   2223 #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
   2224 #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
   2225 #define IDirectDrawSurface3_IsLost(p)                    (p)->lpVtbl->IsLost(p)
   2226 #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
   2227 #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
   2228 #define IDirectDrawSurface3_Restore(p)                   (p)->lpVtbl->Restore(p)
   2229 #define IDirectDrawSurface3_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
   2230 #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
   2231 #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
   2232 #define IDirectDrawSurface3_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
   2233 #define IDirectDrawSurface3_Unlock(p,a)                  (p)->lpVtbl->Unlock(p,a)
   2234 #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
   2235 #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
   2236 #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
   2237 /*** IDirectDrawSurface2 methods ***/
   2238 #define IDirectDrawSurface3_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a)
   2239 #define IDirectDrawSurface3_PageLock(p,a)       (p)->lpVtbl->PageLock(p,a)
   2240 #define IDirectDrawSurface3_PageUnlock(p,a)     (p)->lpVtbl->PageUnlock(p,a)
   2241 /*** IDirectDrawSurface3 methods ***/
   2242 #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b)
   2243 #else
   2244 /*** IUnknown methods ***/
   2245 #define IDirectDrawSurface3_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   2246 #define IDirectDrawSurface3_AddRef(p)             (p)->AddRef()
   2247 #define IDirectDrawSurface3_Release(p)            (p)->Release()
   2248 /*** IDirectDrawSurface methods (almost) ***/
   2249 #define IDirectDrawSurface3_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
   2250 #define IDirectDrawSurface3_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
   2251 #define IDirectDrawSurface3_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
   2252 #define IDirectDrawSurface3_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
   2253 #define IDirectDrawSurface3_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
   2254 #define IDirectDrawSurface3_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
   2255 #define IDirectDrawSurface3_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
   2256 #define IDirectDrawSurface3_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
   2257 #define IDirectDrawSurface3_Flip(p,a,b)                  (p)->Flip(a,b)
   2258 #define IDirectDrawSurface3_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
   2259 #define IDirectDrawSurface3_GetBltStatus(p,a)            (p)->GetBltStatus(a)
   2260 #define IDirectDrawSurface3_GetCaps(p,a)                 (p)->GetCaps(a)
   2261 #define IDirectDrawSurface3_GetClipper(p,a)              (p)->GetClipper(a)
   2262 #define IDirectDrawSurface3_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
   2263 #define IDirectDrawSurface3_GetDC(p,a)                   (p)->GetDC(a)
   2264 #define IDirectDrawSurface3_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
   2265 #define IDirectDrawSurface3_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
   2266 #define IDirectDrawSurface3_GetPalette(p,a)              (p)->GetPalette(a)
   2267 #define IDirectDrawSurface3_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
   2268 #define IDirectDrawSurface3_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
   2269 #define IDirectDrawSurface3_Initialize(p,a,b)            (p)->Initialize(a,b)
   2270 #define IDirectDrawSurface3_IsLost(p)                    (p)->IsLost()
   2271 #define IDirectDrawSurface3_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
   2272 #define IDirectDrawSurface3_ReleaseDC(p,a)               (p)->ReleaseDC(a)
   2273 #define IDirectDrawSurface3_Restore(p)                   (p)->Restore()
   2274 #define IDirectDrawSurface3_SetClipper(p,a)              (p)->SetClipper(a)
   2275 #define IDirectDrawSurface3_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
   2276 #define IDirectDrawSurface3_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
   2277 #define IDirectDrawSurface3_SetPalette(p,a)              (p)->SetPalette(a)
   2278 #define IDirectDrawSurface3_Unlock(p,a)                  (p)->Unlock(a)
   2279 #define IDirectDrawSurface3_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
   2280 #define IDirectDrawSurface3_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
   2281 #define IDirectDrawSurface3_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
   2282 /*** IDirectDrawSurface2 methods ***/
   2283 #define IDirectDrawSurface3_GetDDInterface(p,a) (p)->GetDDInterface(a)
   2284 #define IDirectDrawSurface3_PageLock(p,a)       (p)->PageLock(a)
   2285 #define IDirectDrawSurface3_PageUnlock(p,a)     (p)->PageUnlock(a)
   2286 /*** IDirectDrawSurface3 methods ***/
   2287 #define IDirectDrawSurface3_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b)
   2288 #endif
   2289 
   2290 
   2291 /*****************************************************************************
   2292  * IDirectDrawSurface4 interface
   2293  */
   2294 /* Cannot inherit from IDirectDrawSurface2 because DDSCAPS changed to DDSCAPS2.
   2295  */
   2296 #define INTERFACE IDirectDrawSurface4
   2297 DECLARE_INTERFACE_(IDirectDrawSurface4,IUnknown)
   2298 {
   2299     /*** IUnknown methods ***/
   2300     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   2301     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   2302     STDMETHOD_(ULONG,Release)(THIS) PURE;
   2303     /*** IDirectDrawSurface4 methods ***/
   2304     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE;
   2305     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
   2306     STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
   2307     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
   2308     STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE4 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
   2309     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSAttachedSurface) PURE;
   2310     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpEnumSurfacesCallback) PURE;
   2311     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK2 lpfnCallback) PURE;
   2312     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE4 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
   2313     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE4 *lplpDDAttachedSurface) PURE;
   2314     STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
   2315     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE;
   2316     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER *lplpDDClipper) PURE;
   2317     STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2318     STDMETHOD(GetDC)(THIS_ HDC *lphDC) PURE;
   2319     STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
   2320     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
   2321     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE *lplpDDPalette) PURE;
   2322     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
   2323     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
   2324     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
   2325     STDMETHOD(IsLost)(THIS) PURE;
   2326     STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
   2327     STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
   2328     STDMETHOD(Restore)(THIS) PURE;
   2329     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
   2330     STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2331     STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
   2332     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
   2333     STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE;
   2334     STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE4 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
   2335     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
   2336     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE4 lpDDSReference) PURE;
   2337     /* added in v2 */
   2338     STDMETHOD(GetDDInterface)(THIS_ LPVOID *lplpDD) PURE;
   2339     STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
   2340     STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
   2341     /* added in v3 */
   2342     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSD, DWORD dwFlags) PURE;
   2343     /* added in v4 */
   2344     STDMETHOD(SetPrivateData)(THIS_ REFGUID tag, LPVOID pData, DWORD cbSize, DWORD dwFlags) PURE;
   2345     STDMETHOD(GetPrivateData)(THIS_ REFGUID tag, LPVOID pBuffer, LPDWORD pcbBufferSize) PURE;
   2346     STDMETHOD(FreePrivateData)(THIS_ REFGUID tag) PURE;
   2347     STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD pValue) PURE;
   2348     STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
   2349 };
   2350 #undef INTERFACE
   2351 
   2352 #if !defined(__cplusplus) || defined(CINTERFACE)
   2353 /*** IUnknown methods ***/
   2354 #define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   2355 #define IDirectDrawSurface4_AddRef(p)             (p)->lpVtbl->AddRef(p)
   2356 #define IDirectDrawSurface4_Release(p)            (p)->lpVtbl->Release(p)
   2357 /*** IDirectDrawSurface (almost) methods ***/
   2358 #define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
   2359 #define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
   2360 #define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
   2361 #define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
   2362 #define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
   2363 #define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
   2364 #define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
   2365 #define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
   2366 #define IDirectDrawSurface4_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
   2367 #define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
   2368 #define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
   2369 #define IDirectDrawSurface4_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
   2370 #define IDirectDrawSurface4_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
   2371 #define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
   2372 #define IDirectDrawSurface4_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
   2373 #define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
   2374 #define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
   2375 #define IDirectDrawSurface4_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
   2376 #define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
   2377 #define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
   2378 #define IDirectDrawSurface4_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
   2379 #define IDirectDrawSurface4_IsLost(p)                    (p)->lpVtbl->IsLost(p)
   2380 #define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
   2381 #define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
   2382 #define IDirectDrawSurface4_Restore(p)                   (p)->lpVtbl->Restore(p)
   2383 #define IDirectDrawSurface4_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
   2384 #define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
   2385 #define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
   2386 #define IDirectDrawSurface4_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
   2387 #define IDirectDrawSurface4_Unlock(p,a)                  (p)->lpVtbl->Unlock(p,a)
   2388 #define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
   2389 #define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
   2390 #define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
   2391 /*** IDirectDrawSurface2 methods ***/
   2392 #define IDirectDrawSurface4_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a)
   2393 #define IDirectDrawSurface4_PageLock(p,a)       (p)->lpVtbl->PageLock(p,a)
   2394 #define IDirectDrawSurface4_PageUnlock(p,a)     (p)->lpVtbl->PageUnlock(p,a)
   2395 /*** IDirectDrawSurface3 methods ***/
   2396 #define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b)
   2397 /*** IDirectDrawSurface4 methods ***/
   2398 #define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
   2399 #define IDirectDrawSurface4_GetPrivateData(p,a,b,c)   (p)->lpVtbl->GetPrivateData(p,a,b,c)
   2400 #define IDirectDrawSurface4_FreePrivateData(p,a)      (p)->lpVtbl->FreePrivateData(p,a)
   2401 #define IDirectDrawSurface4_GetUniquenessValue(p,a)   (p)->lpVtbl->GetUniquenessValue(p,a)
   2402 #define IDirectDrawSurface4_ChangeUniquenessValue(p)  (p)->lpVtbl->ChangeUniquenessValue(p)
   2403 #else
   2404 /*** IUnknown methods ***/
   2405 #define IDirectDrawSurface4_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   2406 #define IDirectDrawSurface4_AddRef(p)             (p)->AddRef()
   2407 #define IDirectDrawSurface4_Release(p)            (p)->Release()
   2408 /*** IDirectDrawSurface (almost) methods ***/
   2409 #define IDirectDrawSurface4_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
   2410 #define IDirectDrawSurface4_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
   2411 #define IDirectDrawSurface4_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
   2412 #define IDirectDrawSurface4_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
   2413 #define IDirectDrawSurface4_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
   2414 #define IDirectDrawSurface4_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
   2415 #define IDirectDrawSurface4_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
   2416 #define IDirectDrawSurface4_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
   2417 #define IDirectDrawSurface4_Flip(p,a,b)                  (p)->Flip(a,b)
   2418 #define IDirectDrawSurface4_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
   2419 #define IDirectDrawSurface4_GetBltStatus(p,a)            (p)->GetBltStatus(a)
   2420 #define IDirectDrawSurface4_GetCaps(p,a)                 (p)->GetCaps(a)
   2421 #define IDirectDrawSurface4_GetClipper(p,a)              (p)->GetClipper(a)
   2422 #define IDirectDrawSurface4_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
   2423 #define IDirectDrawSurface4_GetDC(p,a)                   (p)->GetDC(a)
   2424 #define IDirectDrawSurface4_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
   2425 #define IDirectDrawSurface4_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
   2426 #define IDirectDrawSurface4_GetPalette(p,a)              (p)->GetPalette(a)
   2427 #define IDirectDrawSurface4_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
   2428 #define IDirectDrawSurface4_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
   2429 #define IDirectDrawSurface4_Initialize(p,a,b)            (p)->Initialize(a,b)
   2430 #define IDirectDrawSurface4_IsLost(p)                    (p)->IsLost()
   2431 #define IDirectDrawSurface4_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
   2432 #define IDirectDrawSurface4_ReleaseDC(p,a)               (p)->ReleaseDC(a)
   2433 #define IDirectDrawSurface4_Restore(p)                   (p)->Restore()
   2434 #define IDirectDrawSurface4_SetClipper(p,a)              (p)->SetClipper(a)
   2435 #define IDirectDrawSurface4_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
   2436 #define IDirectDrawSurface4_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
   2437 #define IDirectDrawSurface4_SetPalette(p,a)              (p)->SetPalette(a)
   2438 #define IDirectDrawSurface4_Unlock(p,a)                  (p)->Unlock(a)
   2439 #define IDirectDrawSurface4_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
   2440 #define IDirectDrawSurface4_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
   2441 #define IDirectDrawSurface4_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
   2442 /*** IDirectDrawSurface2 methods ***/
   2443 #define IDirectDrawSurface4_GetDDInterface(p,a) (p)->GetDDInterface(a)
   2444 #define IDirectDrawSurface4_PageLock(p,a)       (p)->PageLock(a)
   2445 #define IDirectDrawSurface4_PageUnlock(p,a)     (p)->PageUnlock(a)
   2446 /*** IDirectDrawSurface3 methods ***/
   2447 #define IDirectDrawSurface4_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b)
   2448 /*** IDirectDrawSurface4 methods ***/
   2449 #define IDirectDrawSurface4_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d)
   2450 #define IDirectDrawSurface4_GetPrivateData(p,a,b,c)   (p)->GetPrivateData(a,b,c)
   2451 #define IDirectDrawSurface4_FreePrivateData(p,a)      (p)->FreePrivateData(a)
   2452 #define IDirectDrawSurface4_GetUniquenessValue(p,a)   (p)->GetUniquenessValue(a)
   2453 #define IDirectDrawSurface4_ChangeUniquenessValue(p)  (p)->ChangeUniquenessValue()
   2454 #endif
   2455 
   2456 
   2457 /*****************************************************************************
   2458  * IDirectDrawSurface7 interface
   2459  */
   2460 #define INTERFACE IDirectDrawSurface7
   2461 DECLARE_INTERFACE_(IDirectDrawSurface7,IUnknown)
   2462 {
   2463     /*** IUnknown methods ***/
   2464     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   2465     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   2466     STDMETHOD_(ULONG,Release)(THIS) PURE;
   2467     /*** IDirectDrawSurface7 methods ***/
   2468     STDMETHOD(AddAttachedSurface)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE;
   2469     STDMETHOD(AddOverlayDirtyRect)(THIS_ LPRECT lpRect) PURE;
   2470     STDMETHOD(Blt)(THIS_ LPRECT lpDestRect, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwFlags, LPDDBLTFX lpDDBltFx) PURE;
   2471     STDMETHOD(BltBatch)(THIS_ LPDDBLTBATCH lpDDBltBatch, DWORD dwCount, DWORD dwFlags) PURE;
   2472     STDMETHOD(BltFast)(THIS_ DWORD dwX, DWORD dwY, LPDIRECTDRAWSURFACE7 lpDDSrcSurface, LPRECT lpSrcRect, DWORD dwTrans) PURE;
   2473     STDMETHOD(DeleteAttachedSurface)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSAttachedSurface) PURE;
   2474     STDMETHOD(EnumAttachedSurfaces)(THIS_ LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpEnumSurfacesCallback) PURE;
   2475     STDMETHOD(EnumOverlayZOrders)(THIS_ DWORD dwFlags, LPVOID lpContext, LPDDENUMSURFACESCALLBACK7 lpfnCallback) PURE;
   2476     STDMETHOD(Flip)(THIS_ LPDIRECTDRAWSURFACE7 lpDDSurfaceTargetOverride, DWORD dwFlags) PURE;
   2477     STDMETHOD(GetAttachedSurface)(THIS_ LPDDSCAPS2 lpDDSCaps, LPDIRECTDRAWSURFACE7 *lplpDDAttachedSurface) PURE;
   2478     STDMETHOD(GetBltStatus)(THIS_ DWORD dwFlags) PURE;
   2479     STDMETHOD(GetCaps)(THIS_ LPDDSCAPS2 lpDDSCaps) PURE;
   2480     STDMETHOD(GetClipper)(THIS_ LPDIRECTDRAWCLIPPER *lplpDDClipper) PURE;
   2481     STDMETHOD(GetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2482     STDMETHOD(GetDC)(THIS_ HDC *lphDC) PURE;
   2483     STDMETHOD(GetFlipStatus)(THIS_ DWORD dwFlags) PURE;
   2484     STDMETHOD(GetOverlayPosition)(THIS_ LPLONG lplX, LPLONG lplY) PURE;
   2485     STDMETHOD(GetPalette)(THIS_ LPDIRECTDRAWPALETTE *lplpDDPalette) PURE;
   2486     STDMETHOD(GetPixelFormat)(THIS_ LPDDPIXELFORMAT lpDDPixelFormat) PURE;
   2487     STDMETHOD(GetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
   2488     STDMETHOD(Initialize)(THIS_ LPDIRECTDRAW lpDD, LPDDSURFACEDESC2 lpDDSurfaceDesc) PURE;
   2489     STDMETHOD(IsLost)(THIS) PURE;
   2490     STDMETHOD(Lock)(THIS_ LPRECT lpDestRect, LPDDSURFACEDESC2 lpDDSurfaceDesc, DWORD dwFlags, HANDLE hEvent) PURE;
   2491     STDMETHOD(ReleaseDC)(THIS_ HDC hDC) PURE;
   2492     STDMETHOD(Restore)(THIS) PURE;
   2493     STDMETHOD(SetClipper)(THIS_ LPDIRECTDRAWCLIPPER lpDDClipper) PURE;
   2494     STDMETHOD(SetColorKey)(THIS_ DWORD dwFlags, LPDDCOLORKEY lpDDColorKey) PURE;
   2495     STDMETHOD(SetOverlayPosition)(THIS_ LONG lX, LONG lY) PURE;
   2496     STDMETHOD(SetPalette)(THIS_ LPDIRECTDRAWPALETTE lpDDPalette) PURE;
   2497     STDMETHOD(Unlock)(THIS_ LPRECT lpSurfaceData) PURE;
   2498     STDMETHOD(UpdateOverlay)(THIS_ LPRECT lpSrcRect, LPDIRECTDRAWSURFACE7 lpDDDestSurface, LPRECT lpDestRect, DWORD dwFlags, LPDDOVERLAYFX lpDDOverlayFx) PURE;
   2499     STDMETHOD(UpdateOverlayDisplay)(THIS_ DWORD dwFlags) PURE;
   2500     STDMETHOD(UpdateOverlayZOrder)(THIS_ DWORD dwFlags, LPDIRECTDRAWSURFACE7 lpDDSReference) PURE;
   2501     /* added in v2 */
   2502     STDMETHOD(GetDDInterface)(THIS_ LPVOID *lplpDD) PURE;
   2503     STDMETHOD(PageLock)(THIS_ DWORD dwFlags) PURE;
   2504     STDMETHOD(PageUnlock)(THIS_ DWORD dwFlags) PURE;
   2505     /* added in v3 */
   2506     STDMETHOD(SetSurfaceDesc)(THIS_ LPDDSURFACEDESC2 lpDDSD, DWORD dwFlags) PURE;
   2507     /* added in v4 */
   2508     STDMETHOD(SetPrivateData)(THIS_ REFGUID tag, LPVOID pData, DWORD cbSize, DWORD dwFlags) PURE;
   2509     STDMETHOD(GetPrivateData)(THIS_ REFGUID tag, LPVOID pBuffer, LPDWORD pcbBufferSize) PURE;
   2510     STDMETHOD(FreePrivateData)(THIS_ REFGUID tag) PURE;
   2511     STDMETHOD(GetUniquenessValue)(THIS_ LPDWORD pValue) PURE;
   2512     STDMETHOD(ChangeUniquenessValue)(THIS) PURE;
   2513     /* added in v7 */
   2514     STDMETHOD(SetPriority)(THIS_ DWORD prio) PURE;
   2515     STDMETHOD(GetPriority)(THIS_ LPDWORD prio) PURE;
   2516     STDMETHOD(SetLOD)(THIS_ DWORD lod) PURE;
   2517     STDMETHOD(GetLOD)(THIS_ LPDWORD lod) PURE;
   2518 };
   2519 #undef INTERFACE
   2520 
   2521 #if !defined(__cplusplus) || defined(CINTERFACE)
   2522 /*** IUnknown methods ***/
   2523 #define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   2524 #define IDirectDrawSurface7_AddRef(p)             (p)->lpVtbl->AddRef(p)
   2525 #define IDirectDrawSurface7_Release(p)            (p)->lpVtbl->Release(p)
   2526 /*** IDirectDrawSurface (almost) methods ***/
   2527 #define IDirectDrawSurface7_AddAttachedSurface(p,a)      (p)->lpVtbl->AddAttachedSurface(p,a)
   2528 #define IDirectDrawSurface7_AddOverlayDirtyRect(p,a)     (p)->lpVtbl->AddOverlayDirtyRect(p,a)
   2529 #define IDirectDrawSurface7_Blt(p,a,b,c,d,e)             (p)->lpVtbl->Blt(p,a,b,c,d,e)
   2530 #define IDirectDrawSurface7_BltBatch(p,a,b,c)            (p)->lpVtbl->BltBatch(p,a,b,c)
   2531 #define IDirectDrawSurface7_BltFast(p,a,b,c,d,e)         (p)->lpVtbl->BltFast(p,a,b,c,d,e)
   2532 #define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->lpVtbl->DeleteAttachedSurface(p,a,b)
   2533 #define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b)  (p)->lpVtbl->EnumAttachedSurfaces(p,a,b)
   2534 #define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c)  (p)->lpVtbl->EnumOverlayZOrders(p,a,b,c)
   2535 #define IDirectDrawSurface7_Flip(p,a,b)                  (p)->lpVtbl->Flip(p,a,b)
   2536 #define IDirectDrawSurface7_GetAttachedSurface(p,a,b)    (p)->lpVtbl->GetAttachedSurface(p,a,b)
   2537 #define IDirectDrawSurface7_GetBltStatus(p,a)            (p)->lpVtbl->GetBltStatus(p,a)
   2538 #define IDirectDrawSurface7_GetCaps(p,a)                 (p)->lpVtbl->GetCaps(p,a)
   2539 #define IDirectDrawSurface7_GetClipper(p,a)              (p)->lpVtbl->GetClipper(p,a)
   2540 #define IDirectDrawSurface7_GetColorKey(p,a,b)           (p)->lpVtbl->GetColorKey(p,a,b)
   2541 #define IDirectDrawSurface7_GetDC(p,a)                   (p)->lpVtbl->GetDC(p,a)
   2542 #define IDirectDrawSurface7_GetFlipStatus(p,a)           (p)->lpVtbl->GetFlipStatus(p,a)
   2543 #define IDirectDrawSurface7_GetOverlayPosition(p,a,b)    (p)->lpVtbl->GetOverlayPosition(p,a,b)
   2544 #define IDirectDrawSurface7_GetPalette(p,a)              (p)->lpVtbl->GetPalette(p,a)
   2545 #define IDirectDrawSurface7_GetPixelFormat(p,a)          (p)->lpVtbl->GetPixelFormat(p,a)
   2546 #define IDirectDrawSurface7_GetSurfaceDesc(p,a)          (p)->lpVtbl->GetSurfaceDesc(p,a)
   2547 #define IDirectDrawSurface7_Initialize(p,a,b)            (p)->lpVtbl->Initialize(p,a,b)
   2548 #define IDirectDrawSurface7_IsLost(p)                    (p)->lpVtbl->IsLost(p)
   2549 #define IDirectDrawSurface7_Lock(p,a,b,c,d)              (p)->lpVtbl->Lock(p,a,b,c,d)
   2550 #define IDirectDrawSurface7_ReleaseDC(p,a)               (p)->lpVtbl->ReleaseDC(p,a)
   2551 #define IDirectDrawSurface7_Restore(p)                   (p)->lpVtbl->Restore(p)
   2552 #define IDirectDrawSurface7_SetClipper(p,a)              (p)->lpVtbl->SetClipper(p,a)
   2553 #define IDirectDrawSurface7_SetColorKey(p,a,b)           (p)->lpVtbl->SetColorKey(p,a,b)
   2554 #define IDirectDrawSurface7_SetOverlayPosition(p,a,b)    (p)->lpVtbl->SetOverlayPosition(p,a,b)
   2555 #define IDirectDrawSurface7_SetPalette(p,a)              (p)->lpVtbl->SetPalette(p,a)
   2556 #define IDirectDrawSurface7_Unlock(p,a)                  (p)->lpVtbl->Unlock(p,a)
   2557 #define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e)   (p)->lpVtbl->UpdateOverlay(p,a,b,c,d,e)
   2558 #define IDirectDrawSurface7_UpdateOverlayDisplay(p,a)    (p)->lpVtbl->UpdateOverlayDisplay(p,a)
   2559 #define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b)   (p)->lpVtbl->UpdateOverlayZOrder(p,a,b)
   2560 /*** IDirectDrawSurface2 methods ***/
   2561 #define IDirectDrawSurface7_GetDDInterface(p,a) (p)->lpVtbl->GetDDInterface(p,a)
   2562 #define IDirectDrawSurface7_PageLock(p,a)       (p)->lpVtbl->PageLock(p,a)
   2563 #define IDirectDrawSurface7_PageUnlock(p,a)     (p)->lpVtbl->PageUnlock(p,a)
   2564 /*** IDirectDrawSurface3 methods ***/
   2565 #define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->lpVtbl->SetSurfaceDesc(p,a,b)
   2566 /*** IDirectDrawSurface4 methods ***/
   2567 #define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->lpVtbl->SetPrivateData(p,a,b,c,d)
   2568 #define IDirectDrawSurface7_GetPrivateData(p,a,b,c)   (p)->lpVtbl->GetPrivateData(p,a,b,c)
   2569 #define IDirectDrawSurface7_FreePrivateData(p,a)      (p)->lpVtbl->FreePrivateData(p,a)
   2570 #define IDirectDrawSurface7_GetUniquenessValue(p,a)   (p)->lpVtbl->GetUniquenessValue(p,a)
   2571 #define IDirectDrawSurface7_ChangeUniquenessValue(p)  (p)->lpVtbl->ChangeUniquenessValue(p)
   2572 /*** IDirectDrawSurface7 methods ***/
   2573 #define IDirectDrawSurface7_SetPriority(p,a)          (p)->lpVtbl->SetPriority(p,a)
   2574 #define IDirectDrawSurface7_GetPriority(p,a)          (p)->lpVtbl->GetPriority(p,a)
   2575 #define IDirectDrawSurface7_SetLOD(p,a)               (p)->lpVtbl->SetLOD(p,a)
   2576 #define IDirectDrawSurface7_GetLOD(p,a)               (p)->lpVtbl->GetLOD(p,a)
   2577 #else
   2578 /*** IUnknown methods ***/
   2579 #define IDirectDrawSurface7_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   2580 #define IDirectDrawSurface7_AddRef(p)             (p)->AddRef()
   2581 #define IDirectDrawSurface7_Release(p)            (p)->Release()
   2582 /*** IDirectDrawSurface (almost) methods ***/
   2583 #define IDirectDrawSurface7_AddAttachedSurface(p,a)      (p)->AddAttachedSurface(a)
   2584 #define IDirectDrawSurface7_AddOverlayDirtyRect(p,a)     (p)->AddOverlayDirtyRect(a)
   2585 #define IDirectDrawSurface7_Blt(p,a,b,c,d,e)             (p)->Blt(a,b,c,d,e)
   2586 #define IDirectDrawSurface7_BltBatch(p,a,b,c)            (p)->BltBatch(a,b,c)
   2587 #define IDirectDrawSurface7_BltFast(p,a,b,c,d,e)         (p)->BltFast(a,b,c,d,e)
   2588 #define IDirectDrawSurface7_DeleteAttachedSurface(p,a,b) (p)->DeleteAttachedSurface(a,b)
   2589 #define IDirectDrawSurface7_EnumAttachedSurfaces(p,a,b)  (p)->EnumAttachedSurfaces(a,b)
   2590 #define IDirectDrawSurface7_EnumOverlayZOrders(p,a,b,c)  (p)->EnumOverlayZOrders(a,b,c)
   2591 #define IDirectDrawSurface7_Flip(p,a,b)                  (p)->Flip(a,b)
   2592 #define IDirectDrawSurface7_GetAttachedSurface(p,a,b)    (p)->GetAttachedSurface(a,b)
   2593 #define IDirectDrawSurface7_GetBltStatus(p,a)            (p)->GetBltStatus(a)
   2594 #define IDirectDrawSurface7_GetCaps(p,a)                 (p)->GetCaps(a)
   2595 #define IDirectDrawSurface7_GetClipper(p,a)              (p)->GetClipper(a)
   2596 #define IDirectDrawSurface7_GetColorKey(p,a,b)           (p)->GetColorKey(a,b)
   2597 #define IDirectDrawSurface7_GetDC(p,a)                   (p)->GetDC(a)
   2598 #define IDirectDrawSurface7_GetFlipStatus(p,a)           (p)->GetFlipStatus(a)
   2599 #define IDirectDrawSurface7_GetOverlayPosition(p,a,b)    (p)->GetOverlayPosition(a,b)
   2600 #define IDirectDrawSurface7_GetPalette(p,a)              (p)->GetPalette(a)
   2601 #define IDirectDrawSurface7_GetPixelFormat(p,a)          (p)->GetPixelFormat(a)
   2602 #define IDirectDrawSurface7_GetSurfaceDesc(p,a)          (p)->GetSurfaceDesc(a)
   2603 #define IDirectDrawSurface7_Initialize(p,a,b)            (p)->Initialize(a,b)
   2604 #define IDirectDrawSurface7_IsLost(p)                    (p)->IsLost()
   2605 #define IDirectDrawSurface7_Lock(p,a,b,c,d)              (p)->Lock(a,b,c,d)
   2606 #define IDirectDrawSurface7_ReleaseDC(p,a)               (p)->ReleaseDC(a)
   2607 #define IDirectDrawSurface7_Restore(p)                   (p)->Restore()
   2608 #define IDirectDrawSurface7_SetClipper(p,a)              (p)->SetClipper(a)
   2609 #define IDirectDrawSurface7_SetColorKey(p,a,b)           (p)->SetColorKey(a,b)
   2610 #define IDirectDrawSurface7_SetOverlayPosition(p,a,b)    (p)->SetOverlayPosition(a,b)
   2611 #define IDirectDrawSurface7_SetPalette(p,a)              (p)->SetPalette(a)
   2612 #define IDirectDrawSurface7_Unlock(p,a)                  (p)->Unlock(a)
   2613 #define IDirectDrawSurface7_UpdateOverlay(p,a,b,c,d,e)   (p)->UpdateOverlay(a,b,c,d,e)
   2614 #define IDirectDrawSurface7_UpdateOverlayDisplay(p,a)    (p)->UpdateOverlayDisplay(a)
   2615 #define IDirectDrawSurface7_UpdateOverlayZOrder(p,a,b)   (p)->UpdateOverlayZOrder(a,b)
   2616 /*** IDirectDrawSurface2 methods ***/
   2617 #define IDirectDrawSurface7_GetDDInterface(p,a) (p)->GetDDInterface(a)
   2618 #define IDirectDrawSurface7_PageLock(p,a)       (p)->PageLock(a)
   2619 #define IDirectDrawSurface7_PageUnlock(p,a)     (p)->PageUnlock(a)
   2620 /*** IDirectDrawSurface3 methods ***/
   2621 #define IDirectDrawSurface7_SetSurfaceDesc(p,a,b) (p)->SetSurfaceDesc(a,b)
   2622 /*** IDirectDrawSurface4 methods ***/
   2623 #define IDirectDrawSurface7_SetPrivateData(p,a,b,c,d) (p)->SetPrivateData(a,b,c,d)
   2624 #define IDirectDrawSurface7_GetPrivateData(p,a,b,c)   (p)->GetPrivateData(a,b,c)
   2625 #define IDirectDrawSurface7_FreePrivateData(p,a)      (p)->FreePrivateData(a)
   2626 #define IDirectDrawSurface7_GetUniquenessValue(p,a)   (p)->GetUniquenessValue(a)
   2627 #define IDirectDrawSurface7_ChangeUniquenessValue(p)  (p)->ChangeUniquenessValue()
   2628 /*** IDirectDrawSurface7 methods ***/
   2629 #define IDirectDrawSurface7_SetPriority(p,a)          (p)->SetPriority(a)
   2630 #define IDirectDrawSurface7_GetPriority(p,a)          (p)->GetPriority(a)
   2631 #define IDirectDrawSurface7_SetLOD(p,a)               (p)->SetLOD(a)
   2632 #define IDirectDrawSurface7_GetLOD(p,a)               (p)->GetLOD(a)
   2633 #endif
   2634 
   2635 /*****************************************************************************
   2636  * IDirectDrawColorControl interface
   2637  */
   2638 #define INTERFACE IDirectDrawColorControl
   2639 DECLARE_INTERFACE_(IDirectDrawColorControl,IUnknown)
   2640 {
   2641     /*** IUnknown methods ***/
   2642     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   2643     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   2644     STDMETHOD_(ULONG,Release)(THIS) PURE;
   2645     /*** IDirectDrawColorControl methods ***/
   2646     STDMETHOD(GetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE;
   2647     STDMETHOD(SetColorControls)(THIS_ LPDDCOLORCONTROL lpColorControl) PURE;
   2648 };
   2649 #undef INTERFACE
   2650 
   2651 #if !defined(__cplusplus) || defined(CINTERFACE)
   2652 /*** IUnknown methods ***/
   2653 #define IDirectDrawColorControl_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   2654 #define IDirectDrawColorControl_AddRef(p)             (p)->lpVtbl->AddRef(p)
   2655 #define IDirectDrawColorControl_Release(p)            (p)->lpVtbl->Release(p)
   2656 /*** IDirectDrawColorControl methods ***/
   2657 #define IDirectDrawColorControl_GetColorControls(p,a) (p)->lpVtbl->GetColorControls(p,a)
   2658 #define IDirectDrawColorControl_SetColorControls(p,a) (p)->lpVtbl->SetColorControls(p,a)
   2659 #else
   2660 /*** IUnknown methods ***/
   2661 #define IDirectDrawColorControl_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   2662 #define IDirectDrawColorControl_AddRef(p)             (p)->AddRef()
   2663 #define IDirectDrawColorControl_Release(p)            (p)->Release()
   2664 /*** IDirectDrawColorControl methods ***/
   2665 #define IDirectDrawColorControl_GetColorControls(p,a) (p)->GetColorControls(a)
   2666 #define IDirectDrawColorControl_SetColorControls(p,a) (p)->SetColorControls(a)
   2667 #endif
   2668 
   2669 /*****************************************************************************
   2670  * IDirectDrawGammaControl interface
   2671  */
   2672 #define INTERFACE IDirectDrawGammaControl
   2673 DECLARE_INTERFACE_(IDirectDrawGammaControl,IUnknown)
   2674 {
   2675     /*** IUnknown methods ***/
   2676     STDMETHOD_(HRESULT,QueryInterface)(THIS_ REFIID riid, void** ppvObject) PURE;
   2677     STDMETHOD_(ULONG,AddRef)(THIS) PURE;
   2678     STDMETHOD_(ULONG,Release)(THIS) PURE;
   2679     /*** IDirectDrawGammaControl methods ***/
   2680     STDMETHOD(GetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE;
   2681     STDMETHOD(SetGammaRamp)(THIS_ DWORD dwFlags, LPDDGAMMARAMP lpGammaRamp) PURE;
   2682 };
   2683 #undef INTERFACE
   2684 
   2685 #if !defined(__cplusplus) || defined(CINTERFACE)
   2686 /*** IUnknown methods ***/
   2687 #define IDirectDrawGammaControl_QueryInterface(p,a,b) (p)->lpVtbl->QueryInterface(p,a,b)
   2688 #define IDirectDrawGammaControl_AddRef(p)             (p)->lpVtbl->AddRef(p)
   2689 #define IDirectDrawGammaControl_Release(p)            (p)->lpVtbl->Release(p)
   2690 /*** IDirectDrawGammaControl methods ***/
   2691 #define IDirectDrawGammaControl_GetGammaRamp(p,a,b)   (p)->lpVtbl->GetGammaRamp(p,a,b)
   2692 #define IDirectDrawGammaControl_SetGammaRamp(p,a,b)   (p)->lpVtbl->SetGammaRamp(p,a,b)
   2693 #else
   2694 /*** IUnknown methods ***/
   2695 #define IDirectDrawGammaControl_QueryInterface(p,a,b) (p)->QueryInterface(a,b)
   2696 #define IDirectDrawGammaControl_AddRef(p)             (p)->AddRef()
   2697 #define IDirectDrawGammaControl_Release(p)            (p)->Release()
   2698 /*** IDirectDrawGammaControl methods ***/
   2699 #define IDirectDrawGammaControl_GetGammaRamp(p,a,b)   (p)->GetGammaRamp(a,b)
   2700 #define IDirectDrawGammaControl_SetGammaRamp(p,a,b)   (p)->SetGammaRamp(a,b)
   2701 #endif
   2702 
   2703 
   2704 HRESULT WINAPI DirectDrawCreate(GUID*,LPDIRECTDRAW*,IUnknown*);
   2705 HRESULT WINAPI DirectDrawCreateEx(GUID*,LPVOID*,REFIID,IUnknown*);
   2706 HRESULT WINAPI DirectDrawCreateClipper(DWORD,LPDIRECTDRAWCLIPPER*,IUnknown*);
   2707 
   2708 #ifdef __cplusplus
   2709 } /* extern "C" */
   2710 #endif /* defined(__cplusplus) */
   2711 
   2712 #endif /* __DDRAW_INCLUDED__ */
   2713