ReactOS 0.4.16-dev-340-g0540c21
dcattr.c File Reference
#include <win32k.h>
#include <debug.h>
Include dependency graph for dcattr.c:

Go to the source code of this file.

Classes

struct  _GDI_DC_ATTR_FREELIST
 
struct  _GDI_DC_ATTR_ENTRY
 

Macros

#define NDEBUG
 
#define GDIDCATTRFREE   8
 

Typedefs

typedef struct _GDI_DC_ATTR_FREELIST GDI_DC_ATTR_FREELIST
 
typedef struct _GDI_DC_ATTR_FREELISTPGDI_DC_ATTR_FREELIST
 
typedef struct _GDI_DC_ATTR_ENTRY GDI_DC_ATTR_ENTRY
 
typedef struct _GDI_DC_ATTR_ENTRYPGDI_DC_ATTR_ENTRY
 

Functions

BOOL NTAPI DC_bAllocDcAttr (PDC pdc)
 
VOID NTAPI DC_vFreeDcAttr (PDC pdc)
 

Macro Definition Documentation

◆ GDIDCATTRFREE

#define GDIDCATTRFREE   8

Definition at line 14 of file dcattr.c.

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file dcattr.c.

Typedef Documentation

◆ GDI_DC_ATTR_ENTRY

◆ GDI_DC_ATTR_FREELIST

◆ PGDI_DC_ATTR_ENTRY

◆ PGDI_DC_ATTR_FREELIST

Function Documentation

◆ DC_bAllocDcAttr()

BOOL NTAPI DC_bAllocDcAttr ( PDC  pdc)

Definition at line 31 of file dcattr.c.

32{
33 PPROCESSINFO ppi;
34 PDC_ATTR pdcattr;
35
37 ASSERT(ppi);
38
39 pdcattr = GdiPoolAllocate(ppi->pPoolDcAttr);
40 if (!pdcattr)
41 {
42 DPRINT1("Could not allocate DC attr\n");
43 return FALSE;
44 }
45
46 /* Copy the content from the kernel mode dc attr */
47 pdc->pdcattr = pdcattr;
48 *pdc->pdcattr = pdc->dcattr;
49
50 /* Set the object attribute in the handle table */
51 GDIOBJ_vSetObjectAttr(&pdc->BaseObject, pdcattr);
52
53 DPRINT("DC_AllocDcAttr: pdc=%p, pdc->pdcattr=%p\n", pdc, pdc->pdcattr);
54 return TRUE;
55}
#define DPRINT1
Definition: precomp.h:8
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
PVOID NTAPI GdiPoolAllocate(PGDI_POOL pPool)
Definition: gdipool.c:122
#define ASSERT(a)
Definition: mode.c:44
PVOID NTAPI PsGetCurrentProcessWin32Process(VOID)
Definition: process.c:1183
#define DPRINT
Definition: sndvol32.h:73
struct _GDI_POOL * pPoolDcAttr
Definition: win32.h:292
VOID NTAPI GDIOBJ_vSetObjectAttr(POBJ pobj, PVOID pvObjAttr)
Definition: gdiobj.c:1096

Referenced by DC_vSetOwner(), GreCreateCompatibleDC(), and GreOpenDCW().

◆ DC_vFreeDcAttr()

VOID NTAPI DC_vFreeDcAttr ( PDC  pdc)

Definition at line 59 of file dcattr.c.

60{
61 PPROCESSINFO ppi;
62
63 if (pdc->pdcattr == &pdc->dcattr)
64 {
65 // Internal DC object!
66 return;
67 }
68
69 /* Reset the object attribute in the handle table */
70 GDIOBJ_vSetObjectAttr(&pdc->BaseObject, NULL);
71
73 ASSERT(ppi);
74 GdiPoolFree(ppi->pPoolDcAttr, pdc->pdcattr);
75
76 /* Reset to kmode dcattr */
77 pdc->pdcattr = &pdc->dcattr;
78}
#define NULL
Definition: types.h:112
VOID NTAPI GdiPoolFree(PGDI_POOL pPool, PVOID pvAlloc)
Definition: gdipool.c:233

Referenced by DC_vCleanup(), and DC_vSetOwner().