From ed64af75b627f8ece6bdca6d61e5efa0bf2eb555 Mon Sep 17 00:00:00 2001 From: Alex Ionescu Date: Mon, 6 Feb 2012 09:29:33 +0000 Subject: [PATCH] [SMSS]: Nuke the environment code and instead inherit SMSS2's, which does all the right things. #if 0 all the non-used code, and nuke support for the "debug" subsystem as well as the custom "SmQuery" APIs. [SMSS2]: Use SMSS2's environment when creating SMSS. svn path=/trunk/; revision=55455 --- reactos/base/system/smss/client.c | 4 ++-- reactos/base/system/smss/debug.c | 3 +++ reactos/base/system/smss/init.c | 2 +- reactos/base/system/smss/initdosdev.c | 4 ++++ reactos/base/system/smss/initenv.c | 10 +++++----- reactos/base/system/smss/initmv.c | 3 +++ reactos/base/system/smss/initobdir.c | 2 ++ reactos/base/system/smss/initpage.c | 4 +++- reactos/base/system/smss/initreg.c | 2 ++ reactos/base/system/smss/initrun.c | 3 ++- reactos/base/system/smss/initwkdll.c | 3 ++- reactos/base/system/smss/print.c | 2 ++ reactos/base/system/smss/smapi.c | 2 +- reactos/base/system/smss/smapiexec.c | 18 ++---------------- reactos/base/system/smss/smapiquery.c | 4 ++-- reactos/base/system/smss2/smss.c | 25 ++----------------------- 16 files changed, 38 insertions(+), 53 deletions(-) diff --git a/reactos/base/system/smss/client.c b/reactos/base/system/smss/client.c index 5dee5421af4..97b54e32220 100644 --- a/reactos/base/system/smss/client.c +++ b/reactos/base/system/smss/client.c @@ -500,7 +500,7 @@ SmDestroyClient (ULONG SubsystemId) RtlLeaveCriticalSection (& SmpClientDirectory.Lock); return Status; } - +#if 0 /* === Utilities for SmQryInfo === */ /********************************************************************** @@ -566,5 +566,5 @@ SmGetSubSystemInformation (PSM_SUBSYSTEM_INFORMATION i) RtlLeaveCriticalSection (& SmpClientDirectory.Lock); return Status; } - +#endif /* EOF */ diff --git a/reactos/base/system/smss/debug.c b/reactos/base/system/smss/debug.c index 658a00f5649..a92a947c103 100644 --- a/reactos/base/system/smss/debug.c +++ b/reactos/base/system/smss/debug.c @@ -12,6 +12,7 @@ #define NDEBUG #include +#if 0 /* GLOBALS ***********************************************************/ @@ -164,5 +165,7 @@ SmInitializeDbgSs (VOID) return STATUS_SUCCESS; } +#endif + /* EOF */ diff --git a/reactos/base/system/smss/init.c b/reactos/base/system/smss/init.c index 54678f4ffc1..48a60fc14b9 100644 --- a/reactos/base/system/smss/init.c +++ b/reactos/base/system/smss/init.c @@ -30,7 +30,7 @@ struct { // {TRUE, SmInitDosDevices, "create dos device links"}, // {TRUE, SmRunBootApplications, "run boot applications"}, // {TRUE, SmProcessFileRenameList, "process the file rename list"}, - {FALSE, SmUpdateEnvironment, "update environment variables"}, +// {FALSE, SmUpdateEnvironment, "update environment variables"}, // {FALSE, SmLoadKnownDlls, "preload system DLLs"}, // {TRUE, SmCreatePagingFiles, "create paging files"}, // {TRUE, SmInitializeRegistry, "initialize the registry"}, diff --git a/reactos/base/system/smss/initdosdev.c b/reactos/base/system/smss/initdosdev.c index a8ed20adfb7..a0fc387201f 100644 --- a/reactos/base/system/smss/initdosdev.c +++ b/reactos/base/system/smss/initdosdev.c @@ -12,6 +12,8 @@ #define NDEBUG #include +#if 0 + static NTSTATUS NTAPI SmpDosDevicesQueryRoutine(PWSTR ValueName, ULONG ValueType, @@ -89,4 +91,6 @@ SmInitDosDevices(VOID) return(Status); } +#endif + /* EOF */ diff --git a/reactos/base/system/smss/initenv.c b/reactos/base/system/smss/initenv.c index 21874e366ff..4f3a581a26a 100644 --- a/reactos/base/system/smss/initenv.c +++ b/reactos/base/system/smss/initenv.c @@ -22,10 +22,12 @@ PWSTR SmSystemEnvironment = NULL; NTSTATUS SmCreateEnvironment(VOID) { - return RtlCreateEnvironment(FALSE, &SmSystemEnvironment); + return RtlCreateEnvironment(TRUE, &SmSystemEnvironment); } +#if 0 + static NTSTATUS SmpSetEnvironmentVariable(IN PVOID Context, IN PWSTR ValueName, @@ -61,7 +63,6 @@ SmpEnvironmentQueryRoutine(IN PWSTR ValueName, return SmpSetEnvironmentVariable(Context,ValueName,(PWSTR)ValueData); } - NTSTATUS SmSetEnvironmentVariables(VOID) { @@ -280,14 +281,13 @@ done: return Status; } - /********************************************************************** * Set environment variables from registry */ NTSTATUS SmUpdateEnvironment(VOID) { - RTL_QUERY_REGISTRY_TABLE QueryTable[2]; + //RTL_QUERY_REGISTRY_TABLE QueryTable[2]; WCHAR ValueBuffer[MAX_PATH]; NTSTATUS Status; #ifndef NDEBUG @@ -343,5 +343,5 @@ SmUpdateEnvironment(VOID) return Status; } - +#endif /* EOF */ diff --git a/reactos/base/system/smss/initmv.c b/reactos/base/system/smss/initmv.c index aa69d14f9af..e864550a1e5 100644 --- a/reactos/base/system/smss/initmv.c +++ b/reactos/base/system/smss/initmv.c @@ -12,6 +12,7 @@ #define NDEBUG #include +#if 0 /* FUNCTIONS *****************************************************************/ @@ -446,4 +447,6 @@ SmProcessFileRenameList( VOID ) return (STATUS_SUCCESS); } +#endif + /* EOF */ diff --git a/reactos/base/system/smss/initobdir.c b/reactos/base/system/smss/initobdir.c index f90d973d7db..721910e2b61 100644 --- a/reactos/base/system/smss/initobdir.c +++ b/reactos/base/system/smss/initobdir.c @@ -12,6 +12,7 @@ #define NDEBUG #include +#if 0 static NTSTATUS NTAPI SmpObjectDirectoryQueryRoutine(PWSTR ValueName, ULONG ValueType, @@ -69,5 +70,6 @@ SmCreateObjectDirectories(VOID) return(Status); } +#endif /* EOF */ diff --git a/reactos/base/system/smss/initpage.c b/reactos/base/system/smss/initpage.c index 3123761b4cc..ab1fc0735a7 100644 --- a/reactos/base/system/smss/initpage.c +++ b/reactos/base/system/smss/initpage.c @@ -12,6 +12,8 @@ #define NDEBUG #include +#if 0 + #define GIGABYTE (1024 * 1024 * 1024) /* One Gigabyte */ static NTSTATUS NTAPI @@ -520,6 +522,6 @@ SmCreatePagingFiles(VOID) return Status; } - +#endif /* EOF */ diff --git a/reactos/base/system/smss/initreg.c b/reactos/base/system/smss/initreg.c index 14f0adc38b9..9cb154abe8c 100644 --- a/reactos/base/system/smss/initreg.c +++ b/reactos/base/system/smss/initreg.c @@ -12,6 +12,7 @@ #define NDEBUG #include +#if 0 NTSTATUS SmInitializeRegistry(VOID) { @@ -20,5 +21,6 @@ SmInitializeRegistry(VOID) /* Load remaining registry hives */ return NtInitializeRegistry(CM_BOOT_FLAG_SMSS); } +#endif /* EOF */ diff --git a/reactos/base/system/smss/initrun.c b/reactos/base/system/smss/initrun.c index e656bd22fa6..7f672f0777c 100644 --- a/reactos/base/system/smss/initrun.c +++ b/reactos/base/system/smss/initrun.c @@ -12,6 +12,7 @@ #define NDEBUG #include +#if 0 //HANDLE Children[2] = {0, 0}; /* csrss, winlogon */ @@ -223,6 +224,6 @@ SmRunBootApplications(VOID) return(Status); } - +#endif /* EOF */ diff --git a/reactos/base/system/smss/initwkdll.c b/reactos/base/system/smss/initwkdll.c index ba73626ee48..9b44542564d 100644 --- a/reactos/base/system/smss/initwkdll.c +++ b/reactos/base/system/smss/initwkdll.c @@ -12,6 +12,7 @@ #define NDEBUG #include +#if 0 static NTSTATUS NTAPI SmpKnownDllsQueryRoutine(PWSTR ValueName, ULONG ValueType, @@ -236,6 +237,6 @@ SmLoadKnownDlls(VOID) return Status; } - +#endif /* EOF */ diff --git a/reactos/base/system/smss/print.c b/reactos/base/system/smss/print.c index 3bf6535031f..25e13f20751 100644 --- a/reactos/base/system/smss/print.c +++ b/reactos/base/system/smss/print.c @@ -12,6 +12,7 @@ #define NDEBUG #include +#if 0 VOID NTAPI DisplayString(LPCWSTR lpwString) { UNICODE_STRING us; @@ -39,5 +40,6 @@ VOID NTAPI PrintString (char* fmt, ...) NtDisplayString(&UnicodeString); RtlFreeUnicodeString (&UnicodeString); } +#endif /* EOF */ diff --git a/reactos/base/system/smss/smapi.c b/reactos/base/system/smss/smapi.c index 669c8ed755b..681a9c1508a 100644 --- a/reactos/base/system/smss/smapi.c +++ b/reactos/base/system/smss/smapi.c @@ -35,7 +35,7 @@ SM_PORT_API SmApi [] = SmInvalid, /* obsolete */ SmInvalid, /* unknown */ SmExecPgm, /* smapiexec.c */ - SmQryInfo /* smapyqry.c */ + SmInvalid /* smapyqry.c */ }; /* TODO: optimize this address computation (it should be done diff --git a/reactos/base/system/smss/smapiexec.c b/reactos/base/system/smss/smapiexec.c index 8fef5654a72..9d0afe02e20 100644 --- a/reactos/base/system/smss/smapiexec.c +++ b/reactos/base/system/smss/smapiexec.c @@ -263,23 +263,9 @@ SMAPI(SmExecPgm) else { /* - * OK, the definition is empty, but check - * if it is the name of an embedded subsystem. + * Badly defined subsystem. Check the registry! */ - if(0 == _wcsicmp(L"DEBUG", Name)) - { - /* - * Initialize the embedded DBGSS. - */ - Request->SmHeader.Status = SmInitializeDbgSs(); - } - else - { - /* - * Badly defined subsystem. Check the registry! - */ - Request->SmHeader.Status = STATUS_NOT_FOUND; - } + Request->SmHeader.Status = STATUS_NOT_FOUND; } } else { /* It couldn't lookup the Name! */ diff --git a/reactos/base/system/smss/smapiquery.c b/reactos/base/system/smss/smapiquery.c index b80c429acc5..a9a02f40d2b 100644 --- a/reactos/base/system/smss/smapiquery.c +++ b/reactos/base/system/smss/smapiquery.c @@ -12,7 +12,7 @@ #define NDEBUG #include - +#if 0 /********************************************************************** * SmQryInfo/1 API */ @@ -50,6 +50,6 @@ SMAPI(SmQryInfo) } return Status; } - +#endif /* EOF */ diff --git a/reactos/base/system/smss2/smss.c b/reactos/base/system/smss2/smss.c index e661c123804..5bc5b91a8a1 100644 --- a/reactos/base/system/smss2/smss.c +++ b/reactos/base/system/smss2/smss.c @@ -305,7 +305,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer, SIZE_T Size; PWSTR p; UNICODE_STRING NullString = RTL_CONSTANT_STRING(L""); - UNICODE_STRING SmssName, Environment, SystemDriveString, DebugString; + UNICODE_STRING SmssName, DebugString; PVOID EnvironmentPtr = NULL; PRTL_USER_PROCESS_INFORMATION ProcessInformation; PRTL_USER_PROCESS_PARAMETERS ProcessParams = NULL; @@ -436,28 +436,7 @@ ExpLoadInitialProcess(IN PINIT_BUFFER InitBuffer, NtInitialUserProcessBuffer); /* Create the environment string */ - RtlInitEmptyUnicodeString(&Environment, - ProcessParams->Environment, - (USHORT)Size); - - /* Append the DLL path to it */ - RtlAppendUnicodeToString(&Environment, L"Path="); - RtlAppendUnicodeStringToString(&Environment, &ProcessParams->DllPath); - RtlAppendUnicodeStringToString(&Environment, &NullString); - - /* Create the system drive string */ - SystemDriveString = SmpSystemRoot; - SystemDriveString.Length = 2 * sizeof(WCHAR); - - /* Append it to the environment */ - RtlAppendUnicodeToString(&Environment, L"SystemDrive="); - RtlAppendUnicodeStringToString(&Environment, &SystemDriveString); - RtlAppendUnicodeStringToString(&Environment, &NullString); - - /* Append the system root to the environment */ - RtlAppendUnicodeToString(&Environment, L"SystemRoot="); - RtlAppendUnicodeStringToString(&Environment, &SmpSystemRoot); - RtlAppendUnicodeStringToString(&Environment, &NullString); + ProcessParams->Environment = SmpDefaultEnvironment; /* Create SMSS process */ SmssName = ProcessParams->ImagePathName;