Fix broke SVN after me, thx to it I found wrong ref was release in different place...
authorMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 16:14:42 +0000 (16:14 +0000)
committerMagnus Olsen <magnus@greatlord.com>
Sun, 30 Oct 2005 16:14:42 +0000 (16:14 +0000)
svn path=/trunk/; revision=18887

reactos/lib/ddraw/main/clipper_main.c
reactos/lib/ddraw/main/color_main.c
reactos/lib/ddraw/main/gamma_main.c
reactos/lib/ddraw/main/palette_main.c
reactos/lib/ddraw/main/surface_main.c
reactos/lib/ddraw/rosdraw.h

index d8d45a8..28410eb 100644 (file)
@@ -13,8 +13,8 @@
 
 ULONG WINAPI Main_DirectDrawClipper_Release(LPDIRECTDRAWCLIPPER iface) 
 {
-    IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-    ULONG ref = InterlockedDecrement(&This->ref);
+    IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+    ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt);
     
     if (ref == 0)
                HeapFree(GetProcessHeap(), 0, This);
index ba36a71..47e7aaf 100644 (file)
@@ -22,8 +22,8 @@ Main_DirectDrawColorControl_AddRef(LPDIRECTDRAWCOLORCONTROL iface)
 ULONG WINAPI
 Main_DirectDrawColorControl_Release(LPDIRECTDRAWCOLORCONTROL iface)
 {
-    IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-    ULONG ref = InterlockedDecrement(&This->ref);
+    IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+    ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt);
     
     if (ref == 0)
                HeapFree(GetProcessHeap(), 0, This);
index 7d95cc9..8a5bc5c 100644 (file)
@@ -22,8 +22,8 @@ Main_DirectDrawGammaControl_AddRef(LPDIRECTDRAWGAMMACONTROL iface)
 ULONG WINAPI
 Main_DirectDrawGammaControl_Release(LPDIRECTDRAWGAMMACONTROL iface)
 {
-    IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-    ULONG ref = InterlockedDecrement(&This->ref);
+    IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+    ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt);
     
     if (ref == 0)
                HeapFree(GetProcessHeap(), 0, This);
index f3ffc8a..fd8f4a8 100644 (file)
@@ -21,8 +21,8 @@ Main_DirectDrawPalette_Release(LPDIRECTDRAWPALETTE iface)
 
 ULONG WINAPI Main_DirectDrawPalette_AddRef(LPDIRECTDRAWPALETTE iface) 
 {
-    IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-    ULONG ref = InterlockedDecrement(&This->ref);
+    IDirectDrawImpl* This = (IDirectDrawImpl*)iface;
+    ULONG ref = InterlockedDecrement(&This->DirectDrawGlobal.dwRefCnt);
     
     if (ref == 0)
                HeapFree(GetProcessHeap(), 0, This);
index da62043..39c547c 100644 (file)
@@ -94,13 +94,14 @@ HRESULT WINAPI Main_DDrawSurface_Initialize (LPDIRECTDRAWSURFACE7 iface, LPDIREC
 ULONG WINAPI Main_DDrawSurface_AddRef(LPDIRECTDRAWSURFACE7 iface)
 {
     IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-    return InterlockedIncrement(&This->ref);
+       
+    return InterlockedIncrement(&This->owner->DirectDrawGlobal.dsList->dwIntRefCnt);
 }
 
 ULONG WINAPI Main_DDrawSurface_Release(LPDIRECTDRAWSURFACE7 iface)
 {
     IDirectDrawSurfaceImpl* This = (IDirectDrawSurfaceImpl*)iface;
-    ULONG ref = InterlockedDecrement(&This->ref);
+    ULONG ref = InterlockedDecrement(&This->owner->DirectDrawGlobal.dsList->dwIntRefCnt);
     
     if (ref == 0)
                HeapFree(GetProcessHeap(), 0, This);
index f7b1e01..4d13260 100644 (file)
@@ -41,6 +41,10 @@ typedef struct
    
     IDirectDrawImpl* owner;
 
+       DDRAWI_DDRAWSURFACE_GBL Global; 
+       DDRAWI_DDRAWSURFACE_MORE More; 
+       DDRAWI_DDRAWSURFACE_LCL Local;
+
 } IDirectDrawSurfaceImpl;
 
 /******** Clipper Object ********/