Author: ekohl
Date: Sun May 23 19:28:06 2010
New Revision: 47330
URL:
http://svn.reactos.org/svn/reactos?rev=47330&view=rev
Log:
[SMSS]
- Remove the system environment variable PROCESSOR_ARCHITECTURE from the hivesys*.inf
files.
- Let SMSS add the system environment variables PROCESSOR_ARCHITECTURE and
PROCESSOR_IDENTIFIER to the registry.
Modified:
trunk/reactos/base/system/smss/initenv.c
trunk/reactos/boot/bootdata/hivesys_arm.inf
trunk/reactos/boot/bootdata/hivesys_i386.inf
Modified: trunk/reactos/base/system/smss/initenv.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/system/smss/initenv.c…
==============================================================================
--- trunk/reactos/base/system/smss/initenv.c [iso-8859-1] (original)
+++ trunk/reactos/base/system/smss/initenv.c [iso-8859-1] Sun May 23 19:28:06 2010
@@ -29,7 +29,7 @@
static NTSTATUS
SmpSetEnvironmentVariable(IN PVOID Context,
IN PWSTR ValueName,
- IN PVOID ValueData)
+ IN PWSTR ValueData)
{
UNICODE_STRING EnvVariable;
UNICODE_STRING EnvValue;
@@ -37,7 +37,7 @@
RtlInitUnicodeString(&EnvVariable,
ValueName);
RtlInitUnicodeString(&EnvValue,
- (PWSTR)ValueData);
+ ValueData);
return RtlSetEnvironmentVariable(Context,
&EnvVariable,
&EnvValue);
@@ -58,12 +58,93 @@
return STATUS_SUCCESS;
DPRINT("ValueData '%S'\n", (PWSTR)ValueData);
- return SmpSetEnvironmentVariable(Context,ValueName,ValueData);
+ return SmpSetEnvironmentVariable(Context,ValueName,(PWSTR)ValueData);
}
NTSTATUS
SmSetEnvironmentVariables(VOID)
+{
+ PWSTR ProcessorArchitecture = L"";
+ RTL_QUERY_REGISTRY_TABLE QueryTable[3];
+ UNICODE_STRING Identifier;
+ UNICODE_STRING VendorIdentifier;
+ UNICODE_STRING ProcessorIdentifier;
+ WCHAR Buffer[256];
+ NTSTATUS Status;
+
+ /* Set the 'PROCESSOR_ARCHITECTURE' system environment variable */
+#ifdef _M_IX86
+ ProcessorArchitecture = L"x86";
+#elif _M_MD64
+ ProcessorArchitecture = L"AMD64";
+#elif _M_ARM
+ ProcessorArchitecture = L"ARM";
+#elif _M_PPC
+ ProcessorArchitecture = L"PPC";
+#else
+ #error "Unsupported Architecture!\n"
+#endif
+
+ RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
+ L"Session Manager\\Environment",
+ L"PROCESSOR_ARCHITECTURE",
+ REG_SZ,
+ ProcessorArchitecture,
+ (wcslen(ProcessorArchitecture) + 1) * sizeof(WCHAR));
+
+
+ /* Set the 'PROCESSOR_IDENTIFIER' system environment variable */
+ RtlInitUnicodeString(&Identifier, NULL);
+ RtlInitUnicodeString(&VendorIdentifier, NULL);
+
+ RtlZeroMemory(&QueryTable,
+ sizeof(QueryTable));
+
+ QueryTable[0].Flags = RTL_QUERY_REGISTRY_DIRECT;
+ QueryTable[0].Name = L"Identifier";
+ QueryTable[0].EntryContext = &Identifier;
+
+ QueryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT;
+ QueryTable[1].Name = L"VendorIdentifier";
+ QueryTable[1].EntryContext = &VendorIdentifier;
+
+ Status = RtlQueryRegistryValues(RTL_REGISTRY_ABSOLUTE,
+
L"\\Registry\\Machine\\Hardware\\Description\\System\\CentralProcessor\\0",
+ QueryTable,
+ NULL,
+ NULL);
+ if (NT_SUCCESS(Status))
+ {
+ DPRINT("SM: szIdentifier: %wZ\n", &Identifier);
+ DPRINT("SM: szVendorIdentifier: %wZ\n", &VendorIdentifier);
+
+ RtlInitEmptyUnicodeString(&ProcessorIdentifier, Buffer, 256 *
sizeof(WCHAR));
+
+ RtlAppendUnicodeStringToString(&ProcessorIdentifier, &Identifier);
+ RtlAppendUnicodeToString(&ProcessorIdentifier, L", ");
+ RtlAppendUnicodeStringToString(&ProcessorIdentifier, &VendorIdentifier);
+
+ RtlWriteRegistryValue(RTL_REGISTRY_CONTROL,
+ L"Session Manager\\Environment",
+ L"PROCESSOR_IDENTIFIER",
+ REG_SZ,
+ ProcessorIdentifier.Buffer,
+ (wcslen(ProcessorIdentifier.Buffer) + 1) * sizeof(WCHAR));
+ }
+
+ RtlFreeUnicodeString(&Identifier);
+ RtlFreeUnicodeString(&VendorIdentifier);
+
+ return STATUS_SUCCESS;
+}
+
+
+/**********************************************************************
+ * Set environment variables from registry
+ */
+NTSTATUS
+SmUpdateEnvironment(VOID)
{
RTL_QUERY_REGISTRY_TABLE QueryTable[2];
WCHAR ValueBuffer[MAX_PATH];
@@ -106,14 +187,4 @@
return Status;
}
-/**********************************************************************
- * Set environment variables from registry
- */
-NTSTATUS
-SmUpdateEnvironment(VOID)
-{
- /* TODO */
- return STATUS_SUCCESS;
-}
-
/* EOF */
Modified: trunk/reactos/boot/bootdata/hivesys_arm.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_arm.…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesys_arm.inf [iso-8859-1] Sun May 23 19:28:06 2010
@@ -760,7 +760,6 @@
HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","TEMP",0x00020000,"%SystemDrive%\TEMP"
HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","TMP",0x00020000,"%SystemDrive%\TEMP"
HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","PATHEXT",0x00020000,".COM;.EXE;.BAT;.CMD"
-HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","PROCESSOR_ARCHITECTURE",0x00020000,"x86"
; Known DLLs
Modified: trunk/reactos/boot/bootdata/hivesys_i386.inf
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/boot/bootdata/hivesys_i386…
==============================================================================
--- trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] (original)
+++ trunk/reactos/boot/bootdata/hivesys_i386.inf [iso-8859-1] Sun May 23 19:28:06 2010
@@ -907,7 +907,6 @@
HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","TEMP",0x00020000,"%SystemDrive%\TEMP"
HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","TMP",0x00020000,"%SystemDrive%\TEMP"
HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","PATHEXT",0x00020000,".COM;.EXE;.BAT;.CMD"
-HKLM,"SYSTEM\CurrentControlSet\Control\Session
Manager\Environment","PROCESSOR_ARCHITECTURE",0x00020000,"x86"
; Known DLLs