DXGL r438 - Code Review

Jump to navigation Jump to search
Repository:DXGL
Revision:r437‎ | r438 | r439 >
Date:23:55, 11 May 2014
Author:admin
Status:new
Tags:
Comment:
Add Wine ddraw.h and remove dependency on Microsoft ddraw.h
Modified paths:
  • /ddraw/common.h (modified) (history)
  • /ddraw/ddraw.vcxproj (modified) (history)
  • /ddraw/ddraw.vcxproj.filters (modified) (history)
  • /ddraw/dxguid.cpp (modified) (history)
  • /ddraw/include/d3dcaps.h (modified) (history)
  • /ddraw/include/d3dtypes.h (modified) (history)
  • /ddraw/include/ddraw.h (added) (history)
  • /dxgltest/common.h (modified) (history)
  • /dxgltest/dxguid.cpp (modified) (history)

Diff [purge]

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