Merge the following revisions from kernel-fun branch:
[reactos.git] / reactos / win32ss / gdi / ntgdi / init.c
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
15 BOOL NTAPI GDI_CleanupForProcess(struct _EPROCESS *Process);
16
17 NTSTATUS
18 GdiProcessCreate(PEPROCESS Process)
19 {
20 PPROCESSINFO ppiCurrent = PsGetProcessWin32Process(Process);
21 ASSERT(ppiCurrent);
22
23 InitializeListHead(&ppiCurrent->PrivateFontListHead);
24 ExInitializeFastMutex(&ppiCurrent->PrivateFontListLock);
25
26 InitializeListHead(&ppiCurrent->GDIBrushAttrFreeList);
27 InitializeListHead(&ppiCurrent->GDIDcAttrFreeList);
28
29 /* Map the GDI handle table to user land */
30 Process->Peb->GdiSharedHandleTable = GDI_MapHandleTable(Process);
31 Process->Peb->GdiDCAttributeList = GDI_BATCH_LIMIT;
32
33 /* Create pools for GDI object attributes */
34 ppiCurrent->pPoolDcAttr = GdiPoolCreate(sizeof(DC_ATTR), 'acdG');
35 ppiCurrent->pPoolBrushAttr = GdiPoolCreate(sizeof(BRUSH_ATTR), 'arbG');
36 ppiCurrent->pPoolRgnAttr = GdiPoolCreate(sizeof(RGN_ATTR), 'agrG');
37 ASSERT(ppiCurrent->pPoolDcAttr);
38 ASSERT(ppiCurrent->pPoolBrushAttr);
39 ASSERT(ppiCurrent->pPoolRgnAttr);
40
41 return STATUS_SUCCESS;
42 }
43
44 NTSTATUS
45 GdiProcessDestroy(PEPROCESS Process)
46 {
47 PPROCESSINFO ppiCurrent = PsGetProcessWin32Process(Process);
48 ASSERT(ppiCurrent);
49 ASSERT(ppiCurrent->peProcess == Process);
50
51 /* And GDI ones too */
52 GDI_CleanupForProcess(Process);
53
54 /* So we can now free the pools */
55 GdiPoolDestroy(ppiCurrent->pPoolDcAttr);
56 GdiPoolDestroy(ppiCurrent->pPoolBrushAttr);
57 GdiPoolDestroy(ppiCurrent->pPoolRgnAttr);
58
59 return STATUS_SUCCESS;
60 }
61
62
63 NTSTATUS
64 GdiThreadCreate(PETHREAD Thread)
65 {
66 return STATUS_SUCCESS;
67 }
68
69 NTSTATUS
70 GdiThreadDestroy(PETHREAD Thread)
71 {
72 return STATUS_SUCCESS;
73 }
74
75
76 /*
77 * @implemented
78 */
79 BOOL
80 APIENTRY
81 NtGdiInit(VOID)
82 {
83 return TRUE;
84 }
85
86 /* EOF */