[SHELL32]
[reactos.git] / reactos / subsystems / win / basesrv / init.c
1 /* $Id$
2 *
3 * init.c - ReactOS/Win32 base enviroment subsystem server
4 *
5 * ReactOS Operating System
6 *
7 * --------------------------------------------------------------------
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 *
23 * --------------------------------------------------------------------
24 */
25 #include "basesrv.h"
26
27 #define NDEBUG
28 #include <debug.h>
29
30 HANDLE BaseApiPort = (HANDLE) 0;
31
32 /**********************************************************************
33 * NAME PRIVATE
34 * BaseStaticServerThread/1
35 */
36 VOID WINAPI BaseStaticServerThread (PVOID x)
37 {
38 NTSTATUS Status = STATUS_SUCCESS;
39 PPORT_MESSAGE Request = (PPORT_MESSAGE) x;
40 PPORT_MESSAGE Reply = NULL;
41 ULONG MessageType = 0;
42
43 DPRINT("BASESRV: %s called\n", __FUNCTION__);
44
45 MessageType = Request->u2.s2.Type;
46 DPRINT("BASESRV: %s received a message (Type=%d)\n",
47 __FUNCTION__, MessageType);
48 switch (MessageType)
49 {
50 default:
51 Reply = Request;
52 Status = NtReplyPort (BaseApiPort, Reply);
53 break;
54 }
55 }
56
57
58 NTSTATUS WINAPI ServerDllInitialization (ULONG ArgumentCount, LPWSTR *Argument)
59 {
60 NTSTATUS Status = STATUS_SUCCESS;
61
62 DPRINT("BASSRV: %s(%ld,...) called\n", __FUNCTION__, ArgumentCount);
63
64 BaseApiPort = CsrQueryApiPort ();
65 Status = CsrAddStaticServerThread (BaseStaticServerThread);
66 if (NT_SUCCESS(Status))
67 {
68 //TODO initialize the BASE server
69 }
70 return STATUS_SUCCESS;
71 }
72
73 /* EOF */