+++ /dev/null
-/* $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 <psxss/api.h>
-#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 */
+++ /dev/null
-/* $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 */
+++ /dev/null
-/* $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>
-
-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 */
+++ /dev/null
-# $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
+++ /dev/null
-/* $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 <ddk/ntddk.h>
-//#include <internal/lpc.h>
-
-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 */
+++ /dev/null
-#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
-
+++ /dev/null
-/* $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>
-
-/* The \SbApi dispatcher: what is this port for? */
-
-LPC_RETURN_CODE
-PortRequestDispatcher_PsxSbApi (
- PLPC_REQUEST_REPLY pLpcRequestReply
- )
-{
- return LPC_ERROR_INVALID_FUNCTION;
-}
-
-
-/* EOF */