Author: ion Date: Tue Feb 14 06:06:39 2012 New Revision: 55589
URL: http://svn.reactos.org/svn/reactos?rev=55589&view=rev Log: [SMSS2/SMSS]: Nuke SMSS. SMSS2 is now in full control.
Removed: trunk/reactos/base/system/smss/ Modified: trunk/reactos/base/system/CMakeLists.txt trunk/reactos/base/system/smss2/CMakeLists.txt trunk/reactos/base/system/smss2/pagefile.c trunk/reactos/base/system/smss2/smss.c trunk/reactos/base/system/smss2/smss2.rbuild trunk/reactos/base/system/system.rbuild trunk/reactos/boot/bootdata/packages/reactos.dff trunk/reactos/boot/bootdata/txtsetup.sif trunk/reactos/ntoskrnl/ex/init.c
Modified: trunk/reactos/base/system/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/CMakeLists.txt?... ============================================================================== --- trunk/reactos/base/system/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/system/CMakeLists.txt [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -12,7 +12,6 @@ add_subdirectory(rundll32) add_subdirectory(runonce) add_subdirectory(services) -add_subdirectory(smss) add_subdirectory(smss2) add_subdirectory(subst) add_subdirectory(userinit)
Modified: trunk/reactos/base/system/smss2/CMakeLists.txt URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/CMakeList... ============================================================================== --- trunk/reactos/base/system/smss2/CMakeLists.txt [iso-8859-1] (original) +++ trunk/reactos/base/system/smss2/CMakeLists.txt [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -13,12 +13,12 @@ smss.c smss.rc)
-add_executable(smss2 WIN32 ${SOURCE}) +add_executable(smss WIN32 ${SOURCE})
-target_link_libraries(smss2 nt pseh smlib) +target_link_libraries(smss nt pseh smlib)
-add_pch(smss2 smss.h) +add_pch(smss smss.h)
-set_module_type(smss2 nativecui) -add_importlibs(smss2 ntdll) -add_cd_file(TARGET smss2 DESTINATION reactos/system32 NO_CAB FOR all) +set_module_type(smss nativecui) +add_importlibs(smss ntdll) +add_cd_file(TARGET smss DESTINATION reactos/system32 FOR all)
Modified: trunk/reactos/base/system/smss2/pagefile.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/pagefile.... ============================================================================== --- trunk/reactos/base/system/smss2/pagefile.c [iso-8859-1] (original) +++ trunk/reactos/base/system/smss2/pagefile.c [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -457,8 +457,7 @@ NTSTATUS Status;
/* Tell the kernel to create the pagefile */ - //Status = NtCreatePagingFile(Name, MinSize, MaxSize, Priority); - Status = STATUS_SUCCESS; + Status = NtCreatePagingFile(Name, MinSize, MaxSize, Priority); if (NT_SUCCESS(Status)) { DPRINT1("SMSS:PFILE: NtCreatePagingFile (%wZ, %I64X, %I64X) succeeded. \n",
Modified: trunk/reactos/base/system/smss2/smss.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/smss.c?re... ============================================================================== --- trunk/reactos/base/system/smss2/smss.c [iso-8859-1] (original) +++ trunk/reactos/base/system/smss2/smss.c [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -13,18 +13,6 @@ #include "debug.h"
/* GLOBALS ********************************************************************/ - -typedef struct _INIT_BUFFER -{ - WCHAR DebugBuffer[256]; - RTL_USER_PROCESS_INFORMATION ProcessInfo; -} INIT_BUFFER, *PINIT_BUFFER; - -/* NT Initial User Application */ -WCHAR NtInitialUserProcessBuffer[128] = L"\SystemRoot\System32\smss.exe"; -ULONG NtInitialUserProcessBufferLength = sizeof(NtInitialUserProcessBuffer) - - sizeof(WCHAR); -ULONG NtInitialUserProcessBufferType = REG_SZ;
UNICODE_STRING SmpSystemRoot; ULONG AttachedSessionId = -1; @@ -398,234 +386,6 @@
NTSTATUS NTAPI -ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer, - OUT PRTL_USER_PROCESS_PARAMETERS *ProcessParameters, - OUT PCHAR *ProcessEnvironment) -{ - NTSTATUS Status; - SIZE_T Size; - PWSTR p; - UNICODE_STRING NullString = RTL_CONSTANT_STRING(L""); - UNICODE_STRING SmssName, DebugString; - PVOID EnvironmentPtr = NULL; - PRTL_USER_PROCESS_INFORMATION ProcessInformation; - PRTL_USER_PROCESS_PARAMETERS ProcessParams = NULL; - - NullString.Length = sizeof(WCHAR); - - /* Use the initial buffer, after the strings */ - ProcessInformation = &InitBuffer->ProcessInfo; - - /* Allocate memory for the process parameters */ - Size = sizeof(*ProcessParams) + ((MAX_PATH * 6) * sizeof(WCHAR)); - Status = ZwAllocateVirtualMemory(NtCurrentProcess(), - (PVOID*)&ProcessParams, - 0, - &Size, - MEM_COMMIT, - PAGE_READWRITE); - if (!NT_SUCCESS(Status)) - { - /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), - L"INIT: Unable to allocate Process Parameters. 0x%lx", - Status); - RtlInitUnicodeString(&DebugString, p); - ZwDisplayString(&DebugString); - - /* Bugcheck the system */ - return Status; - } - - /* Setup the basic header, and give the process the low 1MB to itself */ - ProcessParams->Length = (ULONG)Size; - ProcessParams->MaximumLength = (ULONG)Size; - ProcessParams->Flags = RTL_USER_PROCESS_PARAMETERS_NORMALIZED | - RTL_USER_PROCESS_PARAMETERS_RESERVE_1MB; - - /* Allocate a page for the environment */ - Size = PAGE_SIZE; - Status = ZwAllocateVirtualMemory(NtCurrentProcess(), - &EnvironmentPtr, - 0, - &Size, - MEM_COMMIT, - PAGE_READWRITE); - if (!NT_SUCCESS(Status)) - { - /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), - L"INIT: Unable to allocate Process Environment. 0x%lx", - Status); - RtlInitUnicodeString(&DebugString, p); - ZwDisplayString(&DebugString); - - /* Bugcheck the system */ - return Status; - } - - /* Write the pointer */ - ProcessParams->Environment = EnvironmentPtr; - - /* Make a buffer for the DOS path */ - p = (PWSTR)(ProcessParams + 1); - ProcessParams->CurrentDirectory.DosPath.Buffer = p; - ProcessParams->CurrentDirectory.DosPath.MaximumLength = MAX_PATH * - sizeof(WCHAR); - - /* Copy the DOS path */ - RtlCopyUnicodeString(&ProcessParams->CurrentDirectory.DosPath, - &SmpSystemRoot); - - /* Make a buffer for the DLL Path */ - p = (PWSTR)((PCHAR)ProcessParams->CurrentDirectory.DosPath.Buffer + - ProcessParams->CurrentDirectory.DosPath.MaximumLength); - ProcessParams->DllPath.Buffer = p; - ProcessParams->DllPath.MaximumLength = MAX_PATH * sizeof(WCHAR); - - /* Copy the DLL path and append the system32 directory */ - RtlCopyUnicodeString(&ProcessParams->DllPath, - &ProcessParams->CurrentDirectory.DosPath); - RtlAppendUnicodeToString(&ProcessParams->DllPath, L"\System32"); - - /* Make a buffer for the image name */ - p = (PWSTR)((PCHAR)ProcessParams->DllPath.Buffer + - ProcessParams->DllPath.MaximumLength); - ProcessParams->ImagePathName.Buffer = p; - ProcessParams->ImagePathName.MaximumLength = MAX_PATH * sizeof(WCHAR); - - /* Make sure the buffer is a valid string which within the given length */ - if ((NtInitialUserProcessBufferType != REG_SZ) || - ((NtInitialUserProcessBufferLength != MAXULONG) && - ((NtInitialUserProcessBufferLength < sizeof(WCHAR)) || - (NtInitialUserProcessBufferLength > - sizeof(NtInitialUserProcessBuffer) - sizeof(WCHAR))))) - { - /* Invalid initial process string, bugcheck */ - return STATUS_INVALID_PARAMETER; - } - - /* Cut out anything after a space */ - p = NtInitialUserProcessBuffer; - while ((*p) && (*p != L' ')) p++; - - /* Set the image path length */ - ProcessParams->ImagePathName.Length = - (USHORT)((PCHAR)p - (PCHAR)NtInitialUserProcessBuffer); - - /* Copy the actual buffer */ - RtlCopyMemory(ProcessParams->ImagePathName.Buffer, - NtInitialUserProcessBuffer, - ProcessParams->ImagePathName.Length); - - /* Null-terminate it */ - ProcessParams->ImagePathName.Buffer[ProcessParams->ImagePathName.Length / - sizeof(WCHAR)] = UNICODE_NULL; - - /* Make a buffer for the command line */ - p = (PWSTR)((PCHAR)ProcessParams->ImagePathName.Buffer + - ProcessParams->ImagePathName.MaximumLength); - ProcessParams->CommandLine.Buffer = p; - ProcessParams->CommandLine.MaximumLength = MAX_PATH * sizeof(WCHAR); - - /* Add the image name to the command line */ - RtlAppendUnicodeToString(&ProcessParams->CommandLine, - NtInitialUserProcessBuffer); - - /* Create the environment string */ - ProcessParams->Environment = SmpDefaultEnvironment; - - /* Create SMSS process */ - SmssName = ProcessParams->ImagePathName; - Status = RtlCreateUserProcess(&SmssName, - OBJ_CASE_INSENSITIVE, - RtlDeNormalizeProcessParams(ProcessParams), - NULL, - NULL, - NULL, - FALSE, - NULL, - NULL, - ProcessInformation); - if (!NT_SUCCESS(Status)) - { - /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), - L"INIT: Unable to create Session Manager. 0x%lx", - Status); - RtlInitUnicodeString(&DebugString, p); - ZwDisplayString(&DebugString); - - /* Bugcheck the system */ - return Status; - } - - /* Resume the thread */ - Status = ZwResumeThread(ProcessInformation->ThreadHandle, NULL); - if (!NT_SUCCESS(Status)) - { - /* Failed, display error */ - p = InitBuffer->DebugBuffer; - _snwprintf(p, - 256 * sizeof(WCHAR), - L"INIT: Unable to resume Session Manager. 0x%lx", - Status); - RtlInitUnicodeString(&DebugString, p); - ZwDisplayString(&DebugString); - - /* Bugcheck the system */ - return Status; - } - - /* Return success */ - *ProcessParameters = ProcessParams; - *ProcessEnvironment = EnvironmentPtr; - return STATUS_SUCCESS; -} - -NTSTATUS -NTAPI -LaunchOldSmss(VOID) -{ - PINIT_BUFFER InitBuffer; - PRTL_USER_PROCESS_PARAMETERS ProcessParameters = NULL; - PRTL_USER_PROCESS_INFORMATION ProcessInfo; - NTSTATUS Status; - PCHAR Environment; - - /* Initialize the system root */ - RtlInitUnicodeString(&SmpSystemRoot, SharedUserData->NtSystemRoot); - - /* Allocate the initialization buffer */ - InitBuffer = RtlAllocateHeap(RtlGetProcessHeap(), 0, sizeof(INIT_BUFFER)); - if (!InitBuffer) - { - /* Bugcheck */ - return STATUS_NO_MEMORY; - } - - /* Launch initial process */ - ProcessInfo = &InitBuffer->ProcessInfo; - Status = ExpLoadInitialProcess(InitBuffer, &ProcessParameters, &Environment); - if (!NT_SUCCESS(Status)) - { - /* Failed, display error */ - DPRINT1("INIT: Session Manager failed to load.\n"); - return Status; - } - - /* Return the handle and status */ - return Status; -} - -NTSTATUS -NTAPI SmpTerminate(IN PULONG_PTR Parameters, IN ULONG ParameterMask, IN ULONG ParameterCount) @@ -719,8 +479,6 @@ /* Enter SEH so we can terminate correctly if anything goes wrong */ _SEH2_TRY { - LARGE_INTEGER Infinite = {{0x80000000, 0x7FFFFFFF}}; - /* Initialize SMSS */ Status = SmpInit(&InitialCommand, Handles); if (!NT_SUCCESS(Status)) @@ -728,11 +486,7 @@ DPRINT1("SMSS: SmpInit return failure - Status == %x\n", Status); RtlInitUnicodeString(&DbgString, L"Session Manager Initialization"); Parameters[1] = Status; - DPRINT1("SMSS-2 Loaded... Launching original SMSS\n"); - //_SEH2_LEAVE; Hack so that setup can work. will go away later - Status = LaunchOldSmss(); - if (!NT_SUCCESS(Status)) return Status; - return NtDelayExecution(FALSE, &Infinite); + _SEH2_LEAVE; }
/* Get the global flags */ @@ -758,11 +512,7 @@ RtlInitUnicodeString(&DbgString, L"Session Manager ExecuteInitialCommand"); Parameters[1] = Status; - //_SEH2_LEAVE; - DPRINT1("SMSS-2 Loaded... Launching original SMSS\n"); - Status = LaunchOldSmss(); - if (!NT_SUCCESS(Status)) return Status; - return NtDelayExecution(FALSE, &Infinite); + _SEH2_LEAVE; }
/* Check if we're already attached to a session */
Modified: trunk/reactos/base/system/smss2/smss2.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss2/smss2.rbu... ============================================================================== --- trunk/reactos/base/system/smss2/smss2.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/system/smss2/smss2.rbuild [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -1,8 +1,7 @@ <?xml version="1.0"?> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> -<module name="smss2" type="nativecui" installbase="system32" installname="smss2.exe"> - <bootstrap installbase="$(CDOUTPUT)/system32" /> - <include base="smss2">.</include> +<module name="smss" type="nativecui" installbase="system32" installname="smss.exe"> + <include base="smss">.</include> <include base="ReactOS">include/reactos/subsys</include> <library>nt</library> <library>pseh</library>
Modified: trunk/reactos/base/system/system.rbuild URL: http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/system.rbuild?r... ============================================================================== --- trunk/reactos/base/system/system.rbuild [iso-8859-1] (original) +++ trunk/reactos/base/system/system.rbuild [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -37,9 +37,6 @@ <directory name="services"> <xi:include href="services/services.rbuild" /> </directory> - <directory name="smss"> - <xi:include href="smss/smss.rbuild" /> - </directory> <directory name="smss2"> <xi:include href="smss2/smss2.rbuild" /> </directory>
Modified: trunk/reactos/boot/bootdata/packages/reactos.dff URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/packages/reac... ============================================================================== --- trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/packages/reactos.dff [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -127,8 +127,7 @@ base\system\rundll32\rundll32.exe 1 base\system\runonce\runonce.exe 1 base\system\services\services.exe 1 -base\system\smss\smss.exe 1 -base\system\smss2\smss2.exe 1 +base\system\smss2\smss.exe 1 base\system\userinit\userinit.exe 1 base\system\winlogon\winlogon.exe 1
Modified: trunk/reactos/boot/bootdata/txtsetup.sif URL: http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/txtsetup.sif?... ============================================================================== --- trunk/reactos/boot/bootdata/txtsetup.sif [iso-8859-1] (original) +++ trunk/reactos/boot/bootdata/txtsetup.sif [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -58,7 +58,6 @@ pcmcia.sys=,,,,,,,,,,,,4 swenum.sys=,,,,,,,,,,,,4 ntdll.dll=,,,,,,,,,,,,2 -smss2.exe=,,,,,,,,,,,,2
[HardwareIdsDatabase] ;*PNP0A00 = isapnp
Modified: trunk/reactos/ntoskrnl/ex/init.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/init.c?rev=5558... ============================================================================== --- trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] (original) +++ trunk/reactos/ntoskrnl/ex/init.c [iso-8859-1] Tue Feb 14 06:06:39 2012 @@ -66,7 +66,7 @@ UNICODE_STRING NtSystemRoot;
/* NT Initial User Application */ -WCHAR NtInitialUserProcessBuffer[128] = L"\SystemRoot\System32\smss2.exe"; +WCHAR NtInitialUserProcessBuffer[128] = L"\SystemRoot\System32\smss.exe"; ULONG NtInitialUserProcessBufferLength = sizeof(NtInitialUserProcessBuffer) - sizeof(WCHAR); ULONG NtInitialUserProcessBufferType = REG_SZ;