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