2013-03-16 20:25:38 +00:00
|
|
|
/*
|
2006-11-08 11:47:44 +00:00
|
|
|
* COPYRIGHT: See COPYING in the top level directory
|
|
|
|
* PROJECT: ReactOS kernel
|
2015-09-27 14:00:29 +00:00
|
|
|
* FILE: dll/directx/ddraw/cleanup.c
|
2007-10-19 23:21:45 +00:00
|
|
|
* PURPOSE: DirectDraw Library
|
2006-11-08 11:47:44 +00:00
|
|
|
* PROGRAMMER: Magnus Olsen (greatlrd)
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <windows.h>
|
|
|
|
#include "rosdraw.h"
|
|
|
|
#include "d3dhal.h"
|
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
VOID
|
|
|
|
Cleanup(LPDDRAWI_DIRECTDRAW_INT This)
|
2006-11-08 11:47:44 +00:00
|
|
|
{
|
2006-12-14 10:53:35 +00:00
|
|
|
DX_WINDBG_trace();
|
|
|
|
|
2006-12-14 09:20:00 +00:00
|
|
|
if (ddgbl.lpDDCBtmp != NULL)
|
|
|
|
{
|
|
|
|
DxHeapMemFree(ddgbl.lpDDCBtmp);
|
|
|
|
}
|
|
|
|
|
2007-06-07 02:23:54 +00:00
|
|
|
if (ddgbl.lpdwFourCC != NULL)
|
|
|
|
{
|
|
|
|
DxHeapMemFree(ddgbl.lpdwFourCC);
|
|
|
|
}
|
|
|
|
|
2006-12-14 09:20:00 +00:00
|
|
|
if (ddgbl.lpModeInfo != NULL)
|
|
|
|
{
|
|
|
|
DxHeapMemFree(ddgbl.lpModeInfo);
|
|
|
|
}
|
|
|
|
|
2006-12-14 09:35:19 +00:00
|
|
|
DdDeleteDirectDrawObject(&ddgbl);
|
|
|
|
|
2007-10-19 23:21:45 +00:00
|
|
|
/*
|
2008-02-10 20:45:56 +00:00
|
|
|
anything else to release?
|
2006-12-14 09:20:00 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
/* release the linked interface */
|
2006-12-14 21:11:00 +00:00
|
|
|
//while (IsBadWritePtr( This->lpVtbl, sizeof( LPDDRAWI_DIRECTDRAW_INT )) )
|
|
|
|
//{
|
|
|
|
// LPDDRAWI_DIRECTDRAW_INT newThis = This->lpVtbl;
|
|
|
|
// if (This->lpLcl != NULL)
|
|
|
|
// {
|
|
|
|
// DeleteDC(This->lpLcl->hDC);
|
|
|
|
// DxHeapMemFree(This->lpLcl);
|
|
|
|
// }
|
2006-12-14 10:53:35 +00:00
|
|
|
|
2006-12-14 21:11:00 +00:00
|
|
|
// DxHeapMemFree(This);
|
|
|
|
// This = newThis;
|
|
|
|
//}
|
2006-12-14 09:20:00 +00:00
|
|
|
|
|
|
|
/* release unlinked interface */
|
2007-06-07 02:23:54 +00:00
|
|
|
if (This->lpLcl != NULL)
|
|
|
|
{
|
|
|
|
DxHeapMemFree(This->lpLcl);
|
|
|
|
}
|
2006-12-15 23:54:42 +00:00
|
|
|
//if (This != NULL)
|
|
|
|
//{
|
|
|
|
// DxHeapMemFree(This);
|
|
|
|
//}
|
2006-11-19 19:13:35 +00:00
|
|
|
|
2006-12-13 21:28:52 +00:00
|
|
|
}
|
2006-11-19 19:13:35 +00:00
|
|
|
|