Difference between revisions of "Techwiki:Win32k/DC"

From ReactOS Wiki
Jump to: navigation, search
 
(23 intermediate revisions by 4 users not shown)
Line 1: Line 1:
Windows XP version of DCOBJ
+
Windows XP version of DC
 +
 
 +
typedef struct _DC
 +
{ //                                              W2k WXP
 +
  [[techwiki:win32k/BASEOBJECT|BASEOBJECT]]  BaseObject;                      // 000 000
 +
  DHPDEV      dhpdev;                          // 010 010
 +
  DCTYPE      dctype;                          // 014 014
 +
  DWORD      fs;                              // 018 018
 +
  [[techwiki:win32k/PDEVOBJ|PPDEVOBJ]]    ppdev;                          // 01C 01C
 +
  PVOID      hsem;                            // 020 020
 +
  FLONG      flGraphicsCaps;                  // 024 024
 +
  FLONG      flGraphicsCaps2;                // 028 028
 +
  PDC_ATTR    pdcattr;                        // 02c 02c
 +
  [[techwiki:win32k/DCLEVEL|DCLEVEL]]    dclevel;                        // 030 030 DCLEVEL is 0x1B8 Bytes
 +
  [[techwiki:win32k/DC_ATTR|DC_ATTR]]    dcattr;                          // 1E8 1E8 DC_ATTR is 0x1D0 Bytes
 +
  HDC        hdcNext;                        // 3B8 3B8
 +
  HDC        hdcPrev;                        // 3BC 3BC
 +
  RECTL      erclClip;                        // 3C0 3C0
 +
  POINTL      ptlDCOrig;                      // 3D0 3D0
 +
  RECTL      erclWindow;                      // 3D8 3D8
 +
  RECTL      erclBounds;                      // 3E8 3E8
 +
  RECTL      erclBoundsApp;                  // 3F8 3F8
 +
  PREGION    prgnAPI;                        // 408 408
 +
  PREGION    prgnVis;                        // 40C 40C
 +
  PREGION    prgnRao;                        // 410 410
 +
  POINTL      ptlFillOrigin;                  // 414 414
 +
  [[techwiki:win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboFill;                        // 41C 41C
 +
  [[techwiki:win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboLine;                        // 470 478
 +
  [[techwiki:win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboText;                        // 4c4 4D4
 +
  [[techwiki:win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboBackground;                  // 518 530
 +
  HFONT      hlfntCur;                        // 56c 58C
 +
  FLONG      flSimulationFlags;              // 570 590
 +
  LONG        lEscapement;                    // 574 594
 +
  RFONT *    prfnt;                          // 578 598
 +
  [[Techwiki:win32k/ClipRgnWnd|XCLIPOBJ]]    co;                              // 57c 59C
 +
  PPFF        pPFFList;                        // 5f8 618
 +
  PVOID      pClrxFormLnk;                    //    61C
 +
  INT        ipfdDevMax;                      // 600 620
 +
  ULONG      ulCopyCount;                    // 604 624
 +
  PVOID      pSurfInfo;                      // 608 628
 +
  POINTL      ptlDoBanding;                    // 60C 62C
 +
  /* DCMEMOBJ XP size == 0x634 */
 +
} DC, *PDC;
 +
 
 +
===Fields===
 +
 
 +
''dhpdev''
 +
:Device handle to the PDEV.
 +
 
 +
''dctype''
 +
:The type of DC. Can be one of the following values:
  
 
  typedef enum
 
  typedef enum
 
  {
 
  {
   DCTYPE_DIRECT = 0
+
   DCTYPE_DIRECT = 0,
   DCTYPE_MEMORY = 1
+
   DCTYPE_MEMORY = 1,
   DCTYPE_INFO = 2
+
   DCTYPE_INFO = 2,
 
  } DCTYPE;
 
  } DCTYPE;
  
fs:
+
''fs''
 +
: Flags. Can be a combination of the following values.
 +
 
 
  #define DC_DISPLAY  1
 
  #define DC_DISPLAY  1
 
  #define DC_DIRECT 2
 
  #define DC_DIRECT 2
Line 25: Line 77:
 
  #define DC_SHAREACCESS 0x4000
 
  #define DC_SHAREACCESS 0x4000
  
typedef struct
+
''ppdev''
{ //                                              W2k WXP Note
+
:Pointer to the DCs PDEV.
  [[techwiki/win32k/BASEOBJECT|BASEOBJECT]]  BaseObject;                      // 000 000
+
 
  DHPDEV      dhpdev;                          // 010 010 Device handle to PDEV
+
''hsem''
  DCTYPE      dctype;                          // 014 014 DC Type
+
 
  DWORD      fs;                              // 018 018 Flags
+
''flGraphicsCaps''
  [[techwiki/win32k/PDEVOBJ|PPDEVOBJ]]    ppdev;                          // 01c 01c
+
 
  PVOID      hsem;                            // 020
+
''flGraphicsCaps2''
  FLONG      flGraphicsCaps;                  // 024
+
 
  FLONG      flGraphicsCaps2;                // 028
+
''pdcattr''
  PVOID      pdcattr;                        // 02c    XP points to user mode DCATTR */
+
:Pointer to the DCs DC_ATTR. User mode pointer for user mode objects. Points to DC.dcattr if the DC is a kernel DC. Never NULL!
  [[techwiki/win32k/DCLEVEL|DCLEVEL]]    dclevel;                        // 030    DCLEVEL is 0x1B8 Bytes
+
 
  [[techwiki/win32k/DC_ATTR|DC_ATTR]]    dcattr;                          // 1E8    DC_ATTR is 0x1D0 Bytes
+
''dclevel''
  HDC        hdcNext;                        // 3B8
+
:DCLEVEL is 0x1B8 Bytes
  HDC        hdcPrev;                        // 3BC
+
 
  RECTL       erclClip;                       // 3C0
+
''dcattr''
  POINTL      ptlDCOrig;                       // 3D0    Ref in XDCOBJ::bCleanDC
+
:DC_ATTR is 0x1D0 Bytes
  RECTL      erclWindow;                     // 3D8    See note 1
+
 
  RECTL      erclBounds;                      // 3E8    SetGetBoundsRect stores the value here
+
''hdcNext''
  RECTL      erclBoundsApp;                  // 3F8
+
:Points to the next DC in the global list of DCs.
  PVOID      prgnAPI;                        // 408
+
 
  PVOID      prgnVis;                        // 40C
+
''hdcPrev''
  PVOID      prgnRao;                        // 410
+
 
  POINTL      ptlFillOrigin;                  // 414
+
''erclClip''
  [[techwiki/win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboFill;                        // 41C 41C Ref in XDCOBJ::bDeleteDC
+
: a RECTL structure, describing the bounding box of the DCs clip reagion.
  [[techwiki/win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboLine;                        // 470 478        "
+
 
  [[techwiki/win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboText;                        // 4c4 4D4        "
+
''ptlDCOrig''
  [[techwiki/win32k/EBRUSHOBJ|EBRUSHOBJ]]  eboBackground;                  // 518 530        "
+
:The DC's origin. Describes the point in device coordinates that matches the logical coordinates (0,0). See also GetDCOrgEx.
  HFONT      hlfntCur;                        // 58C
+
 
  FLONG      flSimulationFlags;              // 590    // 0x20 Italic & 0x80 Underline
+
''erclWindow''
  LONG        lEscapement;                    // 594
+
:NtGdiGetDeviceWidth
  RFONT *    prfnt;                          // 598    -> 'Gfnt'
+
:erclWindow: Rectangle Window
  [[Techwiki/win32k/ClipRgnWnd|XCLIPOBJ]]    co;                              // 59C    Ref in NtGdiSetPixel called XCLIPOBJ::vSetup
+
:3D8 = LONG left;  
  PPFF        pPFFList;                        // 618    PFF* Ref in XDCOBJ::bDeleteDC
+
:3DC = LONG top;  
  PVOID      pClrxFormLnk;                    // 61C    Ref in XDCOBJ::vCleanupColorTransform,
+
:3E0 = LONG right;
                                                          COLORTRANSFORMOBJ see Note 2.
+
:3E4 = LONG bottom;
  INT        ipfdDevMax;                      // 600 620 Ref in XDCOBJ::ipfdDevMax/Get, -1 NtGdiEndPage,  
+
:return (right - left);
                                                          0 GreDoBanding
+
 
  ULONG      ulCopyCount;                    // 624    Ref in NtGdiGetAndSetDCDword
+
''erclBounds''
  PVOID      pSurfInfo;                      // 628    Ref in DC::bMakeInfoDC Copy from DCLEVEL.pSurface
+
:SetGetBoundsRect stores the value here
  POINTL      ptlDoBanding;                    // 62C    Ref in GreDoBanding
+
 
  /* DCMEMOBJ XP size == 0x634 */
+
''erclBoundsApp''
} DCOBJ;
+
 
 +
''prgnAPI''
 +
:Doesn't have a handle. Intersection of the meta region and the clipping region.
 +
 
 +
''prgnVis''
 +
:Doesn't have a handle.
 +
 
 +
''prgnRao''
 +
:Doesn't have a handle. Intersection of the API region and the system region.
 +
 
 +
''ptlFillOrigin''
 +
 
 +
''eboFill''
 +
:Describes the currently active fill brush. Might need to be updated from the DC_ATTR.
 +
:Ref in XDCOBJ::bDeleteDC
 +
 
 +
''eboLine''
 +
:Describes the currently active Line brush. Might need to be updated from the DC_ATTR.
 +
 
 +
''eboText''
 +
:Describes the currently active text brush. Might need to be updated from the DC_ATTR.
 +
 
 +
''eboBackground''
 +
:Describes the currently active background brush. Might need to be updated from the DC_ATTR.
 +
 
 +
''hlfntCur''
 +
:Handle to the currently selected font.
 +
 
 +
''flSimulationFlags''
 +
:Flags that describe font simulation. 0x20 Italic & 0x80 Underline
 +
 
 +
''lEscapement''
 +
 
 +
''prfnt''
 +
:Pointer to the currently selected fon's RFONT. Might need to be updated from the DC_ATTR.
 +
 
 +
''co''
 +
:Ref in NtGdiSetPixel called XCLIPOBJ::vSetup
 +
 
 +
''pPFFList''
 +
:PFF* Ref in XDCOBJ::bDeleteDC
 +
 
 +
''pClrxFormLnk''
 +
:Pointer to a link list of Color Transforms.
 +
:Ref in XDCOBJ::vCleanupColorTransform, COLORTRANSFORMOBJ
 +
 
 +
''ipfdDevMax''
 +
:Ref in XDCOBJ::ipfdDevMax/Get, -1 NtGdiEndPage, 0 GreDoBanding
  
 +
''ulCopyCount''
 +
:Ref in NtGdiGetAndSetDCDword
  
Note:
+
''pSurfInfo''
 +
:Ref in DC::bMakeInfoDC Copy from DCLEVEL.pSurface
  
1. NtGdiGetDeviceWidth
+
''ptlDoBanding''
 +
:Ref in GreDoBanding
  
erclWindow: Rectangle Window
 
3D8 = LONG left;
 
3DC = LONG top;
 
3E0 = LONG right;
 
3E4 = LONG bottom;
 
return (right - left);
 
  
2. Pointer to a link list of Color Transforms.
+
== See also ==
 +
[[techwiki:DC State Saving]]
  
* The regions prgnAPI, prgnVis and prgnRao don't have a handle.
+
===References===
 +
* [https://books.google.hr/books?id=-O92IIF1Bj4C&pg=PA197&lpg=PA197 Feng Yuan - Windows Graphics Programming: Win32 GDI and DirectDraw]
 +
* gdikdx

Latest revision as of 00:45, 10 January 2020

Windows XP version of DC

typedef struct _DC
{ //                                              W2k WXP
  BASEOBJECT  BaseObject;                      // 000 000
  DHPDEV      dhpdev;                          // 010 010
  DCTYPE      dctype;                          // 014 014
  DWORD       fs;                              // 018 018
  PPDEVOBJ    ppdev;                           // 01C 01C
  PVOID       hsem;                            // 020 020
  FLONG       flGraphicsCaps;                  // 024 024
  FLONG       flGraphicsCaps2;                 // 028 028
  PDC_ATTR    pdcattr;                         // 02c 02c
  DCLEVEL     dclevel;                         // 030 030 DCLEVEL is 0x1B8 Bytes
  DC_ATTR     dcattr;                          // 1E8 1E8 DC_ATTR is 0x1D0 Bytes
  HDC         hdcNext;                         // 3B8 3B8
  HDC         hdcPrev;                         // 3BC 3BC
  RECTL       erclClip;                        // 3C0 3C0
  POINTL      ptlDCOrig;                       // 3D0 3D0
  RECTL       erclWindow;                      // 3D8 3D8
  RECTL       erclBounds;                      // 3E8 3E8
  RECTL       erclBoundsApp;                   // 3F8 3F8
  PREGION     prgnAPI;                         // 408 408
  PREGION     prgnVis;                         // 40C 40C
  PREGION     prgnRao;                         // 410 410
  POINTL      ptlFillOrigin;                   // 414 414
  EBRUSHOBJ   eboFill;                         // 41C 41C
  EBRUSHOBJ   eboLine;                         // 470 478
  EBRUSHOBJ   eboText;                         // 4c4 4D4
  EBRUSHOBJ   eboBackground;                   // 518 530
  HFONT       hlfntCur;                        // 56c 58C
  FLONG       flSimulationFlags;               // 570 590
  LONG        lEscapement;                     // 574 594
  RFONT *     prfnt;                           // 578 598
  XCLIPOBJ    co;                              // 57c 59C
  PPFF        pPFFList;                        // 5f8 618
  PVOID       pClrxFormLnk;                    //     61C
  INT         ipfdDevMax;                      // 600 620
  ULONG       ulCopyCount;                     // 604 624
  PVOID       pSurfInfo;                       // 608 628
  POINTL      ptlDoBanding;                    // 60C 62C
  /* DCMEMOBJ XP size == 0x634 */
} DC, *PDC;

Fields

dhpdev

Device handle to the PDEV.

dctype

The type of DC. Can be one of the following values:
typedef enum
{
  DCTYPE_DIRECT = 0,
  DCTYPE_MEMORY = 1,
  DCTYPE_INFO = 2,
} DCTYPE;

fs

Flags. Can be a combination of the following values.
#define DC_DISPLAY  1
#define DC_DIRECT 2
#define DC_CANCELED 4
#define DC_PERMANANT 0x08
#define DC_DIRTY_RAO 0x10
#define DC_ACCUM_WMGR 0x20
#define DC_ACCUM_APP 0x40
#define DC_RESET 0x80
#define DC_SYNCHRONIZEACCESS 0x100
#define DC_EPSPRINTINGESCAPE 0x200
#define DC_TEMPINFODC 0x400
#define DC_FULLSCREEN 0x800
#define DC_IN_CLONEPDEV 0x1000
#define DC_REDIRECTION 0x2000
#define DC_SHAREACCESS 0x4000

ppdev

Pointer to the DCs PDEV.

hsem

flGraphicsCaps

flGraphicsCaps2

pdcattr

Pointer to the DCs DC_ATTR. User mode pointer for user mode objects. Points to DC.dcattr if the DC is a kernel DC. Never NULL!

dclevel

DCLEVEL is 0x1B8 Bytes

dcattr

DC_ATTR is 0x1D0 Bytes

hdcNext

Points to the next DC in the global list of DCs.

hdcPrev

erclClip

a RECTL structure, describing the bounding box of the DCs clip reagion.

ptlDCOrig

The DC's origin. Describes the point in device coordinates that matches the logical coordinates (0,0). See also GetDCOrgEx.

erclWindow

NtGdiGetDeviceWidth
erclWindow: Rectangle Window
3D8 = LONG left;
3DC = LONG top;
3E0 = LONG right;
3E4 = LONG bottom;
return (right - left);

erclBounds

SetGetBoundsRect stores the value here

erclBoundsApp

prgnAPI

Doesn't have a handle. Intersection of the meta region and the clipping region.

prgnVis

Doesn't have a handle.

prgnRao

Doesn't have a handle. Intersection of the API region and the system region.

ptlFillOrigin

eboFill

Describes the currently active fill brush. Might need to be updated from the DC_ATTR.
Ref in XDCOBJ::bDeleteDC

eboLine

Describes the currently active Line brush. Might need to be updated from the DC_ATTR.

eboText

Describes the currently active text brush. Might need to be updated from the DC_ATTR.

eboBackground

Describes the currently active background brush. Might need to be updated from the DC_ATTR.

hlfntCur

Handle to the currently selected font.

flSimulationFlags

Flags that describe font simulation. 0x20 Italic & 0x80 Underline

lEscapement

prfnt

Pointer to the currently selected fon's RFONT. Might need to be updated from the DC_ATTR.

co

Ref in NtGdiSetPixel called XCLIPOBJ::vSetup

pPFFList

PFF* Ref in XDCOBJ::bDeleteDC

pClrxFormLnk

Pointer to a link list of Color Transforms.
Ref in XDCOBJ::vCleanupColorTransform, COLORTRANSFORMOBJ

ipfdDevMax

Ref in XDCOBJ::ipfdDevMax/Get, -1 NtGdiEndPage, 0 GreDoBanding

ulCopyCount

Ref in NtGdiGetAndSetDCDword

pSurfInfo

Ref in DC::bMakeInfoDC Copy from DCLEVEL.pSurface

ptlDoBanding

Ref in GreDoBanding


See also

techwiki:DC State Saving

References