2 * ReactOS W32 Subsystem
3 * Copyright (C) 1998, 1999, 2000, 2001, 2002, 2003 ReactOS Team
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 /* $Id: dllmain.c,v 1.35 2003/05/18 17:16:17 ea Exp $
21 * Entry Point for win32k.sys
24 #undef WIN32_LEAN_AND_MEAN
25 #define WIN32_NO_STATUS
27 #include <ddk/ntddk.h>
28 #include <ddk/winddi.h>
29 #include <ddk/service.h>
31 #include <napi/win32.h>
32 #include <win32k/win32k.h>
34 #include <include/winsta.h>
35 #include <include/class.h>
36 #include <include/window.h>
37 #include <include/object.h>
38 #include <include/input.h>
39 #include <include/timer.h>
40 #include <include/text.h>
43 #include <win32k/debug1.h>
45 extern SSDT Win32kSSDT
[];
46 extern SSPT Win32kSSPT
[];
47 extern ULONG Win32kNumberOfSysCalls
;
50 * This definition doesn't work
52 // WINBOOL STDCALL DllMain(VOID)
56 IN PDRIVER_OBJECT DriverObject
,
57 IN PUNICODE_STRING RegistryPath
)
63 * Register user mode call interface
64 * (system service table index = 1)
66 Result
= KeAddSystemServiceTable (Win32kSSDT
, NULL
,
67 Win32kNumberOfSysCalls
, Win32kSSPT
, 1);
70 DbgPrint("Adding system services failed!\n");
71 return STATUS_UNSUCCESSFUL
;
75 * Register our per-process and per-thread structures.
77 PsEstablishWin32Callouts(0, 0, 0, 0, sizeof(W32THREAD
), sizeof(W32PROCESS
));
79 WinPosSetupInternalPos();
81 Status
= InitWindowStationImpl();
82 if (!NT_SUCCESS(Status
))
84 DbgPrint("Failed to initialize window station implementation!\n");
85 return STATUS_UNSUCCESSFUL
;
88 Status
= InitClassImpl();
89 if (!NT_SUCCESS(Status
))
91 DbgPrint("Failed to initialize window class implementation!\n");
92 return STATUS_UNSUCCESSFUL
;
95 Status
= InitWindowImpl();
96 if (!NT_SUCCESS(Status
))
98 DbgPrint("Failed to initialize window implementation!\n");
99 return STATUS_UNSUCCESSFUL
;
102 Status
= InitInputImpl();
103 if (!NT_SUCCESS(Status
))
105 DbgPrint("Failed to initialize input implementation.\n");
109 Status
= MsqInitializeImpl();
110 if (!NT_SUCCESS(Status
))
112 DbgPrint("Failed to initialize message queue implementation.\n");
116 Status
= InitTimerImpl();
117 if (!NT_SUCCESS(Status
))
119 DbgPrint("Failed to initialize timer implementation.\n");
123 return STATUS_SUCCESS
;
126 PEPROCESS W32kDeviceProcess
;
130 W32kInitialize (VOID
)
132 DPRINT("in W32kInitialize\n");
134 W32kDeviceProcess
= PsGetCurrentProcess();
136 InitGdiObjectHandleTable ();
138 // Create surface used to draw the internal font onto
140 CreateCellCharSurface();
143 // Initialize FreeType library
144 if(!InitFontSupport()) return FALSE
;
146 // Create stock objects, ie. precreated objects commonly used by win32 applications
147 CreateStockObjects();