[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
This commit is contained in:
Alex Ionescu 2012-02-06 09:29:33 +00:00
parent b207b33d11
commit ed64af75b6
16 changed files with 38 additions and 53 deletions

View 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 */

View file

@ -12,6 +12,7 @@
#define NDEBUG
#include <debug.h>
#if 0
/* GLOBALS ***********************************************************/
@ -164,5 +165,7 @@ SmInitializeDbgSs (VOID)
return STATUS_SUCCESS;
}
#endif
/* EOF */

View 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"},

View 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 */

View 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 */

View file

@ -12,6 +12,7 @@
#define NDEBUG
#include <debug.h>
#if 0
/* FUNCTIONS *****************************************************************/
@ -446,4 +447,6 @@ SmProcessFileRenameList( VOID )
return (STATUS_SUCCESS);
}
#endif
/* EOF */

View 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 */

View 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 */

View 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 */

View 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 */

View 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 */

View 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 */

View 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

View 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! */

View 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 */

View 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;