[ros-diffs] [greatlrd] 23088: Start implement code that alex for one year ago, thanks alex for all help and for all code he wrote. and sorry for the mess at moment in the file. it will be pretty large update to this file, for the patch have been lying on my harddisk for some time.

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Sun Jul 16 21:03:46 CEST 2006


Author: greatlrd
Date: Sun Jul 16 23:03:46 2006
New Revision: 23088

URL: http://svn.reactos.org/svn/reactos?rev=23088&view=rev
Log:
Start implement code that alex for one year ago, thanks alex for all help and for all code he wrote. 
and sorry for the mess at moment in the file. it will be pretty large update to this file, for the patch have been lying on my 
harddisk for some time. 

Modified:
    trunk/reactos/dll/win32/gdi32/misc/gdientry.c

Modified: trunk/reactos/dll/win32/gdi32/misc/gdientry.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/gdientry.c?rev=23088&r1=23087&r2=23088&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/gdientry.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/gdientry.c Sun Jul 16 23:03:46 2006
@@ -1,36 +1,112 @@
 /*
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2.1 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
- */
-/*
- * $Id:
  * COPYRIGHT:        See COPYING in the top level directory
  * PROJECT:          ReactOS GDI32
- * PURPOSE:          Gdi DirectX inteface
+ * PURPOSE:          GDI DirectX inteface
  * FILE:             lib/gdi32/misc/gdientry.c
- * PROGRAMER:        Magnus Olsen (magnus at greatlord.com)
- * REVISION HISTORY: 
- * NOTES:            
- */
-
+ * PROGRAMERS:       Alex Ionescu (alex at relsoft.net)
+ *                   Magnus Olsen (magnus at greatlord.com)
+ */
+
+/* INCLUDES ******************************************************************/
 
 #include "precomp.h"
 #include <ddraw.h>
 #include <ddrawi.h>
 #include <ddrawint.h>
 #include <ddrawgdi.h>
+
+/* DATA **********************************************************************/
+
+HANDLE ghDirectDraw;
+ULONG gcDirectDraw;
+
+#define GetDdHandle(Handle) (Handle ? Handle : ghDirectDraw)
+
+
+/* CALLBACKS *****************************************************************/
+
+/*
+ * Dd Surface Callbacks
+ */
+DWORD
+WINAPI
+DdAddAttachedSurface(LPDDHAL_ADDATTACHEDSURFACEDATA Attach)
+{
+    /* Call win32k */
+    return NtGdiDdAddAttachedSurface((HANDLE)Attach->lpDDSurface->hDDSurface,
+                                      (HANDLE)Attach->lpSurfAttached->hDDSurface,
+                                      (PDD_ADDATTACHEDSURFACEDATA)Attach);
+}
+
+DWORD
+WINAPI
+DdBlt(LPDDHAL_BLTDATA Blt)
+{
+    HANDLE Surface = 0;
+
+    /* Use the right surface */
+    if (Blt->lpDDSrcSurface) Surface = (HANDLE)Blt->lpDDSrcSurface->hDDSurface;
+
+    /* Call win32k */
+    return NtGdiDdBlt((HANDLE)Blt->lpDDDestSurface->hDDSurface, Surface, (PDD_BLTDATA)Blt);
+}
+
+DWORD
+APIENTRY
+DdDestroySurface(LPDDHAL_DESTROYSURFACEDATA pDestroySurface)
+{
+    DWORD Return = DDHAL_DRIVER_NOTHANDLED;
+    BOOL RealDestroy = TRUE;
+    LPDDRAWI_DDRAWSURFACE_LCL pSurfaceLocal;
+
+    /* Get the local surface */
+    pSurfaceLocal = pDestroySurface->lpDDSurface;
+
+    /* Make sure there's a surface */
+    if (pSurfaceLocal->hDDSurface)
+    {
+        /* Check if we shoudl really destroy it */
+        if ((pSurfaceLocal->dwFlags & DDRAWISURF_DRIVERMANAGED) &&
+            (pSurfaceLocal->dwFlags & DDRAWISURF_INVALID))
+        {
+            RealDestroy = FALSE;
+        }
+        
+        /* Call win32k */
+        Return = NtGdiDdDestroySurface((HANDLE)pSurfaceLocal->hDDSurface,
+                                       RealDestroy);
+    }
+
+    return Return;
+}
+
+DWORD
+WINAPI
+DdFlip(LPDDHAL_FLIPDATA Flip)
+{
+    /* Call win32k */
+	
+    return NtGdiDdFlip( (HANDLE)Flip->lpSurfCurr->hDDSurface,
+                        (HANDLE)Flip->lpSurfTarg->hDDSurface,
+   /* FIXME  the two last should be current left handler */ 
+						(HANDLE)Flip->lpSurfCurr->hDDSurface,
+                        (HANDLE)Flip->lpSurfTarg->hDDSurface,
+                        (PDD_FLIPDATA)Flip);
+}
+
+WORD
+WINAPI
+DdLock(LPDDHAL_LOCKDATA Lock)
+{
+    /* Call win32k */	
+    return NtGdiDdLock((HANDLE)Lock->lpDDSurface->hDDSurface,
+                        (PDD_LOCKDATA)Lock,
+						(HANDLE)Lock->lpDDSurface->hDC);
+}
+
+
+
+
 static LPDDRAWI_DIRECTDRAW_GBL pDirectDrawGlobalInternal;
 static ULONG RemberDdQueryDisplaySettingsUniquenessID = 0;
 




More information about the Ros-diffs mailing list