From 6d9f3577354188be431ef0ef6351b880ec09da3e Mon Sep 17 00:00:00 2001 From: Emanuele Aliberti Date: Sun, 10 Dec 2000 16:57:07 +0000 Subject: [PATCH] Cleaning up before moving psxss to subsys/psx/server . svn path=/trunk/; revision=1465 --- reactos/subsys/psxss/api.c | 61 ------- reactos/subsys/psxss/api/process.c | 26 --- reactos/subsys/psxss/init.c | 245 ----------------------------- reactos/subsys/psxss/makefile | 41 ----- reactos/subsys/psxss/psxss.c | 81 ---------- reactos/subsys/psxss/psxss.rc | 38 ----- reactos/subsys/psxss/sbapi.c | 40 ----- 7 files changed, 532 deletions(-) delete mode 100644 reactos/subsys/psxss/api.c delete mode 100644 reactos/subsys/psxss/api/process.c delete mode 100644 reactos/subsys/psxss/init.c delete mode 100644 reactos/subsys/psxss/makefile delete mode 100644 reactos/subsys/psxss/psxss.c delete mode 100644 reactos/subsys/psxss/psxss.rc delete mode 100644 reactos/subsys/psxss/sbapi.c diff --git a/reactos/subsys/psxss/api.c b/reactos/subsys/psxss/api.c deleted file mode 100644 index 78dddf4e7e5..00000000000 --- a/reactos/subsys/psxss/api.c +++ /dev/null @@ -1,61 +0,0 @@ -/* $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 -#include -#include "api/api.h" - -BOOL TerminationRequestPending = FALSE; - -LPC_RETURN_CODE -PortRequestDispatcher_PsxApi ( - PLPC_REQUEST_REPLY pLpcRequestReply - ) -{ - switch (pLpcRequestReply->Function) - { - /* PROCESS Management */ - case PSX_SS_API_PROCESS_CREATE: - return POSIX_PROCESS_Create(pLpcRequestReply); - - 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 */ diff --git a/reactos/subsys/psxss/api/process.c b/reactos/subsys/psxss/api/process.c deleted file mode 100644 index e569b5fe11d..00000000000 --- a/reactos/subsys/psxss/api/process.c +++ /dev/null @@ -1,26 +0,0 @@ -/* $Id: process.c,v 1.2 1999/12/26 16:36:46 ea Exp $ - * - * reactos/subsys/psxss/api/process.c - * - * ReactOS Operating System - * - */ -LPC_RETURN_CODE -POSIX_PROCESS_Create ( - PLPC_REQUEST_REPLY pLpcRequestReply - ) -{ - return LPC_ERROR_CALL_NOT_IMPLEMENTED; -} - - -LPC_RETURN_CODE -POSIX_PROCESS_Terminate ( - PLPC_REQUEST_REPLY pLpcRequestReply - ) -{ - return LPC_ERROR_CALL_NOT_IMPLEMENTED; -} - - -/* EOF */ diff --git a/reactos/subsys/psxss/init.c b/reactos/subsys/psxss/init.c deleted file mode 100644 index 26a997e5462..00000000000 --- a/reactos/subsys/psxss/init.c +++ /dev/null @@ -1,245 +0,0 @@ -/* $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 - -struct _SERVER_DIRECTORIES -{ - HANDLE Root; /* MS & Interix(tm): \PSXSS\ */ - HANDLE Session; /* MS & Interix(tm): \PSXSS\PSXSES\ */ - HANDLE System; /* Interix(tm) only: \PSXSS\SYSTEM\ */ -}; - -struct _SERVER_PORT -{ - HANDLE Port; - THREAD Thread; -}; - -struct _SERVER -{ - struct _SERVER_DIRECTORIES Directory; - struct _SERVER_PORT Api; - struct _SERVER_PORT SbApi; - -}; - -void Thread_Api(void*); -void Thread_SbApi(void*); - -struct _SERVER -Server = -{ - {INVALID_HANDLE_VALUE,INVALID_HANDLE_VALUE}, - {INVALID_HANDLE_VALUE,Thread_Api}, - {INVALID_HANDLE_VALUE,Thread_SbApi} -}; - - -static -void -Thread_Api(void * pPort) -{ - HANDLE port; - - port = * (HANDLE*) pPort; - - NtListenPort(port); - while (TRUE) - { - NtAcceptConnectPort( - port - ); - if (NT_SUCCESS(NtCompleteConnectPort(port))) - { - /* dispatch call */ - } - } -} - - -static -void -Thread_SbApi(void * pPort) -{ - HANDLE port; - - port = * (HANDLE*) pPort; - - NtListenPort(port); - while (TRUE) - { - NtAcceptConnectPort( - port - ); - if (NT_SUCCESS(NtCompleteConnectPort(port))) - { - /* dispatch call */ - continue; - } - /* error */ - } -} - - -/*********************************************************************** - * InitializeServer - * - * DESCRIPTION - * Initialize the POSIX+ subsystem server process. That is: - * - * 1. create the directory object "\PSXSS\"; - * 2. create the API port "\PSXSS\ApiPort"; - * 3. create the debug port "\PSXSS\SbApiPort"; - * 4. create the sessions directory object "\PSXSS\PSXSES\"; - * 5. create the system directory object "\PSXSS\SYSTEM\"; - * 6. initialize port threads - * - * RETURN VALUE - * TRUE Initialization succeeded: - * FALSE Initialization failed. - * - * NOTE - * The "\PSXSS\SYSTEM\" directory object does not exist - * in the MS implementation, but appears in WNT's namespace - * when the Interix(tm) subsystem is installed. - */ -BOOL -InitializeServer (void) -{ - NTSTATUS Status; - OBJECT_ATTRIBUTES ObAttributes; - - - /* - * STEP 1 - * Create the directory object "\PSXSS\" - * - */ - Status = NtCreateDirectoryObject( - PSXSS_DIRECTORY_NAME_ROOT - & Server.Directory.Root - ); - if (!NT_SUCCESS(Status)) - { - return FALSE; - } - /* - * STEP 2 - * Create the LPC port "\PSXSS\ApiPort" - * - */ - ObAttributes.Name = PSXSS_PORT_NAME_APIPORT; - Status = NtCreatePort( - & Server.Api.Port, - & ObAttributes, - 0, - 0, - 0, - 0 - ); - 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" - * - */ - 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\PSXSES\" - * - */ - Status = NtCreateDirectoryObject( - 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 - * "\PSXSS\SYSTEM\" - * - */ - Status = NtCreateDirectoryObject( - PSXSS_DIRECTORY_NAME_SYSTEM - & Server.Directory.System - ); - return TRUE; -} - - -/* EOF */ diff --git a/reactos/subsys/psxss/makefile b/reactos/subsys/psxss/makefile deleted file mode 100644 index 6ae4c5d4e1a..00000000000 --- a/reactos/subsys/psxss/makefile +++ /dev/null @@ -1,41 +0,0 @@ -# $Id: makefile,v 1.3 1999/09/07 17:12:39 ea Exp $ -# -# PSXSS: POSIX+ Subsystem server process -# -# ReactOS Operating System -# -TARGET=psxss - -OBJECTS_API = api/process.o api/thread.o api/subsys.o - -OBJECTS_MISC = $(TARGET).o init.o $(TARGET).coff - -OBJECTS = $(OBJECTS_MISC) $(OBJECTS_API) - -LIBS = ../../lib/ntdll/ntdll.a - -all: $(TARGET).exe - -.phony: all - -clean: - - $(RM) *.o - - $(RM) $(TARGET).exe - - $(RM) $(TARGET).sym - - $(RM) $(TARGET).coff - - $(RM) api/*.o - -.phony: clean - -$(TARGET).coff: $(TARGET).rc - $(RC) $(TARGET).rc $(TARGET).coff - -$(TARGET).exe: $(OBJECTS) $(LIBS) - $(LD) \ - $(OBJECTS) \ - $(LIBS) \ - -o $(TARGET).exe \ - --subsystem native - $(NM) --numeric-sort $(TARGET).exe > $(TARGET).sym - -include ../../rules.mak diff --git a/reactos/subsys/psxss/psxss.c b/reactos/subsys/psxss/psxss.c deleted file mode 100644 index ca2b1e10670..00000000000 --- a/reactos/subsys/psxss/psxss.c +++ /dev/null @@ -1,81 +0,0 @@ -/* $Id: psxss.c,v 1.2 1999/09/07 17:12:39 ea Exp $ - * - * reactos/subsys/psxss/psxss.c - * - * POSIX+ subsystem server process - * - * 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. - * - * -------------------------------------------------------------------- - * - * 19990605 (Emanuele Aliberti) - * Compiled successfully with egcs 1.1.2 - */ -#include -//#include - -BOOL TerminationRequestPending = FALSE; - -BOOL InitializeServer(void); - - -void -DisplayString( - LPCWSTR Message - ) -{ - UNICODE_STRING title; - - title.Buffer = (LPWSTR) Message; - title.Length = wcslen(title.Buffer) * sizeof (WCHAR); - title.MaximumLength = title.Length + sizeof (WCHAR); - NtDisplayString( & title ); -} - - -/* Native process' entry point */ - -void -NtProcessStartup( PSTARTUP_ARGUMENT StartupArgument ) -{ - DisplayString( L"POSIX+ Subsystem\n" ); - - if (TRUE == InitializeServer()) - { - while (FALSE == TerminationRequestPending) - { - /* Do nothing! Should it - * be the SbApi port's - * thread instead? - */ - NtYieldExecution(); - } - } - else - { - DisplayString( L"PSX: Subsystem initialization failed.\n" ); - /* - * Tell SM we failed. - */ - } - NtTerminateProcess( NtCurrentProcess(), 0 ); -} - -/* EOF */ diff --git a/reactos/subsys/psxss/psxss.rc b/reactos/subsys/psxss/psxss.rc deleted file mode 100644 index ee0eedb5cee..00000000000 --- a/reactos/subsys/psxss/psxss.rc +++ /dev/null @@ -1,38 +0,0 @@ -#include "../../include/defines.h" -#include "../../include/reactos/resource.h" - -LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US - -VS_VERSION_INFO VERSIONINFO - FILEVERSION RES_UINT_FV_MAJOR,RES_UINT_FV_MINOR,RES_UINT_FV_REVISION,RES_UINT_FV_BUILD - PRODUCTVERSION RES_UINT_PV_MAJOR,RES_UINT_PV_MINOR,RES_UINT_PV_REVISION,RES_UINT_PV_BUILD - FILEFLAGSMASK 0x3fL -#ifdef _DEBUG - FILEFLAGS 0x1L -#else - FILEFLAGS 0x0L -#endif - FILEOS 0x40004L - FILETYPE 0x2L - FILESUBTYPE 0x0L -BEGIN - BLOCK "StringFileInfo" - BEGIN - BLOCK "040904b0" - BEGIN - VALUE "CompanyName", RES_STR_COMPANY_NAME - VALUE "FileDescription", "POSIX+ Subsystem Process\0" - VALUE "FileVersion", RES_STR_FILE_VERSION - VALUE "InternalName", "psxss\0" - VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT - VALUE "OriginalFilename", "psxss.exe\0" - VALUE "ProductName", RES_STR_PRODUCT_NAME - VALUE "ProductVersion", RES_STR_PRODUCT_VERSION - END - END - BLOCK "VarFileInfo" - BEGIN - VALUE "Translation", 0x409, 1200 - END -END - diff --git a/reactos/subsys/psxss/sbapi.c b/reactos/subsys/psxss/sbapi.c deleted file mode 100644 index c989e8a1084..00000000000 --- a/reactos/subsys/psxss/sbapi.c +++ /dev/null @@ -1,40 +0,0 @@ -/* $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 - -/* The \SbApi dispatcher: what is this port for? */ - -LPC_RETURN_CODE -PortRequestDispatcher_PsxSbApi ( - PLPC_REQUEST_REPLY pLpcRequestReply - ) -{ - return LPC_ERROR_INVALID_FUNCTION; -} - - -/* EOF */