From 380ae8a2621d380fa412048a8682305404c8e8dd Mon Sep 17 00:00:00 2001 From: Emanuele Aliberti Date: Sun, 30 May 1999 20:40:18 +0000 Subject: [PATCH] Session manager skeleton svn path=/trunk/; revision=529 --- reactos/services/smss/init.c | 55 +++++++++++++++++++++ reactos/services/smss/makefile | 36 ++++++++++++++ reactos/services/smss/smss.c | 87 ++++++++++++++++++++++++++++++++++ reactos/services/smss/smss.rc | 38 +++++++++++++++ 4 files changed, 216 insertions(+) create mode 100644 reactos/services/smss/init.c create mode 100644 reactos/services/smss/makefile create mode 100644 reactos/services/smss/smss.c create mode 100644 reactos/services/smss/smss.rc diff --git a/reactos/services/smss/init.c b/reactos/services/smss/init.c new file mode 100644 index 00000000000..0867f9ffa15 --- /dev/null +++ b/reactos/services/smss/init.c @@ -0,0 +1,55 @@ +/* $Id: init.c,v 1.1 1999/05/30 20:40:18 ea Exp $ + * + * smss.c - Session Manager + * + * ReactOS Operating System + * + * -------------------------------------------------------------------- + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * Library 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 + * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + * MA 02139, USA. + * + * -------------------------------------------------------------------- + * + * 19990530 (Emanuele Aliberti) + * Compiled successfully with egcs 1.1.2 + */ +#include +//#include + +BOOL +InitSessionManager( + HANDLE Children[] + ) +{ + /* FIXME: Create the \SmApiPort object (LPC) */ + /* FIXME: Create two thread for \SmApiPort */ + /* FIXME: Create the system environment variables */ + /* FIXME: Define symbolic links to kernel devices (MS-DOS names) */ + /* FIXME: Create pagination files (if any) other than the first one */ + /* FIXME: Load the well known DLLs */ + /* FIXME: Load the kernel mode driver win32k.sys */ + /* FIXME: Start the Win32 subsystem (csrss.exe) */ + Children[0] = INVALID_HANDLE_VALUE; + /* FIXME: Start winlogon.exe */ + Children[1] = INVALID_HANDLE_VALUE; + /* FIXME: Create the \DbgSsApiPort object (LPC) */ + /* FIXME: Create the \DbgUiApiPort object (LPC) */ + return FALSE; +} + + +/* EOF */ + diff --git a/reactos/services/smss/makefile b/reactos/services/smss/makefile new file mode 100644 index 00000000000..ef848592773 --- /dev/null +++ b/reactos/services/smss/makefile @@ -0,0 +1,36 @@ +# $Id: makefile,v 1.1 1999/05/30 20:40:18 ea Exp $ +# +# Session Manager +# +# ReactOS Operating System +# +TARGET=smss + +OBJECTS = $(TARGET).o init.o $(TARGET).coff + +LIBS = ../../lib/ntdll/ntdll.a + +all: $(TARGET).exe + +.phony: all + +clean: + - $(RM) $(TARGET).o + - $(RM) $(TARGET).exe + - $(RM) $(TARGET).sym + - $(RM) $(TARGET).coff + +.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/services/smss/smss.c b/reactos/services/smss/smss.c new file mode 100644 index 00000000000..243898891ed --- /dev/null +++ b/reactos/services/smss/smss.c @@ -0,0 +1,87 @@ +/* $Id: smss.c,v 1.1 1999/05/30 20:40:18 ea Exp $ + * + * smss.c - Session Manager + * + * ReactOS Operating System + * + * -------------------------------------------------------------------- + * + * This software is free software; you can redistribute it and/or + * modify it under the terms of the GNU Library 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 + * Library 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 + * to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, + * MA 02139, USA. + * + * -------------------------------------------------------------------- + * + * 19990529 (Emanuele Aliberti) + * Compiled successfully with egcs 1.1.2 + */ +#include +#include + +BOOL InitSessionManager(HANDLE Children[]); /* ./init.c */ + + +void +DisplayString( LPCWSTR lpwString ) +{ + UNICODE_STRING us; + + us.Buffer = (LPWSTR) lpwString; + us.Length = wcslen(lpwString) * sizeof (WCHAR); + us.MaximumLength = us.Length + sizeof (WCHAR); + NtDisplayString( & us ); +} + + +/* Native image's entry point */ + +void +NtProcessStartup( PSTARTUP_ARGUMENT StartupArgument ) +{ + HANDLE Children[2]; /* csrss, winlogon */ + + DisplayString( L"Session Manager\n" ); + + if (TRUE == InitSessionManager(Children)) + { + LARGE_INTEGER Time = {{(DWORD)-1,(DWORD)-1}}; /* infinite? */ + NTSTATUS wws; + + wws = NtWaitForMultipleObjects ( + ((LONG) sizeof Children / sizeof (HANDLE)), + Children, + WaitAny, + TRUE, /* alertable */ + & Time + ); + if (!NT_SUCCESS(wws)) + { + DisplayString( L"SM: NtWaitForMultipleObjects failed!\n" ); + /* FIXME: CRASH THE SYSTEM (BSOD) */ + } + } + else + { + DisplayString( L"SM: initialization failed!\n" ); + /* FIXME: CRASH SYSTEM (BSOD)*/ + } + /* + * OK: CSRSS asked to shutdown the system; + * We die. + */ + NtTerminateProcess( NtCurrentProcess(), 0 ); +} + + +/* EOF */ diff --git a/reactos/services/smss/smss.rc b/reactos/services/smss/smss.rc new file mode 100644 index 00000000000..aeef791a741 --- /dev/null +++ b/reactos/services/smss/smss.rc @@ -0,0 +1,38 @@ +#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", "ReactOS Session Manager\0" + VALUE "FileVersion", "post 0.0.13\0" + VALUE "InternalName", "smss\0" + VALUE "LegalCopyright", RES_STR_LEGAL_COPYRIGHT + VALUE "OriginalFilename", "smss.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 +