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