1 #include <windows.h>
2 #include <stdio.h>
3 #include <ddraw.h>
4 #include <ddrawi.h>
5 #include <d3dhal.h>
6 #include <ddrawgdi.h>
7 
8 #if defined(_WIN32) && !defined(_NO_COM )
9 #define COM_NO_WINDOWS_H
10 #include <objbase.h>
11 #else
12 #define IUnknown void
13 #if !defined(NT_BUILD_ENVIRONMENT) && !defined(WINNT)
14         #define CO_E_NOTINITIALIZED 0x800401F0
15 #endif
16 #endif
17 
18 ULONG   WINAPI Main_DDrawSurface_AddRef(LPDIRECTDRAWSURFACE4);
19 ULONG   WINAPI Main_DDrawSurface_Release4(LPDIRECTDRAWSURFACE4);
20 HRESULT WINAPI Main_DDrawSurface_QueryInterface(LPDIRECTDRAWSURFACE4, REFIID, LPVOID*);
21 HRESULT WINAPI Main_DDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE4, HDC);
22 HRESULT WINAPI Main_DDrawSurface_Blt(LPDIRECTDRAWSURFACE4, LPRECT, LPDIRECTDRAWSURFACE4, LPRECT, DWORD, LPDDBLTFX);
23 HRESULT WINAPI Main_DDrawSurface_BltBatch(LPDIRECTDRAWSURFACE4, LPDDBLTBATCH, DWORD, DWORD);
24 HRESULT WINAPI Main_DDrawSurface_BltFast(LPDIRECTDRAWSURFACE4, DWORD, DWORD, LPDIRECTDRAWSURFACE4, LPRECT, DWORD);
25 HRESULT WINAPI Main_DDrawSurface_DeleteAttachedSurface(LPDIRECTDRAWSURFACE4, DWORD, LPDIRECTDRAWSURFACE4);
26 HRESULT WINAPI Main_DDrawSurface_EnumAttachedSurfaces(LPDIRECTDRAWSURFACE4, LPVOID, LPDDENUMSURFACESCALLBACK2);
27 HRESULT WINAPI Main_DDrawSurface_EnumOverlayZOrders(LPDIRECTDRAWSURFACE4, DWORD, LPVOID,LPDDENUMSURFACESCALLBACK2);
28 HRESULT WINAPI Main_DDrawSurface_Flip(LPDIRECTDRAWSURFACE4 , LPDIRECTDRAWSURFACE4, DWORD);
29 HRESULT WINAPI Main_DDrawSurface_FreePrivateData(LPDIRECTDRAWSURFACE4, REFGUID);
30 HRESULT WINAPI Main_DDrawSurface_GetAttachedSurface(LPDIRECTDRAWSURFACE4, LPDDSCAPS2, LPDIRECTDRAWSURFACE4*);
31 HRESULT WINAPI Main_DDrawSurface_GetBltStatus(LPDIRECTDRAWSURFACE4, DWORD dwFlags);
32 HRESULT WINAPI Main_DDrawSurface_GetCaps(LPDIRECTDRAWSURFACE4, LPDDSCAPS2 pCaps);
33 HRESULT WINAPI Main_DDrawSurface_GetClipper(LPDIRECTDRAWSURFACE4, LPDIRECTDRAWCLIPPER*);
34 HRESULT WINAPI Main_DDrawSurface_GetColorKey(LPDIRECTDRAWSURFACE4, DWORD, LPDDCOLORKEY);
35 HRESULT WINAPI Main_DDrawSurface_GetDC(LPDIRECTDRAWSURFACE4, HDC *);
36 HRESULT WINAPI Main_DDrawSurface_GetDDInterface(LPDIRECTDRAWSURFACE4, LPVOID*);
37 HRESULT WINAPI Main_DDrawSurface_GetFlipStatus(LPDIRECTDRAWSURFACE4, DWORD);
38 HRESULT WINAPI Main_DDrawSurface_GetOverlayPosition(LPDIRECTDRAWSURFACE4, LPLONG, LPLONG);
39 HRESULT WINAPI Main_DDrawSurface_GetPalette(LPDIRECTDRAWSURFACE4, LPDIRECTDRAWPALETTE*);
40 HRESULT WINAPI Main_DDrawSurface_GetPixelFormat(LPDIRECTDRAWSURFACE4, LPDDPIXELFORMAT);
41 HRESULT WINAPI Main_DDrawSurface_GetPrivateData(LPDIRECTDRAWSURFACE4, REFGUID, LPVOID, LPDWORD);
42 HRESULT WINAPI Main_DDrawSurface_GetSurfaceDesc(LPDIRECTDRAWSURFACE4, LPDDSURFACEDESC2);
43 HRESULT WINAPI Main_DDrawSurface_GetUniquenessValue(LPDIRECTDRAWSURFACE4, LPDWORD);
44 HRESULT WINAPI Main_DDrawSurface_IsLost(LPDIRECTDRAWSURFACE4);
45 HRESULT WINAPI Main_DDrawSurface_PageLock(LPDIRECTDRAWSURFACE4, DWORD);
46 HRESULT WINAPI Main_DDrawSurface_PageUnlock(LPDIRECTDRAWSURFACE4, DWORD);
47 HRESULT WINAPI Main_DDrawSurface_ReleaseDC(LPDIRECTDRAWSURFACE4, HDC);
48 HRESULT WINAPI Main_DDrawSurface_SetClipper (LPDIRECTDRAWSURFACE4, LPDIRECTDRAWCLIPPER);
49 HRESULT WINAPI Main_DDrawSurface_SetColorKey (LPDIRECTDRAWSURFACE4, DWORD, LPDDCOLORKEY);
50 HRESULT WINAPI Main_DDrawSurface_SetOverlayPosition (LPDIRECTDRAWSURFACE4, LONG, LONG);
51 HRESULT WINAPI Main_DDrawSurface_SetPalette (LPDIRECTDRAWSURFACE4, LPDIRECTDRAWPALETTE);
52 HRESULT WINAPI Main_DDrawSurface_SetPrivateData (LPDIRECTDRAWSURFACE4, REFGUID, LPVOID, DWORD, DWORD);
53 HRESULT WINAPI Main_DDrawSurface_UpdateOverlayDisplay (LPDIRECTDRAWSURFACE4, DWORD);
54 HRESULT WINAPI Main_DDrawSurface_UpdateOverlayZOrder (LPDIRECTDRAWSURFACE4, DWORD, LPDIRECTDRAWSURFACE4);
55 HRESULT WINAPI Main_DDrawSurface_SetSurfaceDesc(LPDIRECTDRAWSURFACE4, DDSURFACEDESC2 *, DWORD);
56 HRESULT WINAPI Main_DDrawSurface_Unlock (LPDIRECTDRAWSURFACE4, LPRECT);
57 HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE4, LPDIRECTDRAW, LPDDSURFACEDESC2);
58 HRESULT WINAPI Main_DDrawSurface_Lock (LPDIRECTDRAWSURFACE4, LPRECT, LPDDSURFACEDESC2, DWORD, HANDLE);
59 HRESULT WINAPI Main_DDrawSurface_Restore(LPDIRECTDRAWSURFACE4);
60 HRESULT WINAPI Main_DDrawSurface_UpdateOverlay (LPDIRECTDRAWSURFACE4, LPRECT, LPDIRECTDRAWSURFACE4, LPRECT,
61                                                 DWORD, LPDDOVERLAYFX);
62 HRESULT WINAPI Main_DDrawSurface_ChangeUniquenessValue(LPDIRECTDRAWSURFACE4);
63 HRESULT WINAPI Main_DDrawSurface_AddAttachedSurface(LPDIRECTDRAWSURFACE4, LPDIRECTDRAWSURFACE4);
64 HRESULT WINAPI Main_DDrawSurface_AddOverlayDirtyRect(LPDIRECTDRAWSURFACE4, LPRECT);
65 
66 
67 IDirectDrawSurface4Vtbl DirectDrawSurface4_Vtable =
68 {
69     Main_DDrawSurface_QueryInterface,
70     Main_DDrawSurface_AddRef,                        /* (Compact done) */
71     Main_DDrawSurface_Release4,
72     Main_DDrawSurface_AddAttachedSurface,
73     Main_DDrawSurface_AddOverlayDirtyRect,
74     Main_DDrawSurface_Blt,
75     Main_DDrawSurface_BltBatch,
76     Main_DDrawSurface_BltFast,
77     Main_DDrawSurface_DeleteAttachedSurface,
78     Main_DDrawSurface_EnumAttachedSurfaces,
79     Main_DDrawSurface_EnumOverlayZOrders,
80     Main_DDrawSurface_Flip,
81     Main_DDrawSurface_GetAttachedSurface,
82     Main_DDrawSurface_GetBltStatus,
83     Main_DDrawSurface_GetCaps,
84     Main_DDrawSurface_GetClipper,
85     Main_DDrawSurface_GetColorKey,
86     Main_DDrawSurface_GetDC,
87     Main_DDrawSurface_GetFlipStatus,
88     Main_DDrawSurface_GetOverlayPosition,
89     Main_DDrawSurface_GetPalette,
90     Main_DDrawSurface_GetPixelFormat,
91     Main_DDrawSurface_GetSurfaceDesc,
92     Main_DDrawSurface_Initialize,
93     Main_DDrawSurface_IsLost,
94     Main_DDrawSurface_Lock,
95     Main_DDrawSurface_ReleaseDC,
96     Main_DDrawSurface_Restore,
97     Main_DDrawSurface_SetClipper,
98     Main_DDrawSurface_SetColorKey,
99     Main_DDrawSurface_SetOverlayPosition,
100     Main_DDrawSurface_SetPalette,
101     Main_DDrawSurface_Unlock,
102     Main_DDrawSurface_UpdateOverlay,
103     Main_DDrawSurface_UpdateOverlayDisplay,
104     Main_DDrawSurface_UpdateOverlayZOrder,
105     Main_DDrawSurface_GetDDInterface,
106     Main_DDrawSurface_PageLock,
107     Main_DDrawSurface_PageUnlock,
108     Main_DDrawSurface_SetSurfaceDesc,
109     Main_DDrawSurface_SetPrivateData,
110     Main_DDrawSurface_GetPrivateData,
111     Main_DDrawSurface_FreePrivateData,
112     Main_DDrawSurface_GetUniquenessValue,
113     Main_DDrawSurface_ChangeUniquenessValue,
114 };
115