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