[ros-diffs] [jimtabor] 24704: Incremental changes, adding new Create and Delete DC functions and support structures.

jimtabor at svn.reactos.org jimtabor at svn.reactos.org
Thu Nov 9 02:45:43 CET 2006


Author: jimtabor
Date: Thu Nov  9 04:45:42 2006
New Revision: 24704

URL: http://svn.reactos.org/svn/reactos?rev=24704&view=rev
Log:
Incremental changes, adding new Create and Delete DC functions and support structures.

Modified:
    trunk/reactos/dll/win32/gdi32/objects/dc.c
    trunk/reactos/include/reactos/win32k/ntgdihdl.h
    trunk/reactos/subsystems/win32/win32k/objects/dc.c
    trunk/reactos/tools/nci/w32ksvc.db

Modified: trunk/reactos/dll/win32/gdi32/objects/dc.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/objects/dc.c?rev=24704&r1=24703&r2=24704&view=diff
==============================================================================
--- trunk/reactos/dll/win32/gdi32/objects/dc.c (original)
+++ trunk/reactos/dll/win32/gdi32/objects/dc.c Thu Nov  9 04:45:42 2006
@@ -2,6 +2,74 @@
 
 #define NDEBUG
 #include <debug.h>
+
+HDC
+FASTCALL
+IntCreateDICW ( LPCWSTR   lpwszDriver,
+                LPCWSTR   lpwszDevice,
+                LPCWSTR   lpwszOutput,
+                PDEVMODEW lpInitData,
+                ULONG     iType )
+{
+ UNICODE_STRING Device, Output;
+ HDC hDC = NULL;
+ BOOL Display = FALSE;
+ ULONG UMdhpdev = 0;
+ 
+ HANDLE hspool = NULL;
+                
+ if ((!lpwszDevice) && (!lpwszDriver)) return hDC;
+ else
+ {
+    if (lpwszDevice) // First
+    {
+      if (!_wcsnicmp(lpwszDevice, L"\\\\.\\DISPLAY",11)) Display = TRUE;
+      RtlInitUnicodeString(&Device, lpwszDevice);
+    }
+    else
+    {
+      if (lpwszDriver) // Second
+      {
+        if ((!_wcsnicmp(lpwszDriver, L"DISPLAY",7)) || 
+              (!_wcsnicmp(lpwszDriver, L"\\\\.\\DISPLAY",11))) Display = TRUE;
+        RtlInitUnicodeString(&Device, lpwszDriver);
+      }
+    }
+ }
+ 
+ if (lpwszOutput) RtlInitUnicodeString(&Output, lpwszOutput);
+
+ if (!Display)
+ {
+    //Handle Print device or something else.
+    DPRINT1("Not a DISPLAY device! %wZ\n", &Device);
+ }
+        
+ hDC = NtGdiOpenDCW( &Device,
+                     (PDEVMODEW) lpInitData,
+                     (lpwszOutput ? &Output : NULL),
+                      iType,             // DCW 0 and ICW 1.
+                      hspool,
+                     (PVOID) NULL,       // NULL for now.
+                     (PVOID) &UMdhpdev );
+
+// Handle something other than a normal dc object.
+ if (GDI_HANDLE_GET_TYPE(hDC) != GDI_OBJECT_TYPE_DC)
+ {
+    PDC_ATTR Dc_Attr;
+    PLDC pLDC;
+
+    GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr);
+
+    pLDC = LocalAlloc(LMEM_ZEROINIT, sizeof(LDC));
+
+    Dc_Attr->pvLDC = pLDC;
+    pLDC->hDC = hDC;
+    pLDC->iType = LDC_LDC; // 1 (init) local DC, 2 EMF LDC
+ }
+
+ return hDC;     
+}
 
 
 /*
@@ -191,6 +259,39 @@
  */
 BOOL
 STDCALL
+NEWDeleteDC(HDC hDC)
+{
+  BOOL Ret = TRUE;
+  PDC_ATTR Dc_Attr;
+  PLDC pLDC;
+
+  Ret = GdiGetHandleUserData((HGDIOBJ) hDC, (PVOID) &Dc_Attr);
+
+  if ( !Ret ) return FALSE;
+  
+  if ( Dc_Attr )
+    {
+      pLDC = Dc_Attr->pvLDC;
+
+      if ( pLDC )
+        {
+          DPRINT1("Delete the Local DC structure\n");
+          LocalFree( pLDC );
+        }
+    }
+
+  Ret = NtGdiDeleteObjectApp(hDC);
+  
+  return Ret;
+}
+
+
+/*
+
+ * @implemented
+ */
+BOOL
+STDCALL
 DeleteObject(HGDIOBJ hObject)
 {
   /* From Wine: DeleteObject does not SetLastError() on a null object */

Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntgdihdl.h?rev=24704&r1=24703&r2=24704&view=diff
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Thu Nov  9 04:45:42 2006
@@ -93,6 +93,9 @@
 #define DC_LAST_CLIPRGN_VALID               0x00008000
 #define DC_PRIMARY_DISPLAY                  0x00010000
 
+#define LDC_LDC     0x01    // (init) local DC other than a normal DC
+#define LDC_EMFLDC  0x02    // Enhance Meta File local DC
+
 /* TYPES *********************************************************************/
 
 typedef struct _GDI_TABLE_ENTRY
@@ -109,6 +112,15 @@
     ULONG Flags;
     RECTL Rect;
 } RGNATTR,*PRGNATTR;
+
+// Local DC structure (_DC_ATTR) PVOID pvLDC;
+typedef struct _LDC
+{
+    HDC hDC;
+    ULONG Flags;
+    INT iType;
+    ABORTPROC pAbortProc; /* AbortProc for Printing */
+} LDC, *PLDC;
 
 typedef struct _DC_ATTR
 {

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=24704&r1=24703&r2=24704&view=diff
==============================================================================
--- trunk/reactos/subsystems/win32/win32k/objects/dc.c (original)
+++ trunk/reactos/subsystems/win32/win32k/objects/dc.c Thu Nov  9 04:45:42 2006
@@ -1036,6 +1036,19 @@
                        NULL == InitData ? NULL : &SafeInitData, TRUE);
 
   return Ret;
+}
+
+HDC STDCALL
+NtGdiOpenDCW( PUNICODE_STRING pustrDevice,
+              DEVMODEW *pdm,
+              PUNICODE_STRING pustrLogAddr,
+              ULONG iType,
+              HANDLE hspool,
+              VOID *pDriverInfo2,
+              VOID *pUMdhpdev )
+{
+  UNIMPLEMENTED;
+  return 0;
 }
 
 BOOL STDCALL

Modified: trunk/reactos/tools/nci/w32ksvc.db
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/tools/nci/w32ksvc.db?rev=24704&r1=24703&r2=24704&view=diff
==============================================================================
--- trunk/reactos/tools/nci/w32ksvc.db (original)
+++ trunk/reactos/tools/nci/w32ksvc.db Thu Nov  9 04:45:42 2006
@@ -182,6 +182,7 @@
 NtGdiOffsetRgn				3
 NtGdiOffsetViewportOrgEx		4
 NtGdiOffsetWindowOrgEx			4
+NtGdiOpenDCW				7
 NtGdiPaintRgn				2
 NtGdiPatBlt				6
 NtGdiPathToRegion			1




More information about the Ros-diffs mailing list