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