- Move NCI generated files to arch-specific directories
[reactos.git] / reactos / dll / win32 / gdi32 / main / dllmain.c
1 /*
2 * dllmain.c
3 *
4 * $Revision: 1.11 $
5 * $Author$
6 * $Date$
7 *
8 */
9
10 #include "precomp.h"
11
12 /*
13 * GDI32.DLL doesn't have an entry point. The initialization is done by a call
14 * to GdiDllInitialize(). This call is done from the entry point of USER32.DLL.
15 */
16 BOOL
17 WINAPI
18 DllMain (
19 HANDLE hDll,
20 DWORD dwReason,
21 LPVOID lpReserved
22 )
23 {
24 return TRUE;
25 }
26
27
28 VOID
29 WINAPI
30 GdiProcessSetup (VOID)
31 {
32 hProcessHeap = GetProcessHeap();
33
34 /* map the gdi handle table to user space */
35 GdiHandleTable = NtCurrentTeb()->ProcessEnvironmentBlock->GdiSharedHandleTable;
36 CurrentProcessId = NtCurrentTeb()->Cid.UniqueProcess;
37 GDI_BatchLimit = NtCurrentTeb()->GdiBatchCount;
38 }
39
40
41 /*
42 * @implemented
43 */
44 BOOL
45 WINAPI
46 GdiDllInitialize (
47 HANDLE hDll,
48 DWORD dwReason,
49 LPVOID lpReserved
50 )
51 {
52 switch (dwReason)
53 {
54 case DLL_PROCESS_ATTACH:
55 GdiProcessSetup ();
56 break;
57
58 case DLL_THREAD_ATTACH:
59 break;
60
61 default:
62 return FALSE;
63 }
64
65 #if 0
66 /* FIXME: working teb handling needed */
67 NtCurrentTeb()->GdiTebBatch.Offset = 0;
68 NtCurrentTeb()->GdiBatchCount = 0;
69 #endif
70
71 return TRUE;
72 }
73
74 /* EOF */