[ros-diffs] [jimtabor] 33310: Quick implementation of DxEngCreateMemoryDC and DxEngCleanDC. It compiles. 8^D

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Tue May 6 06:22:50 CEST 2008


Author: jimtabor
Date: Mon May  5 23:22:49 2008
New Revision: 33310

URL: http://svn.reactos.org/svn/reactos?rev=33310&view=rev
Log:
Quick implementation of DxEngCreateMemoryDC and DxEngCleanDC. It compiles. 8^D

Modified:
    trunk/reactos/subsystems/win32/win32k/include/dc.h
    trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
    trunk/reactos/subsystems/win32/win32k/objects/dc.c

Modified: trunk/reactos/subsystems/win32/win32k/include/dc.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/include/dc.h?rev=33310&r1=33309&r2=33310&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/include/dc.h [iso-8859-1] Mon May  5 23:22:49 2008
@@ -263,5 +263,7 @@
 INT STDCALL  IntGdiSetStretchBltMode(HDC  hDC, INT  stretchBltMode);
 VOID FASTCALL IntGdiReferencePdev(PGDIDEVICE pPDev);
 VOID FASTCALL IntGdiUnreferencePdev(PGDIDEVICE pPDev, DWORD CleanUpType);
+HDC FASTCALL IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC);
+BOOL FASTCALL IntGdiCleanDC(HDC hDC);
 
 #endif /* not __WIN32K_DC_H */

Modified: trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c?rev=33310&r1=33309&r2=33310&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/ntddraw/dxeng.c [iso-8859-1] Mon May  5 23:22:49 2008
@@ -654,8 +654,7 @@
 STDCALL
 DxEngCreateMemoryDC(HDEV hDev)
 {
-    UNIMPLEMENTED;
-    return NULL;
+    return IntGdiCreateDisplayDC(hDev, DC_TYPE_MEMORY, FALSE);
 }
 
 /************************************************************************/
@@ -732,8 +731,7 @@
 STDCALL
 DxEngCleanDC(HDC hdc)
 {
-    UNIMPLEMENTED;
-    return FALSE;
+    return IntGdiCleanDC(hdc);
 }
 
 /************************************************************************/

Modified: trunk/reactos/subsystems/win32/win32k/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/subsystems/win32/win32k/objects/dc.c?rev=33310&r1=33309&r2=33310&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c [iso-8859-1] Mon May  5 23:22:49 2008
@@ -31,6 +31,7 @@
 static GDIDEVICE PrimarySurface;
 static KEVENT VideoDriverNeedsPreparation;
 static KEVENT VideoDriverPrepared;
+static PDC defaultDCstate = NULL;
 EDD_DIRECTDRAW_GLOBAL edd_DdirectDraw_Global;
 
 NTSTATUS FASTCALL
@@ -926,6 +927,47 @@
 
   return Ret;
 
+}
+
+
+HDC FASTCALL
+IntGdiCreateDisplayDC(HDEV hDev, ULONG DcType, BOOL EmptyDC)
+{
+  HDC hDC;
+  UNICODE_STRING DriverName;
+  RtlInitUnicodeString(&DriverName, L"DISPLAY");
+
+  if (DcType != DC_TYPE_MEMORY)
+     hDC = IntGdiCreateDC(&DriverName, NULL, NULL, NULL, (DcType == DC_TYPE_INFO));
+  else
+     hDC = NtGdiCreateCompatibleDC(NULL); // OH~ Yuck! I think I taste vomit in my mouth!
+//
+// There is room to grow here~
+//
+
+//
+// If NULL, first time through! Build the default (was window) dc!
+//
+  if (hDC && !defaultDCstate) // Ultra HAX! Dedicated to GvG!
+  { // This is a cheesy way to do this.
+      PDC dc = DC_LockDc ( hDC );
+      defaultDCstate = ExAllocatePoolWithTag(PagedPool, sizeof(DC), TAG_DC);
+      RtlZeroMemory(defaultDCstate, sizeof(DC));
+      IntGdiCopyToSaveState(dc, defaultDCstate);
+      DC_UnlockDc( dc );
+  }
+  return hDC;
+}
+
+BOOL FASTCALL
+IntGdiCleanDC(HDC hDC)
+{
+  PDC dc;
+  dc = DC_LockDc ( hDC );
+  // Clean the DC
+  if (defaultDCstate) IntGdiCopyFromSaveState(dc, defaultDCstate, hDC );
+  DC_UnlockDc(dc);
+  return TRUE;
 }
 
 //



More information about the Ros-diffs mailing list