reshuffling of dlls
[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 }
38
39
40 /*
41 * @implemented
42 */
43 BOOL
44 WINAPI
45 GdiDllInitialize (
46 HANDLE hDll,
47 DWORD dwReason,
48 LPVOID lpReserved
49 )
50 {
51 switch (dwReason)
52 {
53 case DLL_PROCESS_ATTACH:
54 GdiProcessSetup ();
55 break;
56
57 case DLL_THREAD_ATTACH:
58 break;
59
60 default:
61 return FALSE;
62 }
63
64 #if 0
65 /* FIXME: working teb handling needed */
66 NtCurrentTeb()->GdiTebBatch.Offset = 0;
67 NtCurrentTeb()->GdiBatchCount = 0;
68 #endif
69
70 return TRUE;
71 }
72
73 /* EOF */