ReactOS  0.4.11-dev-721-g95bc44e
init.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Win32k subsystem
4  * PURPOSE: Initialization of GDI
5  * FILE: win32ss/gdi/ntgdi/init.c
6  * PROGRAMER:
7  */
8 
9 #include <win32k.h>
10 
11 #define NDEBUG
12 #include <debug.h>
13 #include <kdros.h>
14 
16 
19 {
20  PPROCESSINFO ppiCurrent = PsGetProcessWin32Process(Process);
21  ASSERT(ppiCurrent);
22 
25  ppiCurrent->PrivateMemFontHandleCount = 0;
27 
28  InitializeListHead(&ppiCurrent->GDIBrushAttrFreeList);
29  InitializeListHead(&ppiCurrent->GDIDcAttrFreeList);
30 
31  /* Map the GDI handle table to user land */
32  Process->Peb->GdiSharedHandleTable = GDI_MapHandleTable(Process);
33  Process->Peb->GdiDCAttributeList = GDI_BATCH_LIMIT;
34 
35  /* Create pools for GDI object attributes */
36  ppiCurrent->pPoolDcAttr = GdiPoolCreate(sizeof(DC_ATTR), 'acdG');
37  ppiCurrent->pPoolBrushAttr = GdiPoolCreate(sizeof(BRUSH_ATTR), 'arbG');
38  ppiCurrent->pPoolRgnAttr = GdiPoolCreate(sizeof(RGN_ATTR), 'agrG');
39  ASSERT(ppiCurrent->pPoolDcAttr);
40  ASSERT(ppiCurrent->pPoolBrushAttr);
41  ASSERT(ppiCurrent->pPoolRgnAttr);
42 
43  return STATUS_SUCCESS;
44 }
45 
48 {
49  PPROCESSINFO ppiCurrent = PsGetProcessWin32Process(Process);
50  ASSERT(ppiCurrent);
51  ASSERT(ppiCurrent->peProcess == Process);
52 
54 
55  /* And GDI ones too */
56  GDI_CleanupForProcess(Process);
57 
58  /* So we can now free the pools */
59  GdiPoolDestroy(ppiCurrent->pPoolDcAttr);
60  GdiPoolDestroy(ppiCurrent->pPoolBrushAttr);
61  GdiPoolDestroy(ppiCurrent->pPoolRgnAttr);
62 
63  return STATUS_SUCCESS;
64 }
65 
66 
69 {
70  return STATUS_SUCCESS;
71 }
72 
75 {
76  return STATUS_SUCCESS;
77 }
78 
79 
80 /*
81  * @implemented
82  */
83 BOOL
86 {
87  return TRUE;
88 }
89 
90 /* EOF */
BOOL APIENTRY NtGdiInit(VOID)
Definition: init.c:85
#define TRUE
Definition: types.h:120
struct _GDI_POOL * pPoolBrushAttr
Definition: win32.h:283
UINT PrivateMemFontHandleCount
Definition: win32.h:277
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel)?(CompletionRoutine!=NULL):TRUE)
PVOID NTAPI GDI_MapHandleTable(PEPROCESS pProcess)
Definition: gdiobj.c:1513
PVOID NTAPI PsGetProcessWin32Process(PEPROCESS Process)
Definition: process.c:1193
BOOL NTAPI GDI_CleanupForProcess(struct _EPROCESS *Process)
Definition: gdiobj.c:1543
#define GDI_BATCH_LIMIT
Definition: ntgdityp.h:198
PGDI_POOL NTAPI GdiPoolCreate(ULONG cjAllocSize, ULONG ulTag)
Definition: gdipool.c:316
NTSTATUS GdiThreadCreate(PETHREAD Thread)
Definition: init.c:68
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
VOID FASTCALL IntGdiCleanupPrivateFontsForProcess(VOID)
Definition: freetype.c:1546
struct _GDI_POOL * pPoolDcAttr
Definition: win32.h:282
FAST_MUTEX PrivateFontListLock
Definition: win32.h:274
#define APIENTRY
Definition: nt_native.h:48
struct _PEB * Peb
Definition: pstypes.h:1275
unsigned int BOOL
Definition: ntddk_ex.h:94
LONG NTSTATUS
Definition: precomp.h:26
LIST_ENTRY PrivateMemFontListHead
Definition: win32.h:276
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition: exfuncs.h:274
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653
NTSTATUS GdiProcessDestroy(PEPROCESS Process)
Definition: init.c:47
struct _GDI_POOL * pPoolRgnAttr
Definition: win32.h:284
NTSTATUS GdiProcessCreate(PEPROCESS Process)
Definition: init.c:18
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
NTSTATUS GdiThreadDestroy(PETHREAD Thread)
Definition: init.c:74
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition: fsrtlfuncs.h:219
return STATUS_SUCCESS
Definition: btrfs.c:2710
VOID NTAPI GdiPoolDestroy(PGDI_POOL pPool)
Definition: gdipool.c:343
LIST_ENTRY PrivateFontListHead
Definition: win32.h:275