fixed some memory leaks
[reactos.git] / reactos / subsys / 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 software is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This software 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 GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this software; see the file COPYING.LIB. If not, write
21 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
22 * MA 02139, USA.
23 *
24 * --------------------------------------------------------------------
25 */
26 #include "basesrv.h"
27
28 #define NDEBUG
29 #include <debug.h>
30
31 HANDLE BaseApiPort = (HANDLE) 0;
32
33 /**********************************************************************
34 * NAME PRIVATE
35 * BaseStaticServerThread/1
36 */
37 VOID STDCALL BaseStaticServerThread (PVOID x)
38 {
39 NTSTATUS Status = STATUS_SUCCESS;
40 PPORT_MESSAGE Request = (PPORT_MESSAGE) x;
41 PPORT_MESSAGE Reply = NULL;
42 ULONG MessageType = 0;
43
44 DPRINT("BASESRV: %s called\n", __FUNCTION__);
45
46 MessageType = Request->u2.s2.Type;
47 DPRINT("BASESRV: %s received a message (Type=%d)\n",
48 __FUNCTION__, MessageType);
49 switch (MessageType)
50 {
51 default:
52 Reply = Request;
53 Status = NtReplyPort (BaseApiPort, Reply);
54 break;
55 }
56 }
57
58
59 NTSTATUS STDCALL ServerDllInitialization (ULONG ArgumentCount, LPWSTR *Argument)
60 {
61 NTSTATUS Status = STATUS_SUCCESS;
62
63 DPRINT("BASSRV: %s(%ld,...) called\n", __FUNCTION__, ArgumentCount);
64
65 BaseApiPort = CsrQueryApiPort ();
66 Status = CsrAddStaticServerThread (BaseStaticServerThread);
67 if (NT_SUCCESS(Status))
68 {
69 //TODO initialize the BASE server
70 }
71 return STATUS_SUCCESS;
72 }
73
74 /* EOF */