[ros-diffs] [greatlrd] 21742: [AUDIT] after looking through code no signs of reverse engineering were found. BUG 1436 patch from w3seek : SMSS: make \SystemRoot\System32 the current directory for started subsystems

greatlrd at svn.reactos.org greatlrd at svn.reactos.org
Wed Apr 26 06:49:11 CEST 2006


Author: greatlrd
Date: Wed Apr 26 08:49:11 2006
New Revision: 21742

URL: http://svn.reactos.ru/svn/reactos?rev=21742&view=rev
Log:
[AUDIT] after looking through code no signs of reverse engineering were found.
BUG 1436 patch from w3seek : SMSS: make \SystemRoot\System32 the current directory for started subsystems

Modified:
    trunk/reactos/base/system/smss/smapicomp.c   (props changed)
    trunk/reactos/base/system/smss/smapiexec.c   (contents, props changed)
    trunk/reactos/base/system/smss/smss.c   (props changed)

Propchange: trunk/reactos/base/system/smss/smapicomp.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*

Modified: trunk/reactos/base/system/smss/smapiexec.c
URL: http://svn.reactos.ru/svn/reactos/trunk/reactos/base/system/smss/smapiexec.c?rev=21742&r1=21741&r2=21742&view=diff
==============================================================================
--- trunk/reactos/base/system/smss/smapiexec.c (original)
+++ trunk/reactos/base/system/smss/smapiexec.c Wed Apr 26 08:49:11 2006
@@ -27,6 +27,8 @@
 
 #define NDEBUG
 #include <debug.h>
+
+static const WCHAR szSystemDirectory[] = L"\\System32";
 
 /**********************************************************************
  * SmCreateUserProcess/5
@@ -55,6 +57,7 @@
 {
 	UNICODE_STRING			ImagePathString = {0};
 	UNICODE_STRING			CommandLineString = {0};
+        UNICODE_STRING			SystemDirectory = {0};
 	PRTL_USER_PROCESS_PARAMETERS	ProcessParameters = NULL;
 	RTL_USER_PROCESS_INFORMATION		ProcessInfo = {0};
 	PRTL_USER_PROCESS_INFORMATION		pProcessInfo = & ProcessInfo;
@@ -70,16 +73,55 @@
 	RtlInitUnicodeString (& ImagePathString, ImagePath);
 	RtlInitUnicodeString (& CommandLineString, CommandLine);
 
-	RtlCreateProcessParameters(& ProcessParameters,
-				   & ImagePathString,
-				   NULL,
-				   NULL,
-				   & CommandLineString,
-				   SmSystemEnvironment,
-				   NULL,
-				   NULL,
-				   NULL,
-				   NULL);
+	SystemDirectory.MaximumLength = (wcslen(SharedUserData->NtSystemRoot) * sizeof(WCHAR)) + sizeof(szSystemDirectory);
+	SystemDirectory.Buffer = RtlAllocateHeap(RtlGetProcessHeap(),
+						 0,
+						 SystemDirectory.MaximumLength);
+	if (SystemDirectory.Buffer == NULL)
+	{
+		Status = STATUS_NO_MEMORY;
+		DPRINT1("SM: %s: Allocating system directory string failed (Status=0x%08lx)\n",
+			__FUNCTION__, Status);
+		return Status;
+	}
+
+	Status = RtlAppendUnicodeToString(& SystemDirectory,
+					  SharedUserData->NtSystemRoot);
+	if (!NT_SUCCESS(Status))
+	{
+		goto FailProcParams;
+	}
+
+	Status = RtlAppendUnicodeToString(& SystemDirectory,
+					  szSystemDirectory);
+	if (!NT_SUCCESS(Status))
+	{
+		goto FailProcParams;
+	}
+
+
+	Status = RtlCreateProcessParameters(& ProcessParameters,
+					    & ImagePathString,
+					    NULL,
+					    & SystemDirectory,
+					    & CommandLineString,
+					    SmSystemEnvironment,
+					    NULL,
+					    NULL,
+					    NULL,
+					    NULL);
+
+	RtlFreeHeap(RtlGetProcessHeap(),
+		    0,
+		    SystemDirectory.Buffer);
+
+	if (!NT_SUCCESS(Status))
+	{
+FailProcParams:
+		DPRINT1("SM: %s: Creating process parameters failed (Status=0x%08lx)\n",
+			__FUNCTION__, Status);
+		return Status;
+	}
 
 	Status = RtlCreateUserProcess (& ImagePathString,
 				       OBJ_CASE_INSENSITIVE,

Propchange: trunk/reactos/base/system/smss/smapiexec.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*

Propchange: trunk/reactos/base/system/smss/smss.c
------------------------------------------------------------------------------
--- svn:needs-lock (original)
+++ svn:needs-lock (removed)
@@ -1,1 +1,0 @@
-*




More information about the Ros-diffs mailing list