xref: /reactos/dll/directx/ddraw/thunks/ddraw_thunk.c (revision c2c66aff)
1 
2 
3 #include "../rosdraw.h"
4 
5 
6 
7 HRESULT WINAPI
ThunkDirectDraw_QueryInterface(LPDIRECTDRAW iface,REFIID iid,LPVOID * ppObj)8 ThunkDirectDraw_QueryInterface(LPDIRECTDRAW iface, REFIID iid, LPVOID *ppObj)
9 {
10 	DX_WINDBG_trace();
11 
12     return Main_DirectDraw_QueryInterface ((LPDIRECTDRAW7) iface, iid, ppObj);
13 }
14 
15 HRESULT WINAPI
ThunkDirectDraw2_QueryInterface(LPDIRECTDRAW2 iface,REFIID iid,LPVOID * obj)16 ThunkDirectDraw2_QueryInterface(LPDIRECTDRAW2 iface, REFIID iid, LPVOID *obj)
17 {
18 	DX_WINDBG_trace();
19 
20 	return Main_DirectDraw_QueryInterface ((LPDIRECTDRAW7) iface, iid, obj);
21 }
22 
23 
24 HRESULT WINAPI
ThunkDirectDraw4_QueryInterface(LPDIRECTDRAW4 iface,REFIID iid,LPVOID * ppObj)25 ThunkDirectDraw4_QueryInterface(LPDIRECTDRAW4 iface, REFIID iid, LPVOID *ppObj)
26 {
27 	DX_WINDBG_trace();
28 
29     return Main_DirectDraw_QueryInterface ((LPDIRECTDRAW7) iface, iid, ppObj);
30 }
31 
32 ULONG WINAPI
ThunkDirectDraw_AddRef(LPDIRECTDRAW iface)33 ThunkDirectDraw_AddRef(LPDIRECTDRAW iface)
34 {
35 	DX_WINDBG_trace();
36 
37     return Main_DirectDraw_AddRef((LPDIRECTDRAW7) iface);
38 }
39 
40 ULONG WINAPI
ThunkDirectDraw2_AddRef(LPDIRECTDRAW2 iface)41 ThunkDirectDraw2_AddRef(LPDIRECTDRAW2 iface)
42 {
43 	DX_WINDBG_trace();
44 
45     return Main_DirectDraw_AddRef((LPDIRECTDRAW7) iface);
46 }
47 
48 ULONG WINAPI
ThunkDirectDraw4_AddRef(LPDIRECTDRAW4 iface)49 ThunkDirectDraw4_AddRef(LPDIRECTDRAW4 iface)
50 {
51 	DX_WINDBG_trace();
52 
53     return Main_DirectDraw_AddRef((LPDIRECTDRAW7) iface);
54 }
55 
56 ULONG WINAPI
ThunkDirectDraw_Release(LPDIRECTDRAW iface)57 ThunkDirectDraw_Release(LPDIRECTDRAW iface)
58 {
59 	DX_WINDBG_trace();
60 
61 	return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface);
62 }
63 
64 ULONG WINAPI
ThunkDirectDraw2_Release(LPDIRECTDRAW2 iface)65 ThunkDirectDraw2_Release(LPDIRECTDRAW2 iface)
66 {
67 	DX_WINDBG_trace();
68 
69     return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface);
70 }
71 
72 ULONG WINAPI
ThunkDirectDraw4_Release(LPDIRECTDRAW4 iface)73 ThunkDirectDraw4_Release(LPDIRECTDRAW4 iface)
74 {
75 	DX_WINDBG_trace();
76 
77     return Main_DirectDraw_Release ((LPDIRECTDRAW7) iface);
78 }
79 
80 HRESULT WINAPI
ThunkDirectDraw_Compact(LPDIRECTDRAW iface)81 ThunkDirectDraw_Compact(LPDIRECTDRAW iface)
82 {
83 	DX_WINDBG_trace();
84 
85     return Main_DirectDraw_Compact((LPDIRECTDRAW7) iface) ;
86 }
87 
88 HRESULT WINAPI
ThunkDirectDraw2_Compact(LPDIRECTDRAW2 iface)89 ThunkDirectDraw2_Compact(LPDIRECTDRAW2 iface)
90 {
91     DX_WINDBG_trace();
92 
93     return Main_DirectDraw_Compact((LPDIRECTDRAW7) iface) ;
94 }
95 
96 HRESULT WINAPI
ThunkDirectDraw4_Compact(LPDIRECTDRAW4 iface)97 ThunkDirectDraw4_Compact(LPDIRECTDRAW4 iface)
98 {
99 	DX_WINDBG_trace();
100 
101     return Main_DirectDraw_Compact((LPDIRECTDRAW7) iface) ;
102 }
103 
104 HRESULT WINAPI
ThunkDirectDraw_CreateClipper(LPDIRECTDRAW iface,DWORD dwFlags,LPDIRECTDRAWCLIPPER * ppClipper,IUnknown * pUnkOuter)105 ThunkDirectDraw_CreateClipper(LPDIRECTDRAW iface,DWORD dwFlags,LPDIRECTDRAWCLIPPER *ppClipper,IUnknown *pUnkOuter)
106 {
107 	DX_WINDBG_trace();
108 
109 	return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter);
110 }
111 
112 HRESULT WINAPI
ThunkDirectDraw2_CreateClipper(LPDIRECTDRAW2 iface,DWORD dwFlags,LPDIRECTDRAWCLIPPER * ppClipper,IUnknown * pUnkOuter)113 ThunkDirectDraw2_CreateClipper(LPDIRECTDRAW2 iface,DWORD dwFlags,LPDIRECTDRAWCLIPPER *ppClipper,IUnknown *pUnkOuter)
114 {
115     DX_WINDBG_trace();
116 
117 	return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter);
118 }
119 
120 HRESULT WINAPI
ThunkDirectDraw4_CreateClipper(LPDIRECTDRAW4 iface,DWORD dwFlags,LPDIRECTDRAWCLIPPER * ppClipper,IUnknown * pUnkOuter)121 ThunkDirectDraw4_CreateClipper(LPDIRECTDRAW4 iface,DWORD dwFlags,LPDIRECTDRAWCLIPPER *ppClipper,IUnknown *pUnkOuter)
122 {
123    DX_WINDBG_trace();
124 
125    return Main_DirectDraw_CreateClipper( (LPDIRECTDRAW7) iface, dwFlags, ppClipper, pUnkOuter);
126 }
127 
128 HRESULT WINAPI
ThunkDirectDraw_CreatePalette(LPDIRECTDRAW iface,DWORD dwFlags,LPPALETTEENTRY pEntries,LPDIRECTDRAWPALETTE * ppPalette,IUnknown * pUnkOuter)129 ThunkDirectDraw_CreatePalette(LPDIRECTDRAW iface, DWORD dwFlags,
130 			      LPPALETTEENTRY pEntries,
131 			      LPDIRECTDRAWPALETTE *ppPalette,
132 			      IUnknown *pUnkOuter)
133 {
134     DX_WINDBG_trace();
135 
136 	return Main_DirectDraw_CreatePalette( (LPDIRECTDRAW7) iface,  dwFlags, pEntries,  ppPalette, pUnkOuter);
137 }
138 
139 HRESULT WINAPI
ThunkDirectDraw2_CreatePalette(LPDIRECTDRAW2 iface,DWORD dwFlags,LPPALETTEENTRY pEntries,LPDIRECTDRAWPALETTE * ppPalette,IUnknown * pUnkOuter)140 ThunkDirectDraw2_CreatePalette(LPDIRECTDRAW2 iface, DWORD dwFlags,
141 			       LPPALETTEENTRY pEntries,
142 			       LPDIRECTDRAWPALETTE *ppPalette,
143 			       IUnknown *pUnkOuter)
144 {
145     DX_WINDBG_trace();
146 
147 	return Main_DirectDraw_CreatePalette( (LPDIRECTDRAW7) iface,  dwFlags, pEntries,  ppPalette, pUnkOuter);
148 }
149 
150 HRESULT WINAPI
ThunkDirectDraw4_CreatePalette(LPDIRECTDRAW4 iface,DWORD dwFlags,LPPALETTEENTRY pEntries,LPDIRECTDRAWPALETTE * ppPalette,IUnknown * pUnkOuter)151 ThunkDirectDraw4_CreatePalette(LPDIRECTDRAW4 iface, DWORD dwFlags, LPPALETTEENTRY pEntries,
152 							   LPDIRECTDRAWPALETTE *ppPalette, IUnknown *pUnkOuter)
153 {
154     DX_WINDBG_trace();
155 
156 	return Main_DirectDraw_CreatePalette( (LPDIRECTDRAW7) iface,  dwFlags, pEntries,  ppPalette, pUnkOuter);
157 }
158 
159 HRESULT WINAPI
ThunkDirectDraw_CreateSurface(LPDIRECTDRAW iface,LPDDSURFACEDESC pDDSD,LPDIRECTDRAWSURFACE * ppSurf,IUnknown * pUnkOuter)160 ThunkDirectDraw_CreateSurface(LPDIRECTDRAW iface, LPDDSURFACEDESC pDDSD,
161 			      LPDIRECTDRAWSURFACE *ppSurf,
162 			      IUnknown *pUnkOuter)
163 {
164 	HRESULT retValue = DDERR_GENERIC;
165 	LPDDRAWI_DDRAWSURFACE_INT That;
166 
167 	DX_WINDBG_trace();
168 
169 	if (pDDSD != NULL)
170 	{
171 	   DDSURFACEDESC2 pDDSD2;
172 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
173 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
174 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
175 	   retValue =  Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, &pDDSD2,
176 		                                          (LPDIRECTDRAWSURFACE7 *) ppSurf, pUnkOuter);
177        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
178 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
179 	}
180 	else
181 	{
182 		retValue =  Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, NULL,
183 			                                       (LPDIRECTDRAWSURFACE7 *) ppSurf, pUnkOuter);
184 	}
185 
186 	That  = (LPDDRAWI_DDRAWSURFACE_INT) *ppSurf;
187 	That->lpVtbl = &DirectDrawSurface3_VTable;
188 
189     return retValue;
190 }
191 
192 HRESULT WINAPI
ThunkDirectDraw2_CreateSurface(LPDIRECTDRAW2 iface,LPDDSURFACEDESC pDDSD,LPDIRECTDRAWSURFACE * ppSurface,IUnknown * pUnkOuter)193 ThunkDirectDraw2_CreateSurface(LPDIRECTDRAW2 iface, LPDDSURFACEDESC pDDSD,
194 			                   LPDIRECTDRAWSURFACE *ppSurface, IUnknown *pUnkOuter)
195 {
196     HRESULT retValue = DDERR_GENERIC;
197 	LPDDRAWI_DDRAWSURFACE_INT That;
198 
199 	DX_WINDBG_trace();
200 
201 	if (pDDSD != NULL)
202 	{
203 	   DDSURFACEDESC2 pDDSD2;
204 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
205 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
206 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
207 	   retValue =  Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, &pDDSD2,
208 		                                          (LPDIRECTDRAWSURFACE7 *) ppSurface, pUnkOuter);
209        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
210 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
211 	}
212 	else
213 	{
214 		retValue =  Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, NULL,
215 			                                       (LPDIRECTDRAWSURFACE7 *) ppSurface, pUnkOuter);
216 	}
217 
218 	That  = (LPDDRAWI_DDRAWSURFACE_INT) *ppSurface;
219 	That->lpVtbl = &DirectDrawSurface3_VTable;
220 
221     return retValue;
222 }
223 
224 HRESULT WINAPI
ThunkDirectDraw4_CreateSurface(LPDIRECTDRAW4 iface,LPDDSURFACEDESC2 pDDSD2,LPDIRECTDRAWSURFACE4 * ppSurface,IUnknown * pUnkOuter)225 ThunkDirectDraw4_CreateSurface(LPDIRECTDRAW4 iface, LPDDSURFACEDESC2 pDDSD2,
226 			                   LPDIRECTDRAWSURFACE4 *ppSurface, IUnknown *pUnkOuter)
227 {
228 	HRESULT retValue;
229 	LPDDRAWI_DDRAWSURFACE_INT That;
230 
231 	DX_WINDBG_trace();
232 
233 
234 	retValue = Main_DirectDraw_CreateSurface ((LPDIRECTDRAW7) iface, pDDSD2,
235 		                                   (LPDIRECTDRAWSURFACE7 *) ppSurface, pUnkOuter);
236 
237 	That  = (LPDDRAWI_DDRAWSURFACE_INT) *ppSurface;
238 	That->lpVtbl = &DirectDrawSurface3_VTable;
239 
240 	return retValue;
241 }
242 
243 HRESULT WINAPI
ThunkDirectDraw_DuplicateSurface(LPDIRECTDRAW iface,LPDIRECTDRAWSURFACE src,LPDIRECTDRAWSURFACE * dst)244 ThunkDirectDraw_DuplicateSurface(LPDIRECTDRAW iface, LPDIRECTDRAWSURFACE src, LPDIRECTDRAWSURFACE *dst)
245 {
246 	DX_WINDBG_trace();
247 
248     return  Main_DirectDraw_DuplicateSurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7) src,
249                                              (LPDIRECTDRAWSURFACE7*) dst);
250 }
251 
252 HRESULT WINAPI
ThunkDirectDraw2_DuplicateSurface(LPDIRECTDRAW2 iface,LPDIRECTDRAWSURFACE src,LPDIRECTDRAWSURFACE * dst)253 ThunkDirectDraw2_DuplicateSurface(LPDIRECTDRAW2 iface, LPDIRECTDRAWSURFACE src, LPDIRECTDRAWSURFACE *dst)
254 {
255     DX_WINDBG_trace();
256 
257     return  Main_DirectDraw_DuplicateSurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7) src,
258                                              (LPDIRECTDRAWSURFACE7*) dst);
259 }
260 
261 HRESULT WINAPI
ThunkDirectDraw4_DuplicateSurface(LPDIRECTDRAW4 iface,LPDIRECTDRAWSURFACE4 src,LPDIRECTDRAWSURFACE4 * dst)262 ThunkDirectDraw4_DuplicateSurface(LPDIRECTDRAW4 iface, LPDIRECTDRAWSURFACE4 src, LPDIRECTDRAWSURFACE4 *dst)
263 {
264     DX_WINDBG_trace();
265 
266     return  Main_DirectDraw_DuplicateSurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7) src,
267                                              (LPDIRECTDRAWSURFACE7*) dst);
268 }
269 
270 HRESULT WINAPI
ThunkDirectDraw_EnumDisplayModes(LPDIRECTDRAW iface,DWORD dwFlags,LPDDSURFACEDESC pDDSD,LPVOID context,LPDDENUMMODESCALLBACK cb)271 ThunkDirectDraw_EnumDisplayModes(LPDIRECTDRAW iface, DWORD dwFlags,
272 				 LPDDSURFACEDESC pDDSD, LPVOID context,
273 				 LPDDENUMMODESCALLBACK cb)
274 {
275     HRESULT retValue = DDERR_GENERIC;
276 
277 	DX_WINDBG_trace();
278 
279 	if (pDDSD != NULL)
280 	{
281 	   DDSURFACEDESC2 pDDSD2;
282 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
283 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
284 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
285 	   retValue =  Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2,
286 		                                             context, (LPDDENUMMODESCALLBACK2)cb);
287        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
288 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
289 	}
290 	else
291 	{
292 		retValue =   Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, NULL,
293 			                                           context, (LPDDENUMMODESCALLBACK2)cb);
294 	}
295 
296     return retValue;
297 }
298 
299 HRESULT WINAPI
ThunkDirectDraw2_EnumDisplayModes(LPDIRECTDRAW2 iface,DWORD dwFlags,LPDDSURFACEDESC pDDSD,LPVOID context,LPDDENUMMODESCALLBACK cb)300 ThunkDirectDraw2_EnumDisplayModes(LPDIRECTDRAW2 iface, DWORD dwFlags,
301 				  LPDDSURFACEDESC pDDSD, LPVOID context,
302 				  LPDDENUMMODESCALLBACK cb)
303 {
304     HRESULT retValue = DDERR_GENERIC;
305 
306 	DX_WINDBG_trace();
307 
308 	if (pDDSD != NULL)
309 	{
310 	   DDSURFACEDESC2 pDDSD2;
311 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
312 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
313 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
314 	   retValue =  Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2,
315 		                                             context, (LPDDENUMMODESCALLBACK2)cb);
316        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
317 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
318 	}
319 	else
320 	{
321 		retValue =   Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, NULL,
322 			                                           context, (LPDDENUMMODESCALLBACK2)cb);
323 	}
324 
325     return retValue;
326 }
327 
328 HRESULT WINAPI
ThunkDirectDraw4_EnumDisplayModes(LPDIRECTDRAW4 iface,DWORD dwFlags,LPDDSURFACEDESC2 pDDSD,LPVOID context,LPDDENUMMODESCALLBACK2 cb)329 ThunkDirectDraw4_EnumDisplayModes(LPDIRECTDRAW4 iface, DWORD dwFlags,
330 				  LPDDSURFACEDESC2 pDDSD, LPVOID context,
331 				  LPDDENUMMODESCALLBACK2 cb)
332 {
333    DX_WINDBG_trace();
334 
335    return Main_DirectDraw_EnumDisplayModes((LPDIRECTDRAW7) iface, dwFlags, pDDSD, context, cb);
336 }
337 
338 
339 
340 
341 
342 HRESULT WINAPI
ThunkDirectDraw_EnumSurfaces(LPDIRECTDRAW iface,DWORD dwFlags,LPDDSURFACEDESC pDDSD,LPVOID context,LPDDENUMSURFACESCALLBACK cb)343 ThunkDirectDraw_EnumSurfaces(LPDIRECTDRAW iface, DWORD dwFlags,
344 			     LPDDSURFACEDESC pDDSD, LPVOID context,
345 			     LPDDENUMSURFACESCALLBACK cb)
346 {
347     HRESULT retValue = DDERR_GENERIC;
348 
349 	DX_WINDBG_trace();
350 
351 	if (pDDSD != NULL)
352 	{
353 	   DDSURFACEDESC2 pDDSD2;
354 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
355 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
356 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
357 	   retValue =  Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2,
358 		                                         context, (LPDDENUMSURFACESCALLBACK7)cb);
359        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
360 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
361 	}
362 	else
363 	{
364 		retValue =   Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, NULL,
365 			                                       context, (LPDDENUMSURFACESCALLBACK7)cb);
366 	}
367 
368     return retValue;
369 }
370 
371 HRESULT WINAPI
ThunkDirectDraw2_EnumSurfaces(LPDIRECTDRAW2 iface,DWORD dwFlags,LPDDSURFACEDESC pDDSD,LPVOID context,LPDDENUMSURFACESCALLBACK cb)372 ThunkDirectDraw2_EnumSurfaces(LPDIRECTDRAW2 iface, DWORD dwFlags,
373 			      LPDDSURFACEDESC pDDSD, LPVOID context,
374 			      LPDDENUMSURFACESCALLBACK cb)
375 {
376     HRESULT retValue = DDERR_GENERIC;
377 
378 	DX_WINDBG_trace();
379 
380 	if (pDDSD != NULL)
381 	{
382 	   DDSURFACEDESC2 pDDSD2;
383 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
384 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
385 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
386 	   retValue =  Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, &pDDSD2,
387 		                                         context, (LPDDENUMSURFACESCALLBACK7)cb);
388        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
389 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
390 	}
391 	else
392 	{
393 		retValue =   Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, NULL,
394 			                                       context, (LPDDENUMSURFACESCALLBACK7)cb);
395 	}
396 
397     return retValue;
398 }
399 
400 HRESULT WINAPI
ThunkDirectDraw4_EnumSurfaces(LPDIRECTDRAW4 iface,DWORD dwFlags,LPDDSURFACEDESC2 pDDSD,LPVOID context,LPDDENUMSURFACESCALLBACK2 cb)401 ThunkDirectDraw4_EnumSurfaces(LPDIRECTDRAW4 iface, DWORD dwFlags,
402 			      LPDDSURFACEDESC2 pDDSD, LPVOID context,
403 			      LPDDENUMSURFACESCALLBACK2 cb)
404 {
405 	DX_WINDBG_trace();
406 
407     return Main_DirectDraw_EnumSurfaces((LPDIRECTDRAW7) iface, dwFlags, pDDSD, context, (LPDDENUMSURFACESCALLBACK7)cb);
408 }
409 
410 
411 
412 HRESULT WINAPI
ThunkDirectDraw_FlipToGDISurface(LPDIRECTDRAW iface)413 ThunkDirectDraw_FlipToGDISurface(LPDIRECTDRAW iface)
414 {
415 	DX_WINDBG_trace();
416 
417     return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface);
418 }
419 
420 HRESULT WINAPI
ThunkDirectDraw2_FlipToGDISurface(LPDIRECTDRAW2 iface)421 ThunkDirectDraw2_FlipToGDISurface(LPDIRECTDRAW2 iface)
422 {
423    DX_WINDBG_trace();
424 
425    return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface);
426 }
427 
428 HRESULT WINAPI
ThunkDirectDraw4_FlipToGDISurface(LPDIRECTDRAW4 iface)429 ThunkDirectDraw4_FlipToGDISurface(LPDIRECTDRAW4 iface)
430 {
431 	DX_WINDBG_trace();
432 
433     return Main_DirectDraw_FlipToGDISurface((LPDIRECTDRAW7) iface);
434 }
435 
436 HRESULT WINAPI
ThunkDirectDraw_GetCaps(LPDIRECTDRAW iface,LPDDCAPS pDDC1,LPDDCAPS pDDC2)437 ThunkDirectDraw_GetCaps(LPDIRECTDRAW iface, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
438 {
439 	DX_WINDBG_trace();
440 
441     return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2);
442 }
443 
444 HRESULT WINAPI
ThunkDirectDraw2_GetCaps(LPDIRECTDRAW2 iface,LPDDCAPS pDDC1,LPDDCAPS pDDC2)445 ThunkDirectDraw2_GetCaps(LPDIRECTDRAW2 iface, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
446 {
447 	DX_WINDBG_trace();
448 
449     return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2);
450 }
451 
452 HRESULT WINAPI
ThunkDirectDraw4_GetCaps(LPDIRECTDRAW4 iface,LPDDCAPS pDDC1,LPDDCAPS pDDC2)453 ThunkDirectDraw4_GetCaps(LPDIRECTDRAW4 iface, LPDDCAPS pDDC1, LPDDCAPS pDDC2)
454 {
455    DX_WINDBG_trace();
456 
457    return Main_DirectDraw_GetCaps((LPDIRECTDRAW7) iface, pDDC1, pDDC2);
458 }
459 
460 HRESULT WINAPI
ThunkDirectDraw_GetDisplayMode(LPDIRECTDRAW iface,LPDDSURFACEDESC pDDSD)461 ThunkDirectDraw_GetDisplayMode(LPDIRECTDRAW iface, LPDDSURFACEDESC pDDSD)
462 {
463 
464 	HRESULT retValue = DDERR_GENERIC;
465 
466 	DX_WINDBG_trace();
467 
468 	if (pDDSD != NULL)
469 	{
470 	   DDSURFACEDESC2 pDDSD2;
471 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
472 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
473 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
474 	   retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, &pDDSD2);
475        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
476 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
477 	}
478 	else
479 	{
480 		retValue =   Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, NULL);
481 	}
482 
483     return retValue;
484 }
485 
486 HRESULT WINAPI
ThunkDirectDraw2_GetDisplayMode(LPDIRECTDRAW2 iface,LPDDSURFACEDESC pDDSD)487 ThunkDirectDraw2_GetDisplayMode(LPDIRECTDRAW2 iface, LPDDSURFACEDESC pDDSD)
488 {
489     HRESULT retValue = DDERR_GENERIC;
490 
491 	DX_WINDBG_trace();
492 
493 	if (pDDSD != NULL)
494 	{
495 	   DDSURFACEDESC2 pDDSD2;
496 	   ZeroMemory(&pDDSD2,sizeof(DDSURFACEDESC2));
497 	   memcpy(&pDDSD2, pDDSD, sizeof(DDSURFACEDESC));
498 	   pDDSD2.dwSize = sizeof(DDSURFACEDESC2);
499 	   retValue = Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, &pDDSD2);
500        memcpy(pDDSD, &pDDSD2, sizeof(DDSURFACEDESC));
501 	   pDDSD->dwSize = sizeof(DDSURFACEDESC);
502 	}
503 	else
504 	{
505 		retValue =   Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, NULL);
506 	}
507 
508     return retValue;
509 }
510 
511 HRESULT WINAPI
ThunkDirectDraw4_GetDisplayMode(LPDIRECTDRAW4 iface,LPDDSURFACEDESC2 pDDSD2)512 ThunkDirectDraw4_GetDisplayMode(LPDIRECTDRAW4 iface, LPDDSURFACEDESC2 pDDSD2)
513 {
514 	DX_WINDBG_trace();
515 
516     return  Main_DirectDraw_GetDisplayMode((LPDIRECTDRAW7) iface, pDDSD2);
517 }
518 
519 HRESULT WINAPI
ThunkDirectDraw_GetFourCCCodes(LPDIRECTDRAW iface,LPDWORD pNumCodes,LPDWORD pCodes)520 ThunkDirectDraw_GetFourCCCodes(LPDIRECTDRAW iface, LPDWORD pNumCodes,
521 			       LPDWORD pCodes)
522 {
523 	DX_WINDBG_trace();
524 
525     return Main_DirectDraw_GetFourCCCodes((LPDIRECTDRAW7) iface, pNumCodes, pCodes);
526 }
527 
528 HRESULT WINAPI
ThunkDirectDraw2_GetFourCCCodes(LPDIRECTDRAW2 iface,LPDWORD pNumCodes,LPDWORD pCodes)529 ThunkDirectDraw2_GetFourCCCodes(LPDIRECTDRAW2 iface, LPDWORD pNumCodes,
530 				LPDWORD pCodes)
531 {
532    DX_WINDBG_trace();
533 
534    return Main_DirectDraw_GetFourCCCodes((LPDIRECTDRAW7) iface, pNumCodes, pCodes);
535 }
536 
537 HRESULT WINAPI
ThunkDirectDraw4_GetFourCCCodes(LPDIRECTDRAW4 iface,LPDWORD pNumCodes,LPDWORD pCodes)538 ThunkDirectDraw4_GetFourCCCodes(LPDIRECTDRAW4 iface, LPDWORD pNumCodes,
539 				LPDWORD pCodes)
540 {
541 	DX_WINDBG_trace();
542 
543     return Main_DirectDraw_GetFourCCCodes((LPDIRECTDRAW7) iface, pNumCodes, pCodes);
544 }
545 
546 HRESULT WINAPI
ThunkDirectDraw_GetGDISurface(LPDIRECTDRAW iface,LPDIRECTDRAWSURFACE * lplpGDIDDSSurface)547 ThunkDirectDraw_GetGDISurface(LPDIRECTDRAW iface, LPDIRECTDRAWSURFACE *lplpGDIDDSSurface)
548 {
549    DX_WINDBG_trace();
550 
551    return Main_DirectDraw_GetGDISurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7 *) lplpGDIDDSSurface);
552 }
553 
554 HRESULT WINAPI
ThunkDirectDraw2_GetGDISurface(LPDIRECTDRAW2 iface,LPDIRECTDRAWSURFACE * lplpGDIDDSSurface)555 ThunkDirectDraw2_GetGDISurface(LPDIRECTDRAW2 iface, LPDIRECTDRAWSURFACE *lplpGDIDDSSurface)
556 {
557    DX_WINDBG_trace();
558 
559    return Main_DirectDraw_GetGDISurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7 *) lplpGDIDDSSurface);
560 }
561 
562 HRESULT WINAPI
ThunkDirectDraw4_GetGDISurface(LPDIRECTDRAW4 iface,LPDIRECTDRAWSURFACE4 * lplpGDIDDSSurface)563 ThunkDirectDraw4_GetGDISurface(LPDIRECTDRAW4 iface, LPDIRECTDRAWSURFACE4 *lplpGDIDDSSurface)
564 {
565    DX_WINDBG_trace();
566 
567    return Main_DirectDraw_GetGDISurface((LPDIRECTDRAW7) iface, (LPDIRECTDRAWSURFACE7 *) lplpGDIDDSSurface);
568 }
569 
570 HRESULT WINAPI
ThunkDirectDraw_GetMonitorFrequency(LPDIRECTDRAW iface,LPDWORD pdwFreq)571 ThunkDirectDraw_GetMonitorFrequency(LPDIRECTDRAW iface, LPDWORD pdwFreq)
572 {
573 	DX_WINDBG_trace();
574 
575     return Main_DirectDraw_GetMonitorFrequency((LPDIRECTDRAW7) iface, pdwFreq);
576 }
577 
578 HRESULT WINAPI
ThunkDirectDraw2_GetMonitorFrequency(LPDIRECTDRAW2 iface,LPDWORD pdwFreq)579 ThunkDirectDraw2_GetMonitorFrequency(LPDIRECTDRAW2 iface, LPDWORD pdwFreq)
580 {
581  	DX_WINDBG_trace();
582 
583     return Main_DirectDraw_GetMonitorFrequency((LPDIRECTDRAW7) iface, pdwFreq);
584 }
585 
586 HRESULT WINAPI
ThunkDirectDraw4_GetMonitorFrequency(LPDIRECTDRAW4 iface,LPDWORD pdwFreq)587 ThunkDirectDraw4_GetMonitorFrequency(LPDIRECTDRAW4 iface, LPDWORD pdwFreq)
588 {
589   	DX_WINDBG_trace();
590 
591     return Main_DirectDraw_GetMonitorFrequency((LPDIRECTDRAW7) iface, pdwFreq);
592 }
593 
594 HRESULT WINAPI
ThunkDirectDraw_GetScanLine(LPDIRECTDRAW iface,LPDWORD lpdwScanLine)595 ThunkDirectDraw_GetScanLine(LPDIRECTDRAW iface, LPDWORD lpdwScanLine)
596 {
597 	DX_WINDBG_trace();
598 
599     return Main_DirectDraw_GetScanLine((LPDIRECTDRAW7) iface, lpdwScanLine);
600 }
601 
602 HRESULT WINAPI
ThunkDirectDraw2_GetScanLine(LPDIRECTDRAW2 iface,LPDWORD lpdwScanLine)603 ThunkDirectDraw2_GetScanLine(LPDIRECTDRAW2 iface, LPDWORD lpdwScanLine)
604 {
605    DX_WINDBG_trace();
606 
607    return Main_DirectDraw_GetScanLine((LPDIRECTDRAW7) iface, lpdwScanLine);
608 }
609 
610 HRESULT WINAPI
ThunkDirectDraw4_GetScanLine(LPDIRECTDRAW4 iface,LPDWORD lpdwScanLine)611 ThunkDirectDraw4_GetScanLine(LPDIRECTDRAW4 iface, LPDWORD lpdwScanLine)
612 {
613 	DX_WINDBG_trace();
614 
615     return Main_DirectDraw_GetScanLine((LPDIRECTDRAW7) iface, lpdwScanLine);
616 }
617 
618 HRESULT WINAPI
ThunkDirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW iface,LPBOOL lpbIsInVB)619 ThunkDirectDraw_GetVerticalBlankStatus(LPDIRECTDRAW iface, LPBOOL lpbIsInVB)
620 {
621 	DX_WINDBG_trace();
622 
623     return Main_DirectDraw_GetVerticalBlankStatus((LPDIRECTDRAW7) iface, lpbIsInVB);
624 }
625 
626 HRESULT WINAPI
ThunkDirectDraw2_GetVerticalBlankStatus(LPDIRECTDRAW2 iface,LPBOOL lpbIsInVB)627 ThunkDirectDraw2_GetVerticalBlankStatus(LPDIRECTDRAW2 iface, LPBOOL lpbIsInVB)
628 {
629     DX_WINDBG_trace();
630 
631     return Main_DirectDraw_GetVerticalBlankStatus((LPDIRECTDRAW7) iface, lpbIsInVB);
632 }
633 
634 HRESULT WINAPI
ThunkDirectDraw4_GetVerticalBlankStatus(LPDIRECTDRAW4 iface,LPBOOL lpbIsInVB)635 ThunkDirectDraw4_GetVerticalBlankStatus(LPDIRECTDRAW4 iface, LPBOOL lpbIsInVB)
636 {
637     DX_WINDBG_trace();
638 
639     return Main_DirectDraw_GetVerticalBlankStatus((LPDIRECTDRAW7) iface, lpbIsInVB);
640 }
641 
642 HRESULT WINAPI
ThunkDirectDraw_Initialize(LPDIRECTDRAW iface,LPGUID pGUID)643 ThunkDirectDraw_Initialize(LPDIRECTDRAW iface, LPGUID pGUID)
644 {
645     DX_WINDBG_trace();
646 
647 	if (iface==NULL)
648 	{
649 		return DDERR_NOTINITIALIZED;
650 	}
651 
652     return DDERR_ALREADYINITIALIZED;
653 }
654 
655 HRESULT WINAPI
ThunkDirectDraw2_Initialize(LPDIRECTDRAW2 iface,LPGUID pGUID)656 ThunkDirectDraw2_Initialize(LPDIRECTDRAW2 iface, LPGUID pGUID)
657 {
658     DX_WINDBG_trace();
659 
660 	if (iface==NULL)
661 	{
662 		return DDERR_NOTINITIALIZED;
663 	}
664 
665     return DDERR_ALREADYINITIALIZED;
666 }
667 
668 HRESULT WINAPI
ThunkDirectDraw4_Initialize(LPDIRECTDRAW4 iface,LPGUID pGUID)669 ThunkDirectDraw4_Initialize(LPDIRECTDRAW4 iface, LPGUID pGUID)
670 {
671     DX_WINDBG_trace();
672 
673 	if (iface==NULL)
674 	{
675 		return DDERR_NOTINITIALIZED;
676 	}
677 
678     return DDERR_ALREADYINITIALIZED;
679 }
680 
681 
682 HRESULT WINAPI
ThunkDirectDraw_RestoreDisplayMode(LPDIRECTDRAW iface)683 ThunkDirectDraw_RestoreDisplayMode(LPDIRECTDRAW iface)
684 {
685 	DX_WINDBG_trace();
686 
687     return Main_DirectDraw_RestoreDisplayMode((LPDIRECTDRAW7) iface);
688 }
689 
690 HRESULT WINAPI
ThunkDirectDraw2_RestoreDisplayMode(LPDIRECTDRAW2 iface)691 ThunkDirectDraw2_RestoreDisplayMode(LPDIRECTDRAW2 iface)
692 {
693 	DX_WINDBG_trace();
694 
695     return Main_DirectDraw_RestoreDisplayMode((LPDIRECTDRAW7) iface);
696 }
697 
698 HRESULT WINAPI
ThunkDirectDraw4_RestoreDisplayMode(LPDIRECTDRAW4 iface)699 ThunkDirectDraw4_RestoreDisplayMode(LPDIRECTDRAW4 iface)
700 {
701  	DX_WINDBG_trace();
702 
703     return Main_DirectDraw_RestoreDisplayMode((LPDIRECTDRAW7) iface);
704 }
705 
706 HRESULT WINAPI
ThunkDirectDraw_SetCooperativeLevel(LPDIRECTDRAW iface,HWND hwnd,DWORD dwFlags)707 ThunkDirectDraw_SetCooperativeLevel(LPDIRECTDRAW iface, HWND hwnd, DWORD dwFlags)
708 {
709 	DX_WINDBG_trace();
710 
711     return Main_DirectDraw_SetCooperativeLevel ((LPDIRECTDRAW7) iface,  hwnd, dwFlags);
712 }
713 
714 HRESULT WINAPI
ThunkDirectDraw2_SetCooperativeLevel(LPDIRECTDRAW2 iface,HWND hwnd,DWORD dwFlags)715 ThunkDirectDraw2_SetCooperativeLevel(LPDIRECTDRAW2 iface, HWND hwnd, DWORD dwFlags)
716 {
717    	DX_WINDBG_trace();
718 
719     return Main_DirectDraw_SetCooperativeLevel ((LPDIRECTDRAW7) iface,  hwnd, dwFlags);
720 }
721 
722 HRESULT WINAPI
ThunkDirectDraw4_SetCooperativeLevel(LPDIRECTDRAW4 iface,HWND hwnd,DWORD dwFlags)723 ThunkDirectDraw4_SetCooperativeLevel(LPDIRECTDRAW4 iface, HWND hwnd, DWORD dwFlags)
724 {
725    	DX_WINDBG_trace();
726 
727     return Main_DirectDraw_SetCooperativeLevel ((LPDIRECTDRAW7) iface,  hwnd, dwFlags);
728 }
729 
730 HRESULT WINAPI
ThunkDirectDraw_SetDisplayMode(LPDIRECTDRAW iface,DWORD dwWidth,DWORD dwHeight,DWORD dwBPP)731 ThunkDirectDraw_SetDisplayMode(LPDIRECTDRAW iface, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP)
732 {
733 	DX_WINDBG_trace();
734 
735 	return Main_DirectDraw_SetDisplayMode ((LPDIRECTDRAW7) iface, dwWidth, dwHeight, dwBPP, 0, 0);
736 }
737 
738 HRESULT WINAPI
ThunkDirectDraw2_SetDisplayMode(LPDIRECTDRAW2 iface,DWORD dwWidth,DWORD dwHeight,DWORD dwBPP,DWORD d,DWORD e)739 ThunkDirectDraw2_SetDisplayMode(LPDIRECTDRAW2 iface, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD d, DWORD e)
740 {
741     DX_WINDBG_trace();
742 
743 	return Main_DirectDraw_SetDisplayMode ((LPDIRECTDRAW7) iface, dwWidth, dwHeight, dwBPP, 0, 0);
744 }
745 
746 HRESULT WINAPI
ThunkDirectDraw4_SetDisplayMode(LPDIRECTDRAW4 iface,DWORD dwWidth,DWORD dwHeight,DWORD dwBPP,DWORD d,DWORD e)747 ThunkDirectDraw4_SetDisplayMode(LPDIRECTDRAW4 iface, DWORD dwWidth, DWORD dwHeight, DWORD dwBPP, DWORD d, DWORD e)
748 {
749     DX_WINDBG_trace();
750 
751 	return Main_DirectDraw_SetDisplayMode ((LPDIRECTDRAW7) iface, dwWidth, dwHeight, dwBPP, 0, 0);
752 }
753 
754 HRESULT WINAPI
ThunkDirectDraw_WaitForVerticalBlank(LPDIRECTDRAW iface,DWORD dwFlags,HANDLE hEvent)755 ThunkDirectDraw_WaitForVerticalBlank(LPDIRECTDRAW iface, DWORD dwFlags, HANDLE hEvent)
756 {
757 	DX_WINDBG_trace();
758 
759     return Main_DirectDraw_WaitForVerticalBlank((LPDIRECTDRAW7) iface, dwFlags, hEvent);
760 }
761 
762 HRESULT WINAPI
ThunkDirectDraw2_WaitForVerticalBlank(LPDIRECTDRAW2 iface,DWORD dwFlags,HANDLE hEvent)763 ThunkDirectDraw2_WaitForVerticalBlank(LPDIRECTDRAW2 iface, DWORD dwFlags, HANDLE hEvent)
764 {
765     DX_WINDBG_trace();
766 
767     return Main_DirectDraw_WaitForVerticalBlank((LPDIRECTDRAW7) iface, dwFlags, hEvent);
768 }
769 
770 HRESULT WINAPI
ThunkDirectDraw4_WaitForVerticalBlank(LPDIRECTDRAW4 iface,DWORD dwFlags,HANDLE hEvent)771 ThunkDirectDraw4_WaitForVerticalBlank(LPDIRECTDRAW4 iface, DWORD dwFlags, HANDLE hEvent)
772 {
773     DX_WINDBG_trace();
774 
775     return Main_DirectDraw_WaitForVerticalBlank((LPDIRECTDRAW7) iface, dwFlags, hEvent);
776 }
777 
778 
779 
780 
781 
782 HRESULT WINAPI
ThunkDirectDraw4_GetSurfaceFromDC(LPDIRECTDRAW4 iface,HDC hdc,LPDIRECTDRAWSURFACE4 * pSurf)783 ThunkDirectDraw4_GetSurfaceFromDC(LPDIRECTDRAW4 iface, HDC hdc, LPDIRECTDRAWSURFACE4 *pSurf)
784 {
785 	DX_WINDBG_trace();
786 
787     return Main_DirectDraw_GetSurfaceFromDC((LPDIRECTDRAW7) iface,  hdc, (LPDIRECTDRAWSURFACE7 *) pSurf);
788 }
789 
790 HRESULT WINAPI
ThunkDirectDraw4_RestoreAllSurfaces(LPDIRECTDRAW4 iface)791 ThunkDirectDraw4_RestoreAllSurfaces(LPDIRECTDRAW4 iface)
792 {
793 	DX_WINDBG_trace();
794 
795     return Main_DirectDraw_RestoreAllSurfaces((LPDIRECTDRAW7) iface);
796 }
797 
798 HRESULT WINAPI
ThunkDirectDraw4_TestCooperativeLevel(LPDIRECTDRAW4 iface)799 ThunkDirectDraw4_TestCooperativeLevel(LPDIRECTDRAW4 iface)
800 {
801 	DX_WINDBG_trace();
802 
803     return Main_DirectDraw_TestCooperativeLevel((LPDIRECTDRAW7) iface);
804 }
805 
806 
807 
808 HRESULT WINAPI
ThunkDirectDraw4_GetDeviceIdentifier(LPDIRECTDRAW4 iface,LPDDDEVICEIDENTIFIER pDDDI,DWORD dwFlags)809 ThunkDirectDraw4_GetDeviceIdentifier(LPDIRECTDRAW4 iface,
810 				     LPDDDEVICEIDENTIFIER pDDDI, DWORD dwFlags)
811 {
812     HRESULT retValue = DDERR_GENERIC;
813 
814 	DX_WINDBG_trace();
815 
816 	if (pDDDI != NULL)
817 	{
818 
819 	   DDDEVICEIDENTIFIER2 pDDDI2;
820 	   ZeroMemory(&pDDDI2,sizeof(DDDEVICEIDENTIFIER2));
821 	   memcpy(&pDDDI2, pDDDI, sizeof(DDDEVICEIDENTIFIER));
822 	   retValue = Main_DirectDraw_GetDeviceIdentifier((LPDIRECTDRAW7) iface, &pDDDI2, dwFlags);
823        memcpy(pDDDI, &pDDDI2, sizeof(DDDEVICEIDENTIFIER));
824 	}
825 	else
826 	{
827 		retValue = Main_DirectDraw_GetDeviceIdentifier((LPDIRECTDRAW7) iface, NULL, dwFlags);
828 	}
829 
830     return retValue;
831 }
832 
833 
834 
835 IDirectDrawVtbl DirectDraw_Vtable =
836 {
837     ThunkDirectDraw_QueryInterface,
838     ThunkDirectDraw_AddRef,
839     ThunkDirectDraw_Release,
840     ThunkDirectDraw_Compact,
841     ThunkDirectDraw_CreateClipper,
842     ThunkDirectDraw_CreatePalette,
843     ThunkDirectDraw_CreateSurface,
844     ThunkDirectDraw_DuplicateSurface,
845     ThunkDirectDraw_EnumDisplayModes,
846     ThunkDirectDraw_EnumSurfaces,
847     ThunkDirectDraw_FlipToGDISurface,
848     ThunkDirectDraw_GetCaps,
849     ThunkDirectDraw_GetDisplayMode,
850     ThunkDirectDraw_GetFourCCCodes,
851     ThunkDirectDraw_GetGDISurface,
852     ThunkDirectDraw_GetMonitorFrequency,
853     ThunkDirectDraw_GetScanLine,
854     ThunkDirectDraw_GetVerticalBlankStatus,
855     ThunkDirectDraw_Initialize,
856     ThunkDirectDraw_RestoreDisplayMode,
857     ThunkDirectDraw_SetCooperativeLevel,
858     ThunkDirectDraw_SetDisplayMode,
859     ThunkDirectDraw_WaitForVerticalBlank,
860 };
861 
862 IDirectDraw2Vtbl DirectDraw2_Vtable =
863 {
864     ThunkDirectDraw2_QueryInterface,
865     ThunkDirectDraw2_AddRef,
866     ThunkDirectDraw2_Release,
867     ThunkDirectDraw2_Compact,
868     ThunkDirectDraw2_CreateClipper,
869     ThunkDirectDraw2_CreatePalette,
870     ThunkDirectDraw2_CreateSurface,
871     ThunkDirectDraw2_DuplicateSurface,
872     ThunkDirectDraw2_EnumDisplayModes,
873     ThunkDirectDraw2_EnumSurfaces,
874     ThunkDirectDraw2_FlipToGDISurface,
875     ThunkDirectDraw2_GetCaps,
876     ThunkDirectDraw2_GetDisplayMode,
877     ThunkDirectDraw2_GetFourCCCodes,
878     ThunkDirectDraw2_GetGDISurface,
879     ThunkDirectDraw2_GetMonitorFrequency,
880     ThunkDirectDraw2_GetScanLine,
881     ThunkDirectDraw2_GetVerticalBlankStatus,
882     ThunkDirectDraw2_Initialize,
883     ThunkDirectDraw2_RestoreDisplayMode,
884     ThunkDirectDraw2_SetCooperativeLevel,
885     ThunkDirectDraw2_SetDisplayMode,
886     ThunkDirectDraw2_WaitForVerticalBlank,
887     ThunkDirectDraw2_GetAvailableVidMem
888 };
889 
890 IDirectDraw4Vtbl DirectDraw4_Vtable =
891 {
892     ThunkDirectDraw4_QueryInterface,
893     ThunkDirectDraw4_AddRef,
894     ThunkDirectDraw4_Release,
895     ThunkDirectDraw4_Compact,
896     ThunkDirectDraw4_CreateClipper,
897     ThunkDirectDraw4_CreatePalette,
898     ThunkDirectDraw4_CreateSurface,
899     ThunkDirectDraw4_DuplicateSurface,
900     ThunkDirectDraw4_EnumDisplayModes,
901     ThunkDirectDraw4_EnumSurfaces,
902     ThunkDirectDraw4_FlipToGDISurface,
903     ThunkDirectDraw4_GetCaps,
904     ThunkDirectDraw4_GetDisplayMode,
905     ThunkDirectDraw4_GetFourCCCodes,
906     ThunkDirectDraw4_GetGDISurface,
907     ThunkDirectDraw4_GetMonitorFrequency,
908     ThunkDirectDraw4_GetScanLine,
909     ThunkDirectDraw4_GetVerticalBlankStatus,
910     ThunkDirectDraw4_Initialize,
911     ThunkDirectDraw4_RestoreDisplayMode,
912     ThunkDirectDraw4_SetCooperativeLevel,
913     ThunkDirectDraw4_SetDisplayMode,
914     ThunkDirectDraw4_WaitForVerticalBlank,
915     ThunkDirectDraw4_GetAvailableVidMem,
916     ThunkDirectDraw4_GetSurfaceFromDC,
917     ThunkDirectDraw4_RestoreAllSurfaces,
918     ThunkDirectDraw4_TestCooperativeLevel,
919     ThunkDirectDraw4_GetDeviceIdentifier
920 };
921