-/* $Id: api.c,v 1.1 1999/07/17 23:10:30 ea Exp $
+/* $Id: api.c,v 1.2 1999/09/07 17:12:39 ea Exp $
*
* reactos/subsys/psxss/api.c
*
* ReactOS Operating System
*
+ * --------------------------------------------------------------------
*
+ * This software is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write
+ * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
+ * MA 02139, USA.
+ *
+ * --------------------------------------------------------------------
*/
#include <ddk/ntddk.h>
-#include <internal/lpc.h>
-#include "api.h"
+#include <psxss/api.h>
+#include "api/api.h"
BOOL TerminationRequestPending = FALSE;
-long
-port_dispatcher_api(
+LPC_RETURN_CODE
+PortRequestDispatcher_PsxApi (
PLPC_REQUEST_REPLY pLpcRequestReply
)
{
switch (pLpcRequestReply->Function)
{
- case LPC_PSX_API_PROCESS_CREATE:
+ /* PROCESS Management */
+ case PSX_SS_API_PROCESS_CREATE:
return POSIX_PROCESS_Create(pLpcRequestReply);
- case LPC_PSX_API_PROCESS_TERMINATE:
+
+ case PSX_SS_API_PROCESS_TERMINATE:
return POSIX_PROCESS_Terminate(pLpcRequestReply);
+
+ /* THREAD Management */
+ case PSX_SS_API_THREAD_CREATE:
+ return POSIX_THREAD_Create(pLpcRequestReply);
+
+ case PSX_SS_API_THREAD_TERMINATE:
+ return POSIX_THREAD_Terminate(pLpcRequestReply);
+
+ /* Subsystem Control */
+ case PSX_SS_API_SUBSYSTEM_SHUTDOWN:
+ return POSIX_SS_Shutdown(pLpcRequestReply);
}
return LPC_ERROR_INVALID_FUNCTION;
}
+
/* EOF */
-/* $Id: init.c,v 1.1 1999/07/17 23:10:31 ea Exp $
+/* $Id: init.c,v 1.2 1999/09/07 17:12:39 ea Exp $
*
* init.c
*
* ReactOS Operating System
*
+ * --------------------------------------------------------------------
+ *
+ * This software is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write
+ * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
+ * MA 02139, USA.
+ *
+ * --------------------------------------------------------------------
*/
+#define PROTO_LPC
#include <ddk/ntddk.h>
-#include <internal/lpc.h>
struct _SERVER_DIRECTORIES
{
* when the Interix(tm) subsystem is installed.
*/
BOOL
-InitializeServer(void)
+InitializeServer (void)
{
NTSTATUS Status;
OBJECT_ATTRIBUTES ObAttributes;
PSXSS_DIRECTORY_NAME_ROOT
& Server.Directory.Root
);
+ if (!NT_SUCCESS(Status))
+ {
+ return FALSE;
+ }
/*
* STEP 2
* Create the LPC port "\PSXSS\ApiPort"
*
*/
- Server.Api.Port =
- NtCreatePort(
- PSXSS_PORT_NAME_APIPORT,
- ...
+ ObAttributes.Name = PSXSS_PORT_NAME_APIPORT;
+ Status = NtCreatePort(
+ & Server.Api.Port,
+ & ObAttributes,
+ 0,
+ 0,
+ 0,
+ 0
);
- NtCreateThread(
- & Server.Api.Thread,
- 0, /* desired access */
- & ObAttributes, /* object attributes */
- NtCurrentProcess(), /* process' handle */
- 0, /* client id */
- Thread_ApiPort,
- (void*) & Server.Api.Port
- );
+ if (!NT_SUCCESS(Status))
+ {
+ return FALSE;
+ }
+ Status = NtCreateThread(
+ & Server.Api.Thread,
+ 0, /* desired access */
+ & ObAttributes, /* object attributes */
+ NtCurrentProcess(), /* process' handle */
+ 0, /* client id */
+ Thread_ApiPort,
+ (void*) & Server.Api.Port
+ );
+ if (!NT_SUCCESS(Status))
+ {
+ NtClose(Server.Api.Port);
+ return FALSE;
+ }
/*
* STEP 3
* Create the LPC port "\PSXSS\SbApiPort"
*
*/
- Server.SbApi.Port =
- NtCreatePort(
- PSXSS_PORT_NAME_SBAPIPORT,
- ...
+ ObAttributes.Name = PSXSS_PORT_NAME_SBAPIPORT;
+ Status = NtCreatePort(
+ & Server.SbApi.Port,
+ & ObAttributes,
+ 0,
+ 0,
+ 0,
+ 0
);
+ if (!NT_SUCCESS(Status))
+ {
+ NtClose(Server.Api.Port);
+ NtTerminateThread(/*FIXME*/);
+ return FALSE;
+ }
Status = NtCreateThread(
& Server.SbApi.Thread,
Thread_SbApi,
(void*) & Server.SbApi.Port
);
+ if (!NT_SUCCESS(Status))
+ {
+ NtClose(Server.Api.Port);
+ NtTerminateThread(/*FIXME*/);
+ NtClose(Server.SbApi.Port);
+ return FALSE;
+ }
/*
* STEP 4
* Create the POSIX+ session directory object
PSXSS_DIRECTORY_NAME_SESSIONS
& Server.Directory.Sessions
);
+ if (!NT_SUCCESS(Status))
+ {
+ NtClose(Server.Api.Port);
+ NtTerminateThread(Server.Api.Thread);
+ NtClose(Server.SbApi.Port);
+ NtTerminateThread(Server.SbApi.Thread);
+ return FALSE;
/*
* STEP 5
* Create the POSIX+ system directory object
-# $Id: makefile,v 1.2 1999/08/29 13:45:07 dwelch Exp $
+# $Id: makefile,v 1.3 1999/09/07 17:12:39 ea Exp $
#
-# CSRSS: Client/server run-time subsystem
+# PSXSS: POSIX+ Subsystem server process
#
# ReactOS Operating System
#
-TARGET=csrss
+TARGET=psxss
-BASE_CFLAGS = -I../../include
+OBJECTS_API = api/process.o api/thread.o api/subsys.o
-OBJECTS = $(TARGET).o init.o $(TARGET).coff
+OBJECTS_MISC = $(TARGET).o init.o $(TARGET).coff
+
+OBJECTS = $(OBJECTS_MISC) $(OBJECTS_API)
LIBS = ../../lib/ntdll/ntdll.a
.phony: all
clean:
- - $(RM) $(TARGET).o
+ - $(RM) *.o
- $(RM) $(TARGET).exe
- $(RM) $(TARGET).sym
- $(RM) $(TARGET).coff
+ - $(RM) api/*.o
.phony: clean
-/* $Id: psxss.c,v 1.1 1999/07/17 23:10:31 ea Exp $
+/* $Id: psxss.c,v 1.2 1999/09/07 17:12:39 ea Exp $
*
* reactos/subsys/psxss/psxss.c
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Library General Public License for more details.
+ * General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this software; see the file COPYING.LIB. If not, write
+ * along with this software; see the file COPYING. If not, write
* to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
* MA 02139, USA.
*
-/* $Id: sbapi.c,v 1.1 1999/07/17 23:10:31 ea Exp $
+/* $Id: sbapi.c,v 1.2 1999/09/07 17:12:39 ea Exp $
*
* sbapi.c - Displatcher for the \SbApiPort
*
* ReactOS Operating System
*
+ * --------------------------------------------------------------------
*
+ * This software is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this software; see the file COPYING. If not, write
+ * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge,
+ * MA 02139, USA.
+ *
+ * --------------------------------------------------------------------
*/
+#define PROTO_LPC
#include <ddk/ntddk.h>
-#include <internal/lpc.h>
/* The \SbApi dispatcher: what is this port for? */
LPC_RETURN_CODE
-port_dispatcher_sbapi(
+PortRequestDispatcher_PsxSbApi (
PLPC_REQUEST_REPLY pLpcRequestReply
)
{