more cleanup,

1. fixed more tab to space
2. rewrite addref for some inteface. 

svn path=/trunk/; revision=25149
This commit is contained in:
Magnus Olsen 2006-12-13 21:48:35 +00:00
parent b7bb710426
commit 82d454c95b
8 changed files with 140 additions and 197 deletions

View file

@ -13,45 +13,35 @@
ULONG WINAPI
DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface)
{
{
LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedDecrement( (PLONG) &This->dwIntRefCnt);
if (ref == 0)
{
/* Add here if we need releae some memory pointer before
* exists
*/
if (This!=NULL)
{
HeapFree(GetProcessHeap(), 0, This);
}
}
}
return ref;
/* FIXME
This is not right exiame how it should be done
*/
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
return This->dwIntRefCnt;
}
ULONG WINAPI
DirectDrawClipper_AddRef (LPDIRECTDRAWCLIPPER iface)
{
LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface;
ULONG ref=0;
{
LPDDRAWI_DDRAWCLIPPER_INT This = (LPDDRAWI_DDRAWCLIPPER_INT)iface;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedIncrement( (PLONG) &This->dwIntRefCnt);
}
return ref;
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt++;
This->lpLcl->dwLocalRefCnt++;
if (This->lpLcl->lpGbl != NULL)
{
This->lpLcl->lpGbl->dwRefCnt++;
}
}
return This->dwIntRefCnt;
}
HRESULT WINAPI

View file

@ -13,48 +13,40 @@
ULONG WINAPI
DirectDrawColorControl_AddRef( LPDIRECTDRAWCOLORCONTROL iface)
{
LPDDRAWI_DDCOLORCONTROL_INT This = (LPDDRAWI_DDCOLORCONTROL_INT)iface;
ULONG ref=0;
LPDDRAWI_DDCOLORCONTROL_INT This = (LPDDRAWI_DDCOLORCONTROL_INT)iface;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedIncrement( (PLONG) &This->dwIntRefCnt);
}
return ref;
if (iface!=NULL)
{
This->dwIntRefCnt++;
// This->lpLcl->dwLocalRefCnt++;
//if (This->lpLcl->lpGbl != NULL)
//{
// This->lpLcl->lpGbl->dwRefCnt++;
//}
}
return This->dwIntRefCnt;
}
ULONG WINAPI
DirectDrawColorControl_Release( LPDIRECTDRAWCOLORCONTROL iface)
{
{
LPDDRAWI_DDCOLORCONTROL_INT This = (LPDDRAWI_DDCOLORCONTROL_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedDecrement( (PLONG) &This->dwIntRefCnt);
if (ref == 0)
{
/* Add here if we need releae some memory pointer before
* exists
*/
if (This!=NULL)
{
HeapFree(GetProcessHeap(), 0, This);
}
}
}
return ref;
DX_WINDBG_trace();
/* FIXME
This is not right exiame how it should be done
*/
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
return This->dwIntRefCnt;
}
HRESULT WINAPI
DirectDrawColorControl_QueryInterface( LPDIRECTDRAWCOLORCONTROL iface,
REFIID riid,
REFIID riid,
LPVOID* ppvObj)
{
DX_WINDBG_trace();

View file

@ -15,53 +15,41 @@ DirectDrawGammaControl_AddRef( LPDIRECTDRAWGAMMACONTROL iface)
{
LPDDRAWI_DDGAMMACONTROL_INT This = (LPDDRAWI_DDGAMMACONTROL_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt++;
ref = This->dwIntRefCnt;
}
return ref;
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt++;
//This->lpLcl->dwLocalRefCnt++;
//if (This->lpLcl->lpGbl != NULL)
//{
// This->lpLcl->lpGbl->dwRefCnt++;
//}
}
return This->dwIntRefCnt;
}
ULONG WINAPI
DirectDrawGammaControl_Release( LPDIRECTDRAWGAMMACONTROL iface)
{
LPDDRAWI_DDGAMMACONTROL_INT This = (LPDDRAWI_DDGAMMACONTROL_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt--;
if (This->dwIntRefCnt == 0)
{
/* Add here if we need releae some memory pointer before
* exists
*/
if (This!=NULL)
{
HeapFree(GetProcessHeap(), 0, This);
}
}
ref = This->dwIntRefCnt;
}
return ref;
DX_WINDBG_trace();
/* FIXME
This is not right exiame how it should be done
*/
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
return This->dwIntRefCnt;
}
HRESULT WINAPI
DirectDrawGammaControl_QueryInterface( LPDIRECTDRAWGAMMACONTROL iface,
REFIID riid,
LPVOID *ppObj)
LPVOID *ppObj)
{
DX_WINDBG_trace();
DX_STUB;
DX_STUB;
}
HRESULT WINAPI

View file

@ -89,44 +89,32 @@ DDSurfaceKernel_AddRef ( LPDIRECTDRAWSURFACEKERNEL iface)
{
LPDDRAWI_DDKERNELSURFACE_INT This = (LPDDRAWI_DDKERNELSURFACE_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt++;
ref = This->dwIntRefCnt;
}
return ref;
if (iface!=NULL)
{
This->dwIntRefCnt++;
//This->lpLcl->dwLocalRefCnt++;
//if (This->lpLcl->lpGbl != NULL)
//{
// This->lpLcl->lpGbl->dwRefCnt++;
//}
}
return This->dwIntRefCnt;
}
ULONG WINAPI
DDSurfaceKernel_Release ( LPDIRECTDRAWSURFACEKERNEL iface)
{
LPDDRAWI_DDKERNELSURFACE_INT This = (LPDDRAWI_DDKERNELSURFACE_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt--;
if (This->dwIntRefCnt == 0)
{
/* Add here if we need releae some memory pointer before
* exists
*/
if (This!=NULL)
{
HeapFree(GetProcessHeap(), 0, This);
}
}
ref = This->dwIntRefCnt;
}
return ref;
DX_WINDBG_trace();
/* FIXME
This is not right exiame how it should be done
*/
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
return This->dwIntRefCnt;
}
HRESULT WINAPI

View file

@ -14,42 +14,33 @@ ULONG WINAPI
DirectDrawPalette_Release( LPDIRECTDRAWPALETTE iface)
{
LPDDRAWI_DDRAWPALETTE_INT This = (LPDDRAWI_DDRAWPALETTE_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedDecrement( (PLONG) &This->dwIntRefCnt);
if (ref == 0)
{
/* Add here if we need releae some memory pointer before
* exists
*/
if (This!=NULL)
{
DxHeapMemFree(This);
}
}
}
return ref;
DX_WINDBG_trace();
/* FIXME
This is not right exiame how it should be done
*/
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
return This->dwIntRefCnt;
}
ULONG WINAPI
DirectDrawPalette_AddRef( LPDIRECTDRAWPALETTE iface)
{
LPDDRAWI_DDRAWPALETTE_INT This = (LPDDRAWI_DDRAWPALETTE_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedIncrement( (PLONG) &This->dwIntRefCnt);
}
return ref;
if (iface!=NULL)
{
This->dwIntRefCnt++;
This->lpLcl->dwLocalRefCnt++;
if (This->lpLcl->lpGbl != NULL)
{
This->lpLcl->lpGbl->dwRefCnt++;
}
}
return This->dwIntRefCnt;
}
HRESULT WINAPI

View file

@ -25,42 +25,33 @@ ULONG WINAPI
Main_DirectDrawVideoPort_AddRef (LPDIRECTDRAWVIDEOPORT iface)
{
LPDDRAWI_DDVIDEOPORT_INT This = (LPDDRAWI_DDVIDEOPORT_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedIncrement( (PLONG) &This->dwIntRefCnt);
}
return ref;
if (iface!=NULL)
{
This->dwIntRefCnt++;
//This->lpLcl->dwLocalRefCnt++;
//if (This->lpLcl->lpGbl != NULL)
//{
// This->lpLcl->lpGbl->dwRefCnt++;
//}
}
return This->dwIntRefCnt;
}
ULONG WINAPI
Main_DirectDrawVideoPort_Release (LPDIRECTDRAWVIDEOPORT iface)
{
LPDDRAWI_DDVIDEOPORT_INT This = (LPDDRAWI_DDVIDEOPORT_INT)iface;
ULONG ref=0;
DX_WINDBG_trace();
if (iface!=NULL)
{
ref = InterlockedDecrement( (PLONG) &This->dwIntRefCnt);
if (ref == 0)
{
/* Add here if we need releae some memory pointer before
* exists
*/
if (This!=NULL)
{
DxHeapMemFree(This);
}
}
}
return ref;
DX_WINDBG_trace();
/* FIXME
This is not right exiame how it should be done
*/
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
return This->dwIntRefCnt;
}
HRESULT WINAPI

View file

@ -22,37 +22,38 @@
HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIRECTDRAW pDD, LPDDSURFACEDESC2 pDDSD2)
{
return DDERR_ALREADYINITIALIZED;
{
return DDERR_ALREADYINITIALIZED;
}
ULONG WINAPI Main_DDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface)
{
LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface;
LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface;
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt++;
This->lpLcl->dwLocalRefCnt++;
if (This->lpLcl->lpGbl != NULL)
{
This->lpLcl->lpGbl->dwRefCnt++;
}
}
DX_WINDBG_trace();
if (iface!=NULL)
{
This->dwIntRefCnt++;
This->lpLcl->dwLocalRefCnt++;
if (This->lpLcl->lpGbl != NULL)
{
This->lpLcl->lpGbl->dwRefCnt++;
}
}
return This->dwIntRefCnt;
}
ULONG WINAPI Main_DDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface)
{
LPDDRAWI_DDRAWSURFACE_INT This = (LPDDRAWI_DDRAWSURFACE_INT)iface;
/* FIXME
This is not right exiame how it should be done
/* FIXME
This is not right exiame how it should be done
*/
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
DX_STUB_str("FIXME This is not right exiame how it should be done\n");
return This->dwIntRefCnt;
}

View file

@ -650,6 +650,8 @@ DWORD CALLBACK HelDdSurfUpdateOverlay(LPDDHAL_UPDATEOVERLAYDATA lpUpDateOveryLay
} \
return DDERR_UNSUPPORTED;
#define DX_STUB_DD_OK \
{ \
static BOOL firstcall = TRUE; \