* Sync up to trunk r55544.
[reactos.git] / dll / directx / ddraw / cleanup.c
1 /* $Id: main.c 21434 2006-04-01 19:12:56Z greatlrd $
2 *
3 * COPYRIGHT: See COPYING in the top level directory
4 * PROJECT: ReactOS kernel
5 * FILE: lib/ddraw/ddraw.c
6 * PURPOSE: DirectDraw Library
7 * PROGRAMMER: Magnus Olsen (greatlrd)
8 *
9 */
10
11 #include <windows.h>
12 #include "rosdraw.h"
13 #include "d3dhal.h"
14
15 VOID
16 Cleanup(LPDDRAWI_DIRECTDRAW_INT This)
17 {
18 DX_WINDBG_trace();
19
20 if (ddgbl.lpDDCBtmp != NULL)
21 {
22 DxHeapMemFree(ddgbl.lpDDCBtmp);
23 }
24
25 if (ddgbl.lpdwFourCC != NULL)
26 {
27 DxHeapMemFree(ddgbl.lpdwFourCC);
28 }
29
30 if (ddgbl.lpModeInfo != NULL)
31 {
32 DxHeapMemFree(ddgbl.lpModeInfo);
33 }
34
35 DdDeleteDirectDrawObject(&ddgbl);
36
37 /*
38 anything else to release?
39 */
40
41 /* release the linked interface */
42 //while (IsBadWritePtr( This->lpVtbl, sizeof( LPDDRAWI_DIRECTDRAW_INT )) )
43 //{
44 // LPDDRAWI_DIRECTDRAW_INT newThis = This->lpVtbl;
45 // if (This->lpLcl != NULL)
46 // {
47 // DeleteDC(This->lpLcl->hDC);
48 // DxHeapMemFree(This->lpLcl);
49 // }
50
51 // DxHeapMemFree(This);
52 // This = newThis;
53 //}
54
55 /* release unlinked interface */
56 if (This->lpLcl != NULL)
57 {
58 DxHeapMemFree(This->lpLcl);
59 }
60 //if (This != NULL)
61 //{
62 // DxHeapMemFree(This);
63 //}
64
65 }
66