Author: greatlrd
Date: Thu Dec 14 00:48:35 2006
New Revision: 25149
URL:
http://svn.reactos.org/svn/reactos?rev=25149&view=rev
Log:
more cleanup,
1. fixed more tab to space
2. rewrite addref for some inteface.
Modified:
trunk/reactos/dll/directx/ddraw/iface_clipper.c
trunk/reactos/dll/directx/ddraw/iface_color.c
trunk/reactos/dll/directx/ddraw/iface_gamma.c
trunk/reactos/dll/directx/ddraw/iface_kernel.c
trunk/reactos/dll/directx/ddraw/iface_palette.c
trunk/reactos/dll/directx/ddraw/iface_videoport.c
trunk/reactos/dll/directx/ddraw/main/surface_main.c
trunk/reactos/dll/directx/ddraw/rosdraw.h
Modified: trunk/reactos/dll/directx/ddraw/iface_clipper.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/iface_cl…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/iface_clipper.c (original)
+++ trunk/reactos/dll/directx/ddraw/iface_clipper.c Thu Dec 14 00:48:35 2006
@@ -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
Modified: trunk/reactos/dll/directx/ddraw/iface_color.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/iface_co…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/iface_color.c (original)
+++ trunk/reactos/dll/directx/ddraw/iface_color.c Thu Dec 14 00:48:35 2006
@@ -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();
Modified: trunk/reactos/dll/directx/ddraw/iface_gamma.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/iface_ga…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/iface_gamma.c (original)
+++ trunk/reactos/dll/directx/ddraw/iface_gamma.c Thu Dec 14 00:48:35 2006
@@ -15,53 +15,41 @@
{
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
Modified: trunk/reactos/dll/directx/ddraw/iface_kernel.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/iface_ke…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/iface_kernel.c (original)
+++ trunk/reactos/dll/directx/ddraw/iface_kernel.c Thu Dec 14 00:48:35 2006
@@ -89,44 +89,32 @@
{
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
Modified: trunk/reactos/dll/directx/ddraw/iface_palette.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/iface_pa…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/iface_palette.c (original)
+++ trunk/reactos/dll/directx/ddraw/iface_palette.c Thu Dec 14 00:48:35 2006
@@ -14,42 +14,33 @@
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
Modified: trunk/reactos/dll/directx/ddraw/iface_videoport.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/iface_vi…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/iface_videoport.c (original)
+++ trunk/reactos/dll/directx/ddraw/iface_videoport.c Thu Dec 14 00:48:35 2006
@@ -25,42 +25,33 @@
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;
+
+ 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_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
Modified: trunk/reactos/dll/directx/ddraw/main/surface_main.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/main/sur…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/main/surface_main.c (original)
+++ trunk/reactos/dll/directx/ddraw/main/surface_main.c Thu Dec 14 00:48:35 2006
@@ -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;
-
- DX_WINDBG_trace();
-
- if (iface!=NULL)
- {
- This->dwIntRefCnt++;
- This->lpLcl->dwLocalRefCnt++;
-
- if (This->lpLcl->lpGbl != NULL)
- {
- This->lpLcl->lpGbl->dwRefCnt++;
- }
- }
+ 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++;
+ }
+ }
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;
}
Modified: trunk/reactos/dll/directx/ddraw/rosdraw.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/directx/ddraw/rosdraw.…
==============================================================================
--- trunk/reactos/dll/directx/ddraw/rosdraw.h (original)
+++ trunk/reactos/dll/directx/ddraw/rosdraw.h Thu Dec 14 00:48:35 2006
@@ -650,6 +650,8 @@
} \
return DDERR_UNSUPPORTED;
+
+
#define DX_STUB_DD_OK \
{ \
static BOOL firstcall = TRUE; \