Use DC object member hHmgr instead of hSelf. hSelf is used for MemoryDC and SaveDC.
authorJames Tabor <james.tabor@reactos.org>
Sun, 28 Oct 2007 20:50:31 +0000 (20:50 +0000)
committerJames Tabor <james.tabor@reactos.org>
Sun, 28 Oct 2007 20:50:31 +0000 (20:50 +0000)
svn path=/trunk/; revision=29940

reactos/subsystems/win32/win32k/include/dc.h
reactos/subsystems/win32/win32k/objects/arc.c
reactos/subsystems/win32/win32k/objects/dc.c
reactos/subsystems/win32/win32k/objects/dcutil.c

index daff361..57f0603 100644 (file)
@@ -59,10 +59,10 @@ typedef struct _WIN_DC_INFO
 
 typedef struct _DC
 {
-  HGDIOBJ     hHmgr;
-  PVOID       pvEntry;
-  ULONG       lucExcLock;
-  ULONG       Tid;
+  HGDIOBJ     hHmgr;  // Handle for this DC object.
+//  PVOID       pvEntry;
+//  ULONG       lucExcLock;
+//  ULONG       Tid;
 
   DHPDEV      PDev;
   INT         DC_Type;
@@ -70,7 +70,7 @@ typedef struct _DC
   PDC_ATTR    pDc_Attr;
   DC_ATTR     Dc_Attr;
 
-  HDC         hSelf;
+  HDC         hSelf;  // Used only for MemoryDC & SaveDC.
   HDC         hNext;
   HSURF       FillPatternSurfaces[HS_DDI_MAX];
   PGDIINFO    GDIInfo;
index 157bace..c8bd3eb 100644 (file)
@@ -43,7 +43,7 @@ IntGdiArcInternal(
     HWND hWnd;\r
     PWINDOW_OBJECT Window;\r
 \r
-    hWnd = IntWindowFromDC(dc->hSelf);\r
+    hWnd = IntWindowFromDC((HDC) dc->hHmgr);\r
     Window = UserGetWindowObject(hWnd);\r
     if(!Window) return FALSE;\r
 \r
index 14c7d42..5019f37 100644 (file)
@@ -2409,6 +2409,7 @@ DC_AllocDC(PUNICODE_STRING Driver)
     NewDC->DriverName.Buffer = Buf;
   }
 
+  NewDC->hHmgr = (HGDIOBJ) hDC; // Save the handle for this DC object.
   NewDC->w.xformWorld2Wnd.eM11 = 1.0f;
   NewDC->w.xformWorld2Wnd.eM12 = 0.0f;
   NewDC->w.xformWorld2Wnd.eM21 = 0.0f;
index d8e3cdf..df53f1a 100644 (file)
@@ -87,7 +87,7 @@ ReadWriteVMDcAttr(PDC dc, FLONG Dirty, BOOL Write)
   BOOL Ret = FALSE;
   KeEnterCriticalRegion();
     {
-      INT Index = GDI_HANDLE_GET_INDEX((HGDIOBJ)dc->hSelf);
+      INT Index = GDI_HANDLE_GET_INDEX(dc->hHmgr);
       PGDI_TABLE_ENTRY Entry = &GdiHandleTable->Entries[Index];
       HANDLE ProcessId = (HANDLE)(((ULONG_PTR)(Entry->ProcessId)) & ~1);
       DC_ATTR lDc_AttrData;