Author: jimtabor
Date: Sat Apr 28 10:43:44 2007
New Revision: 26557
URL: 
http://svn.reactos.org/svn/reactos?rev=26557&view=rev
Log:
Fix indexing mistake, added new LDC structure items. New defines for LDC and Xfroms. Now
the Dc_Attr works. Read and write to it in user space.
Modified:
    trunk/reactos/dll/win32/gdi32/misc/misc.c
    trunk/reactos/include/reactos/win32k/ntgdihdl.h
Modified: trunk/reactos/dll/win32/gdi32/misc/misc.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/win32/gdi32/misc/misc.…
==============================================================================
--- trunk/reactos/dll/win32/gdi32/misc/misc.c (original)
+++ trunk/reactos/dll/win32/gdi32/misc/misc.c Sat Apr 28 10:43:44 2007
@@ -58,8 +58,10 @@
 BOOL GdiIsHandleValid(HGDIOBJ hGdiObj)
 {
-  PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_TO_ENTRY(hGdiObj);
-  if(Entry->KernelData != NULL && (Entry->Type & GDI_HANDLE_TYPE_MASK)
== (LONG)GDI_HANDLE_GET_TYPE(hGdiObj))
+  PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
+  if(Entry->KernelData != NULL &&
+                        (Entry->Type & GDI_HANDLE_TYPE_MASK) ==
+                                       (LONG)GDI_HANDLE_GET_TYPE(hGdiObj))
   {
     HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
     if(pid == NULL || pid == CurrentProcessId)
@@ -72,8 +74,10 @@
 BOOL GdiGetHandleUserData(HGDIOBJ hGdiObj, PVOID *UserData)
 {
-  PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_TO_ENTRY(hGdiObj);
-  if(Entry->KernelData != NULL && (Entry->Type & GDI_HANDLE_TYPE_MASK)
== (LONG)GDI_HANDLE_GET_TYPE(hGdiObj))
+  PGDI_TABLE_ENTRY Entry = GdiHandleTable + GDI_HANDLE_GET_INDEX(hGdiObj);
+  if(Entry->KernelData != NULL &&
+                        (Entry->Type & GDI_HANDLE_TYPE_MASK) ==
+                                       (LONG)GDI_HANDLE_GET_TYPE(hGdiObj))
   {
     HANDLE pid = (HANDLE)((ULONG_PTR)Entry->ProcessId & ~0x1);
     if(pid == NULL || pid == CurrentProcessId)
Modified: trunk/reactos/include/reactos/win32k/ntgdihdl.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/include/reactos/win32k/ntg…
==============================================================================
--- trunk/reactos/include/reactos/win32k/ntgdihdl.h (original)
+++ trunk/reactos/include/reactos/win32k/ntgdihdl.h Sat Apr 28 10:43:44 2007
@@ -94,8 +94,30 @@
 #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
+/* DC_ATTR LCD Flags */
+#define LDC_LDC           0x00000001 // (init) local DC other than a normal DC
+#define LDC_EMFLDC        0x00000002 // Enhance Meta File local DC
+#define LDC_INIT_DOCUMENT 0x00000040
+#define LDC_INIT_PAGE     0x00000080
+#define LDC_KILL_DOCUMENT 0x00010000
+
+
+/* DC_ATTR Xform Flags */
+#define METAFILE_TO_WORLD_IDENTITY          0x00000001
+#define WORLD_TO_PAGE_IDENTITY              0x00000002
+#define DEVICE_TO_PAGE_INVALID              0x00000008
+#define DEVICE_TO_WORLD_INVALID             0x00000010
+#define WORLD_TRANSFORM_SET                 0x00000020
+#define POSITIVE_Y_IS_UP                    0x00000040
+#define INVALIDATE_ATTRIBUTES               0x00000080
+#define PTOD_EFM11_NEGATIVE                 0x00000100
+#define PTOD_EFM22_NEGATIVE                 0x00000200
+#define ISO_OR_ANISO_MAP_MODE               0x00000400
+#define PAGE_TO_DEVICE_IDENTITY             0x00000800
+#define PAGE_TO_DEVICE_SCALE_IDENTITY       0x00001000
+#define PAGE_XLATE_CHANGED                  0x00002000
+#define PAGE_EXTENTS_CHANGED                0x00004000
+#define WORLD_XFORM_CHANGED                 0x00008000
 /* TYPES *********************************************************************/
@@ -106,11 +128,6 @@
     LONG Type;        /* the first 16 bit is the object type including the stock obj
flag, the last 16 bits is just the object type */
     PVOID UserData;   /* Points to the user mode structure, usually NULL though */
 } GDI_TABLE_ENTRY, *PGDI_TABLE_ENTRY;
-
-
-#define GDI_HANDLE_TO_ENTRY(h) \
-  ((((ULONG_PTR)(h)) & GDI_HANDLE_INDEX_MASK) * sizeof(GDI_TABLE_ENTRY))
-
 typedef struct _RGNATTR
 {
@@ -127,6 +144,9 @@
     INT iType;
     PVOID pvEmfDC;        /* Pointer to ENHMETAFILE structure */
     ABORTPROC pAbortProc; /* AbortProc for Printing */
+    HANDLE hPrinter;      /* Local or Remote Printer driver */
+    INT iInitPage;        /* Start/Stop */
+    INT iInitDocument;
 } LDC, *PLDC;
 typedef struct _DC_ATTR