ReactOS
0.4.16-dev-91-g764881a
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
DBG_DEFAULT_CHANNEL
(UserMisc);
11
12
USHORT
gusLanguageID
;
13
14
BOOL
NTAPI
GDI_CleanupForProcess
(
struct
_EPROCESS
*
Process
);
15
16
NTSTATUS
17
GdiProcessCreate
(
PEPROCESS
Process
)
18
{
19
PPROCESSINFO
ppiCurrent =
PsGetProcessWin32Process
(
Process
);
20
ASSERT
(ppiCurrent);
21
22
InitializeListHead
(&ppiCurrent->
PrivateFontListHead
);
23
InitializeListHead
(&ppiCurrent->
PrivateMemFontListHead
);
24
ppiCurrent->
PrivateMemFontHandleCount
= 0;
25
ExInitializeFastMutex
(&ppiCurrent->
PrivateFontListLock
);
26
27
InitializeListHead
(&ppiCurrent->GDIBrushAttrFreeList);
28
InitializeListHead
(&ppiCurrent->GDIDcAttrFreeList);
29
30
/* Map the GDI handle table to user land */
31
Process
->Peb->GdiSharedHandleTable =
GDI_MapHandleTable
(
Process
);
32
Process
->Peb->GdiDCAttributeList =
GDI_BATCH_LIMIT
;
33
34
/* Create pools for GDI object attributes */
35
ppiCurrent->
pPoolDcAttr
=
GdiPoolCreate
(
sizeof
(
DC_ATTR
),
'acdG'
);
36
ppiCurrent->
pPoolBrushAttr
=
GdiPoolCreate
(
sizeof
(
BRUSH_ATTR
),
'arbG'
);
37
ppiCurrent->
pPoolRgnAttr
=
GdiPoolCreate
(
sizeof
(
RGN_ATTR
),
'agrG'
);
38
ASSERT
(ppiCurrent->
pPoolDcAttr
);
39
ASSERT
(ppiCurrent->
pPoolBrushAttr
);
40
ASSERT
(ppiCurrent->
pPoolRgnAttr
);
41
42
return
STATUS_SUCCESS
;
43
}
44
45
NTSTATUS
46
GdiProcessDestroy
(
PEPROCESS
Process
)
47
{
48
PPROCESSINFO
ppiCurrent =
PsGetProcessWin32Process
(
Process
);
49
ASSERT
(ppiCurrent);
50
ASSERT
(ppiCurrent->peProcess ==
Process
);
51
52
IntGdiCleanupPrivateFontsForProcess
();
53
54
/* And GDI ones too */
55
GDI_CleanupForProcess
(
Process
);
56
57
/* So we can now free the pools */
58
GdiPoolDestroy
(ppiCurrent->
pPoolDcAttr
);
59
GdiPoolDestroy
(ppiCurrent->
pPoolBrushAttr
);
60
GdiPoolDestroy
(ppiCurrent->
pPoolRgnAttr
);
61
62
return
STATUS_SUCCESS
;
63
}
64
65
66
NTSTATUS
67
GdiThreadCreate
(
PETHREAD
Thread
)
68
{
69
return
STATUS_SUCCESS
;
70
}
71
72
NTSTATUS
73
GdiThreadDestroy
(
PETHREAD
Thread
)
74
{
75
return
STATUS_SUCCESS
;
76
}
77
78
79
BOOL
80
InitializeGreCSRSS
(
VOID
)
81
{
82
/* Initialize DirectX graphics driver */
83
if
(
DxDdStartupDxGraphics
(0,
NULL
, 0,
NULL
,
NULL
,
gpepCSRSS
) !=
STATUS_SUCCESS
)
84
{
85
ERR
(
"Unable to initialize DirectX graphics\n"
);
86
return
FALSE
;
87
}
88
89
/* Get global language ID */
90
gusLanguageID
=
UserGetLanguageID
();
91
92
/* Initialize FreeType library */
93
if
(!
InitFontSupport
())
94
{
95
ERR
(
"Unable to initialize font support\n"
);
96
return
FALSE
;
97
}
98
99
return
TRUE
;
100
}
101
102
/*
103
* @implemented
104
*/
105
BOOL
106
APIENTRY
107
NtGdiInit
(
VOID
)
108
{
109
return
TRUE
;
110
}
111
112
/* EOF */
NTSTATUS
LONG NTSTATUS
Definition:
precomp.h:26
ERR
#define ERR(fmt,...)
Definition:
precomp.h:57
DBG_DEFAULT_CHANNEL
#define DBG_DEFAULT_CHANNEL(ch)
Definition:
debug.h:106
gpepCSRSS
PEPROCESS gpepCSRSS
Definition:
csr.c:15
NULL
#define NULL
Definition:
types.h:112
TRUE
#define TRUE
Definition:
types.h:120
FALSE
#define FALSE
Definition:
types.h:117
APIENTRY
#define APIENTRY
Definition:
api.h:79
InitializeListHead
#define InitializeListHead(ListHead)
Definition:
env_spec_w32.h:944
BOOL
unsigned int BOOL
Definition:
ntddk_ex.h:94
Thread
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition:
fltkernel.h:2653
IntGdiCleanupPrivateFontsForProcess
VOID FASTCALL IntGdiCleanupPrivateFontsForProcess(VOID)
Definition:
freetype.c:2584
InitFontSupport
BOOL FASTCALL InitFontSupport(VOID)
Definition:
freetype.c:1020
Process
_Must_inspect_result_ _In_ PLARGE_INTEGER _In_ PLARGE_INTEGER _In_ ULONG _In_ PFILE_OBJECT _In_ PVOID Process
Definition:
fsrtlfuncs.h:223
GdiPoolCreate
PGDI_POOL NTAPI GdiPoolCreate(ULONG cjAllocSize, ULONG ulTag)
Definition:
gdipool.c:316
GdiPoolDestroy
VOID NTAPI GdiPoolDestroy(PGDI_POOL pPool)
Definition:
gdipool.c:343
void
Definition:
nsiface.idl:2307
ASSERT
#define ASSERT(a)
Definition:
mode.c:44
GDI_BATCH_LIMIT
#define GDI_BATCH_LIMIT
Definition:
ntgdityp.h:201
PsGetProcessWin32Process
PVOID NTAPI PsGetProcessWin32Process(PEPROCESS Process)
Definition:
process.c:1193
USHORT
unsigned short USHORT
Definition:
pedump.c:61
STATUS_SUCCESS
#define STATUS_SUCCESS
Definition:
shellext.h:65
_BRUSH_ATTR
Definition:
ntgdihdl.h:354
_DC_ATTR
Definition:
ntgdihdl.h:292
_EPROCESS
Definition:
pstypes.h:1262
_ETHREAD
Definition:
pstypes.h:1103
_PROCESSINFO
Definition:
win32.h:253
_PROCESSINFO::PrivateMemFontListHead
LIST_ENTRY PrivateMemFontListHead
Definition:
win32.h:285
_PROCESSINFO::PrivateFontListLock
FAST_MUTEX PrivateFontListLock
Definition:
win32.h:283
_PROCESSINFO::pPoolRgnAttr
struct _GDI_POOL * pPoolRgnAttr
Definition:
win32.h:293
_PROCESSINFO::pPoolBrushAttr
struct _GDI_POOL * pPoolBrushAttr
Definition:
win32.h:292
_PROCESSINFO::PrivateMemFontHandleCount
UINT PrivateMemFontHandleCount
Definition:
win32.h:286
_PROCESSINFO::PrivateFontListHead
LIST_ENTRY PrivateFontListHead
Definition:
win32.h:284
_PROCESSINFO::pPoolDcAttr
struct _GDI_POOL * pPoolDcAttr
Definition:
win32.h:291
_RGN_ATTR
Definition:
ntgdihdl.h:255
NTAPI
#define NTAPI
Definition:
typedefs.h:36
win32k.h
GDI_MapHandleTable
PVOID NTAPI GDI_MapHandleTable(PEPROCESS pProcess)
Definition:
gdiobj.c:1552
gusLanguageID
USHORT gusLanguageID
Definition:
init.c:12
InitializeGreCSRSS
BOOL InitializeGreCSRSS(VOID)
Definition:
init.c:80
GdiThreadDestroy
NTSTATUS GdiThreadDestroy(PETHREAD Thread)
Definition:
init.c:73
GDI_CleanupForProcess
BOOL NTAPI GDI_CleanupForProcess(struct _EPROCESS *Process)
Definition:
gdiobj.c:1582
GdiProcessCreate
NTSTATUS GdiProcessCreate(PEPROCESS Process)
Definition:
init.c:17
GdiThreadCreate
NTSTATUS GdiThreadCreate(PETHREAD Thread)
Definition:
init.c:67
GdiProcessDestroy
NTSTATUS GdiProcessDestroy(PEPROCESS Process)
Definition:
init.c:46
NtGdiInit
BOOL APIENTRY NtGdiInit(VOID)
Definition:
init.c:107
UserGetLanguageID
USHORT FASTCALL UserGetLanguageID(VOID)
Definition:
misc.c:105
DxDdStartupDxGraphics
NTSTATUS APIENTRY DxDdStartupDxGraphics(ULONG SizeEngDrv, PDRVENABLEDATA pDxEngDrv, ULONG SizeDxgDrv, PDRVENABLEDATA pDxgDrv, PULONG DirectDrawContext, PEPROCESS Proc)
Definition:
main.c:34
ExInitializeFastMutex
FORCEINLINE VOID ExInitializeFastMutex(_Out_ PFAST_MUTEX FastMutex)
Definition:
exfuncs.h:274
win32ss
gdi
ntgdi
init.c
Generated on Sat Oct 5 2024 06:14:28 for ReactOS by
1.9.6