[SMSS]: Nuke the environment code and instead inherit SMSS2's, which does all the...
authorAlex Ionescu <aionescu@gmail.com>
Mon, 6 Feb 2012 09:29:33 +0000 (09:29 +0000)
committerAlex Ionescu <aionescu@gmail.com>
Mon, 6 Feb 2012 09:29:33 +0000 (09:29 +0000)
[SMSS2]: Use SMSS2's environment when creating SMSS.

svn path=/trunk/; revision=55455

16 files changed:
reactos/base/system/smss/client.c
reactos/base/system/smss/debug.c
reactos/base/system/smss/init.c
reactos/base/system/smss/initdosdev.c
reactos/base/system/smss/initenv.c
reactos/base/system/smss/initmv.c
reactos/base/system/smss/initobdir.c
reactos/base/system/smss/initpage.c
reactos/base/system/smss/initreg.c
reactos/base/system/smss/initrun.c
reactos/base/system/smss/initwkdll.c
reactos/base/system/smss/print.c
reactos/base/system/smss/smapi.c
reactos/base/system/smss/smapiexec.c
reactos/base/system/smss/smapiquery.c
reactos/base/system/smss2/smss.c

index 5dee542..97b54e3 100644 (file)
@@ -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 */
index 658a00f..a92a947 100644 (file)
@@ -12,6 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
 
 /* GLOBALS ***********************************************************/
 
@@ -164,5 +165,7 @@ SmInitializeDbgSs (VOID)
        return STATUS_SUCCESS;
 }
 
+#endif
+
 /* EOF */
 
index 54678f4..48a60fc 100644 (file)
@@ -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"},
index a8ed20a..a0fc387 100644 (file)
@@ -12,6 +12,8 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
+
 static NTSTATUS NTAPI
 SmpDosDevicesQueryRoutine(PWSTR ValueName,
                         ULONG ValueType,
@@ -89,4 +91,6 @@ SmInitDosDevices(VOID)
   return(Status);
 }
 
+#endif
+
 /* EOF */
index 21874e3..4f3a581 100644 (file)
@@ -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 */
index aa69d14..e864550 100644 (file)
@@ -12,6 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
 
 /* FUNCTIONS *****************************************************************/
 
@@ -446,4 +447,6 @@ SmProcessFileRenameList( VOID )
        return (STATUS_SUCCESS);
 }
 
+#endif
+
 /* EOF */
index f90d973..721910e 100644 (file)
@@ -12,6 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
 static NTSTATUS NTAPI
 SmpObjectDirectoryQueryRoutine(PWSTR ValueName,
                              ULONG ValueType,
@@ -69,5 +70,6 @@ SmCreateObjectDirectories(VOID)
 
   return(Status);
 }
+#endif
 
 /* EOF */
index 3123761..ab1fc07 100644 (file)
@@ -12,6 +12,8 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
+
 #define GIGABYTE (1024 * 1024 * 1024) /* One Gigabyte */
 
 static NTSTATUS NTAPI
@@ -520,6 +522,6 @@ SmCreatePagingFiles(VOID)
 
     return Status;
 }
-
+#endif
 
 /* EOF */
index 14f0adc..9cb154a 100644 (file)
@@ -12,6 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
 NTSTATUS
 SmInitializeRegistry(VOID)
 {
@@ -20,5 +21,6 @@ SmInitializeRegistry(VOID)
   /* Load remaining registry hives */
   return NtInitializeRegistry(CM_BOOT_FLAG_SMSS);
 }
+#endif
 
 /* EOF */
index e656bd2..7f672f0 100644 (file)
@@ -12,6 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
 //HANDLE Children[2] = {0, 0}; /* csrss, winlogon */
 
 
@@ -223,6 +224,6 @@ SmRunBootApplications(VOID)
 
   return(Status);
 }
-
+#endif
 
 /* EOF */
index ba73626..9b44542 100644 (file)
@@ -12,6 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
+#if 0
 static NTSTATUS NTAPI
 SmpKnownDllsQueryRoutine(PWSTR ValueName,
                        ULONG ValueType,
@@ -236,6 +237,6 @@ SmLoadKnownDlls(VOID)
 
   return Status;
 }
-
+#endif
 
 /* EOF */
index 3bf6535..25e13f2 100644 (file)
@@ -12,6 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
+#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 */
index 669c8ed..681a9c1 100644 (file)
@@ -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
index 8fef565..9d0afe0 100644 (file)
@@ -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! */
index b80c429..a9a02f4 100644 (file)
@@ -12,7 +12,7 @@
 #define NDEBUG
 #include <debug.h>
 
-
+#if 0
 /**********************************************************************
  * SmQryInfo/1                                                 API
  */
@@ -50,6 +50,6 @@ SMAPI(SmQryInfo)
        }
        return Status;
 }
-
+#endif
 
 /* EOF */
index e661c12..5bc5b91 100644 (file)
@@ -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;