1 
2 #include <windows.h>
3 #include <stdio.h>
4 #include <ddraw.h>
5 #include <ddrawi.h>
6 #include <d3dhal.h>
7 #include <ddrawgdi.h>
8 
9 #if defined(_WIN32) && !defined(_NO_COM )
10 #define COM_NO_WINDOWS_H
11 #include <objbase.h>
12 #else
13 #define IUnknown void
14 #if !defined(NT_BUILD_ENVIRONMENT) && !defined(WINNT)
15         #define CO_E_NOTINITIALIZED 0x800401F0
16 #endif
17 #endif
18 
19 
20 
21 
22 HRESULT WINAPI
23 Main_DirectDraw_QueryInterface (
24                                 LPDIRECTDRAW7 iface,
25                                 REFIID id,
26                                 LPVOID *obj);
27 
28 ULONG WINAPI
29 Main_DirectDraw_AddRef (LPDIRECTDRAW7 iface);
30 
31 ULONG WINAPI
32 Main_DirectDraw_Release (LPDIRECTDRAW7 iface);
33 
34 HRESULT WINAPI
35 Main_DirectDraw_Compact(LPDIRECTDRAW7 iface);
36 
37 HRESULT WINAPI
38 Main_DirectDraw_CreateClipper(
39                               LPDIRECTDRAW7 iface,
40                               DWORD dwFlags,
41                               LPDIRECTDRAWCLIPPER *ppClipper,
42                               IUnknown *pUnkOuter);
43 
44 HRESULT WINAPI
45 Main_DirectDraw_CreatePalette(
46                               LPDIRECTDRAW7 iface,
47                               DWORD dwFlags,
48                               LPPALETTEENTRY palent,
49                               LPDIRECTDRAWPALETTE* ppPalette,
50                               LPUNKNOWN pUnkOuter);
51 
52 HRESULT WINAPI
53 Main_DirectDraw_CreateSurface4(
54                                LPDIRECTDRAW7 iface,
55                                LPDDSURFACEDESC2 pDDSD,
56                                LPDIRECTDRAWSURFACE7 *ppSurf,
57                                IUnknown *pUnkOuter);
58 
59 HRESULT WINAPI
60 Main_DirectDraw_DuplicateSurface(
61                                  LPDIRECTDRAW7 iface,
62                                  LPDIRECTDRAWSURFACE7 src,
63                                  LPDIRECTDRAWSURFACE7* dst);
64 
65 HRESULT WINAPI
66 Main_DirectDraw_EnumDisplayModes4(
67                                  LPDIRECTDRAW7 iface,
68                                  DWORD dwFlags,
69                                  LPDDSURFACEDESC2 pDDSD,
70                                  LPVOID pContext,
71                                  LPDDENUMMODESCALLBACK2 pCallback);
72 
73 HRESULT WINAPI
74 Main_DirectDraw_EnumSurfaces7(
75                              LPDIRECTDRAW7 iface,
76                              DWORD dwFlags,
77                              LPDDSURFACEDESC2 lpDDSD2,
78                              LPVOID context,
79                              LPDDENUMSURFACESCALLBACK7 callback);
80 
81 HRESULT WINAPI
82 Main_DirectDraw_FlipToGDISurface(LPDIRECTDRAW7 iface);
83 
84 HRESULT WINAPI
85 Main_DirectDraw_GetCaps(
86                         LPDIRECTDRAW7 iface,
87                         LPDDCAPS pDriverCaps,
88                         LPDDCAPS pHELCaps);
89 
90 HRESULT WINAPI
91 Main_DirectDraw_GetDisplayMode4 (
92                                 LPDIRECTDRAW7 iface,
93                                 LPDDSURFACEDESC2 pDDSD);
94 
95 HRESULT WINAPI
96 Main_DirectDraw_GetFourCCCodes(
97                                LPDIRECTDRAW7 iface,
98                                LPDWORD lpNumCodes,
99                                LPDWORD lpCodes);
100 
101 HRESULT WINAPI
102 Main_DirectDraw_GetGDISurface(
103                               LPDIRECTDRAW7 iface,
104                               LPDIRECTDRAWSURFACE7 *lplpGDIDDSSurface);
105 
106 HRESULT WINAPI
107 Main_DirectDraw_GetMonitorFrequency (
108                                      LPDIRECTDRAW7 iface,
109                                      LPDWORD lpFreq);
110 
111 
112 HRESULT WINAPI
113 Main_DirectDraw_GetScanLine(LPDIRECTDRAW7 iface,
114                             LPDWORD lpdwScanLine);
115 
116 HRESULT WINAPI
117 Main_DirectDraw_GetVerticalBlankStatus(
118                                        LPDIRECTDRAW7 iface,
119                                        LPBOOL lpbIsInVB);
120 
121 HRESULT WINAPI
122 Main_DirectDraw_Initialize (
123                             LPDIRECTDRAW7 iface,
124                             LPGUID lpGUID);
125 
126 
127 HRESULT WINAPI
128 Main_DirectDraw_RestoreDisplayMode (LPDIRECTDRAW7 iface);
129 
130 HRESULT WINAPI
131 Main_DirectDraw_SetCooperativeLevel (
132                                      LPDIRECTDRAW7 iface,
133                                      HWND hwnd,
134                                      DWORD cooplevel);
135 
136 HRESULT WINAPI
137 Main_DirectDraw_SetDisplayMode2(
138                                LPDIRECTDRAW7 iface,
139                                DWORD dwWidth,
140                                DWORD dwHeight,
141                                DWORD dwBPP,
142                                DWORD dwRefreshRate,
143                                DWORD dwFlags);
144 
145 HRESULT WINAPI
146 Main_DirectDraw_WaitForVerticalBlank(
147                                      LPDIRECTDRAW7 iface,
148                                      DWORD dwFlags,
149                                      HANDLE h);
150 
151 
152 HRESULT WINAPI
153 Main_DirectDraw_GetAvailableVidMem4(
154                                     LPDIRECTDRAW7 iface,
155                                     LPDDSCAPS2 ddscaps,
156                                     LPDWORD dwTotal,
157                                     LPDWORD dwFree);
158 
159 HRESULT WINAPI
160 Main_DirectDraw_GetSurfaceFromDC(
161                                  LPDIRECTDRAW7 iface,
162                                  HDC hdc,
163                                  LPDIRECTDRAWSURFACE7 *lpDDS);
164 
165 HRESULT WINAPI
166 Main_DirectDraw_RestoreAllSurfaces(LPDIRECTDRAW7 iface);
167 
168 HRESULT WINAPI
169 Main_DirectDraw_TestCooperativeLevel(LPDIRECTDRAW7 iface);
170 
171 HRESULT WINAPI
172 Main_DirectDraw_GetDeviceIdentifier7(
173                                      LPDIRECTDRAW7 iface,
174                                      LPDDDEVICEIDENTIFIER2 pDDDI,
175                                      DWORD dwFlags);
176 
177 HRESULT WINAPI
178 Main_DirectDraw_StartModeTest(
179                               LPDIRECTDRAW7 iface,
180                               LPSIZE pModes,
181                               DWORD dwNumModes,
182                               DWORD dwFlags);
183 
184 HRESULT WINAPI
185 Main_DirectDraw_EvaluateMode(
186                              LPDIRECTDRAW7 iface,
187                              DWORD a,
188                              DWORD* b);
189 
190 IDirectDraw7Vtbl DirectDraw7_Vtable =
191 {
192     Main_DirectDraw_QueryInterface,             /* (QueryInterface testing / devloping) */
193     Main_DirectDraw_AddRef,                     /* (AddRef done) */
194     Main_DirectDraw_Release,                    /* (QueryInterface testing / devloping) */
195     Main_DirectDraw_Compact,                    /* (Compact done) */
196     Main_DirectDraw_CreateClipper,
197     Main_DirectDraw_CreatePalette,
198     Main_DirectDraw_CreateSurface4,             /* (CreateSurface4 testing / devloping) */
199     Main_DirectDraw_DuplicateSurface,
200     Main_DirectDraw_EnumDisplayModes4,           /* (EnumDisplayModes testing / devloping) */
201     Main_DirectDraw_EnumSurfaces7,
202     Main_DirectDraw_FlipToGDISurface,
203     Main_DirectDraw_GetCaps,                    /* (GetCaps done) */
204     Main_DirectDraw_GetDisplayMode4,             /* (GetDisplayMode testing / devloping) */
205     Main_DirectDraw_GetFourCCCodes,             /* (GetFourCCCodes done) */
206     Main_DirectDraw_GetGDISurface,
207     Main_DirectDraw_GetMonitorFrequency,        /* (GetMonitorFrequency done) */
208     Main_DirectDraw_GetScanLine,
209     Main_DirectDraw_GetVerticalBlankStatus,
210     Main_DirectDraw_Initialize,                 /* (Initialize done) */
211     Main_DirectDraw_RestoreDisplayMode,         /* (RestoreDisplayMode testing / devloping) */
212     Main_DirectDraw_SetCooperativeLevel,        /* (SetCooperativeLevel testing / devloping) */
213     Main_DirectDraw_SetDisplayMode2,             /* (SetDisplayMode testing / devloping) */
214     Main_DirectDraw_WaitForVerticalBlank,
215     Main_DirectDraw_GetAvailableVidMem4,        /* (GetAvailableVidMem4 done) */
216     Main_DirectDraw_GetSurfaceFromDC,
217     Main_DirectDraw_RestoreAllSurfaces,
218     Main_DirectDraw_TestCooperativeLevel,
219     Main_DirectDraw_GetDeviceIdentifier7,       /* (GetDeviceIdentifier done) */
220     Main_DirectDraw_StartModeTest,
221     Main_DirectDraw_EvaluateMode
222 };
223 
224 
225 
226