Win32 utility to bootstrap the PSX subsystem (it is an optional subsystem, therefore...
[reactos.git] / posix / server / misc / main.c
1 /* $Id: main.c,v 1.3 2002/10/29 04:45:54 rex Exp $
2 *
3 * PROJECT : ReactOS / POSIX+ Environment Subsystem Server
4 * FILE : reactos/subsys/psx/server/misc/main.c
5 * DESCRIPTION: POSIX+ server main.
6 * DATE : 2001-05-05
7 * AUTHOR : Emanuele Aliberti <eal@users.sf.net>
8 *
9 * --------------------------------------------------------------------
10 *
11 * This software is free software; you can redistribute it and/or
12 * modify it under the terms of the GNU General Public License as
13 * published by the Free Software Foundation; either version 2 of the
14 * License, or (at your option) any later version.
15 *
16 * This software is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this software; see the file COPYING. If not, write
23 * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
24 * MA 02139, USA.
25 *
26 * --------------------------------------------------------------------
27 *
28 * 19990605 (Emanuele Aliberti)
29 * Compiled successfully with egcs 1.1.2
30 * 20020323 (Emanuele Aliberti)
31 * Converted to Win32 for testing it using NT LPC.
32 */
33 #include <windows.h>
34 #include <reactos/buildno.h>
35 #include <psxss.h>
36
37 /*** EXTERNAL ********************************************************/
38
39 NTSTATUS STDCALL
40 PsxServerInitialization (
41 IN ULONG ArgumentCount,
42 IN PWSTR *ArgumentArray
43 );
44
45 /*** ENTRY POINT *****************************************************/
46
47 #ifdef __PSXSS_ON_W32__ // W32 PSXSS.EXE
48 int main (int argc, char * argv[])
49 {
50 INT c;
51
52 debug_print(L"POSIX+ Subsystem for ReactOS "KERNEL_RELEASE_STR);
53
54 if (STATUS_SUCCESS == PsxServerInitialization(0,NULL))
55 {
56 debug_print(L"PSXSS: server active");
57 while (TRUE)
58 {
59 c = getch();
60 if (c == 1) break;
61 }
62 }
63 else
64 {
65 debug_print(L"PSXSS: Subsystem initialization failed.\n");
66 }
67 return 0;
68 }
69 #else /* Native PSXSS.EXE */
70 VOID NtProcessStartup (PPEB Peb)
71 {
72 UNICODE_STRING Banner;
73
74 RtlInitUnicodeString (& Banner, L"POSIX+ Subsystem for ReactOS "KERNEL_RELEASE_STR);
75 NtDisplayString(& Banner);
76
77 if (STATUS_SUCCESS == PsxServerInitialization(0,NULL))
78 {
79 DbgPrint("PSXSS: server active\n");
80 /* TODO */
81 }
82 else
83 {
84 DbgPrint("PSXSS: Subsystem initialization failed.\n");
85 }
86 NtTerminateProcess (NtCurrentProcess(), 0);
87 }
88 #endif
89 /* EOF */