Author: akhaldi
Date: Thu Jan 7 19:54:20 2016
New Revision: 70533
URL:
http://svn.reactos.org/svn/reactos?rev=70533&view=rev
Log:
[0.4.0] * Merge the smss fixes by Hermès in r70529.
Modified:
branches/ros-branch-0_4_0/ (props changed)
branches/ros-branch-0_4_0/reactos/ (props changed)
branches/ros-branch-0_4_0/reactos/base/system/smss/sminit.c
branches/ros-branch-0_4_0/reactos/base/system/smss/smloop.c
Propchange: branches/ros-branch-0_4_0/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 7 19:54:20 2016
@@ -1 +1 @@
-/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70436-70437,70443,70464,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70528
+/trunk:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70436-70437,70443,70464,70470,70480,70497,70499-70501,70507-70510,70512-70513,70523,70528-70529
Propchange: branches/ros-branch-0_4_0/reactos/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Thu Jan 7 19:54:20 2016
@@ -20,4 +20,4 @@
/branches/usb-bringup:51335,51337,51341-51343,51348,51350,51353,51355,51365-51369,51372,51384-54388,54396-54398,54736-54737,54752-54754,54756-54760,54762,54764-54765,54767-54768,54772,54774-54777,54781,54787,54790-54792,54797-54798,54806,54808,54834-54838,54843,54850,54852,54856,54858-54859
/branches/usb-bringup-trunk:55019-55543,55548-55554,55556-55567
/branches/wlan-bringup:54809-54998
-/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70436-70437,70443,70464,70470,70480,70497,70501,70507-70510,70523,70528
+/trunk/reactos:70000-70321,70323-70324,70328-70337,70339-70340,70347,70349,70354-70358,70360,70363,70369,70373,70375-70378,70381,70384-70385,70387-70389,70398,70400,70408,70424,70436-70437,70443,70464,70470,70480,70497,70501,70507-70510,70523,70528-70529
Modified: branches/ros-branch-0_4_0/reactos/base/system/smss/sminit.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/base/s…
==============================================================================
--- branches/ros-branch-0_4_0/reactos/base/system/smss/sminit.c [iso-8859-1] (original)
+++ branches/ros-branch-0_4_0/reactos/base/system/smss/sminit.c [iso-8859-1] Thu Jan 7
19:54:20 2016
@@ -38,7 +38,7 @@
PISECURITY_DESCRIPTOR SmpKnownDllsSecurityDescriptor, SmpApiPortSecurityDescriptor;
ULONG SmpAllowProtectedRenames, SmpProtectionMode = 1;
-BOOLEAN MiniNTBoot;
+BOOLEAN MiniNTBoot = FALSE;
#define SMSS_CHECKPOINT(x, y) \
{ \
@@ -325,7 +325,7 @@
}
/* Move to the next requested object */
- while (*SourceString++);
+ SourceString += wcslen(SourceString) + 1;
}
/* All done */
@@ -403,7 +403,7 @@
if (!(NT_SUCCESS(Status)) || (ValueType == REG_SZ)) return Status;
/* Otherwise, move to the next DLL name */
- while (*DllName++);
+ DllName += wcslen(DllName) + 1;
}
}
@@ -585,7 +585,7 @@
}
/* Move to the next name */
- while (*SubsystemName++);
+ SubsystemName += wcslen(SubsystemName) + 1;
}
}
@@ -1495,9 +1495,13 @@
NextEntry = SmpKnownDllsList.Flink;
while (NextEntry != &SmpKnownDllsList)
{
- /* Get the entry and skip it if it's in the exluded list */
+ /* Get the entry and move on */
RegEntry = CONTAINING_RECORD(NextEntry, SMP_REGISTRY_VALUE, Entry);
+ NextEntry = NextEntry->Flink;
+
DPRINT("Processing known DLL: %wZ-%wZ\n", &RegEntry->Name,
&RegEntry->Value);
+
+ /* Skip the entry if it's in the exluded list */
if ((SmpFindRegistryValue(&SmpExcludeKnownDllsList,
RegEntry->Name.Buffer)) ||
(SmpFindRegistryValue(&SmpExcludeKnownDllsList,
@@ -1512,14 +1516,15 @@
OBJ_CASE_INSENSITIVE,
DirFileHandle,
NULL);
- Status = NtOpenFile(&FileHandle,
- SYNCHRONIZE | FILE_EXECUTE,
- &ObjectAttributes,
- &IoStatusBlock,
- FILE_SHARE_READ | FILE_SHARE_DELETE,
- FILE_NON_DIRECTORY_FILE |
- FILE_SYNCHRONOUS_IO_NONALERT);
- if (!NT_SUCCESS(Status)) break;
+ Status1 = NtOpenFile(&FileHandle,
+ SYNCHRONIZE | FILE_EXECUTE,
+ &ObjectAttributes,
+ &IoStatusBlock,
+ FILE_SHARE_READ | FILE_SHARE_DELETE,
+ FILE_NON_DIRECTORY_FILE |
+ FILE_SYNCHRONOUS_IO_NONALERT);
+ /* If we failed, skip it */
+ if (!NT_SUCCESS(Status1)) continue;
/* Checksum it */
Status = LdrVerifyImageMatchesChecksum((HANDLE)((ULONG_PTR)FileHandle | 1),
@@ -1536,8 +1541,7 @@
ErrorParameters[2] = (ULONG)&RegEntry->Value;
SmpTerminate(ErrorParameters, 5, RTL_NUMBER_OF(ErrorParameters));
}
- else
- if (!(ImageCharacteristics & IMAGE_FILE_DLL))
+ else if (!(ImageCharacteristics & IMAGE_FILE_DLL))
{
/* An invalid known DLL entry will also kill SMSS */
RtlInitUnicodeString(&ErrorResponse,
@@ -1589,9 +1593,6 @@
/* Close the file since we can move on to the next one */
Status1 = NtClose(FileHandle);
ASSERT(NT_SUCCESS(Status1));
-
- /* Go to the next entry */
- NextEntry = NextEntry->Flink;
}
Quickie:
@@ -1652,7 +1653,7 @@
UNICODE_STRING ValueName, DestinationString;
HANDLE KeyHandle, KeyHandle2;
ULONG ResultLength;
- PWCHAR ArchName;
+ PWCHAR ValueData;
WCHAR ValueBuffer[512], ValueBuffer2[512];
PKEY_VALUE_PARTIAL_INFORMATION PartialInfo = (PVOID)ValueBuffer;
PKEY_VALUE_PARTIAL_INFORMATION PartialInfo2 = (PVOID)ValueBuffer2;
@@ -1700,13 +1701,14 @@
/* First let's write the OS variable */
RtlInitUnicodeString(&ValueName, L"OS");
- DPRINT("Setting %wZ to %S\n", &ValueName, L"Windows_NT");
+ ValueData = L"Windows_NT";
+ DPRINT("Setting %wZ to %S\n", &ValueName, ValueData);
Status = NtSetValueKey(KeyHandle,
&ValueName,
0,
REG_SZ,
- L"Windows_NT",
- wcslen(L"Windows_NT") * sizeof(WCHAR) +
sizeof(UNICODE_NULL));
+ ValueData,
+ (wcslen(ValueData) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Failed writing %wZ environment variable - %x\n",
@@ -1721,30 +1723,30 @@
{
/* Pick the correct string that matches the architecture */
case PROCESSOR_ARCHITECTURE_INTEL:
- ArchName = L"x86";
+ ValueData = L"x86";
break;
case PROCESSOR_ARCHITECTURE_AMD64:
- ArchName = L"AMD64";
+ ValueData = L"AMD64";
break;
case PROCESSOR_ARCHITECTURE_IA64:
- ArchName = L"IA64";
+ ValueData = L"IA64";
break;
default:
- ArchName = L"Unknown";
+ ValueData = L"Unknown";
break;
}
/* Set it */
- DPRINT("Setting %wZ to %S\n", &ValueName, ArchName);
+ DPRINT("Setting %wZ to %S\n", &ValueName, ValueData);
Status = NtSetValueKey(KeyHandle,
&ValueName,
0,
REG_SZ,
- ArchName,
- wcslen(ArchName) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
+ ValueData,
+ (wcslen(ValueData) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Failed writing %wZ environment variable - %x\n",
@@ -1762,7 +1764,7 @@
0,
REG_SZ,
ValueBuffer,
- wcslen(ValueBuffer) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
+ (wcslen(ValueBuffer) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Failed writing %wZ environment variable - %x\n",
@@ -1830,7 +1832,7 @@
0,
REG_SZ,
PartialInfo->Data,
- wcslen((PWCHAR)PartialInfo->Data) * sizeof(WCHAR) +
sizeof(UNICODE_NULL));
+ (wcslen((PWCHAR)PartialInfo->Data) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Failed writing %wZ environment variable - %x\n",
@@ -1872,7 +1874,7 @@
0,
REG_SZ,
ValueBuffer,
- wcslen(ValueBuffer) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
+ (wcslen(ValueBuffer) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Failed writing %wZ environment variable - %x\n",
@@ -1890,7 +1892,7 @@
0,
REG_SZ,
ValueBuffer,
- wcslen(ValueBuffer) * sizeof(WCHAR) + sizeof(UNICODE_NULL));
+ (wcslen(ValueBuffer) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Failed writing %wZ environment variable - %x\n",
@@ -1944,7 +1946,7 @@
0,
REG_SZ,
ValueBuffer,
- wcslen(ValueBuffer) * sizeof(WCHAR) +
sizeof(UNICODE_NULL));
+ (wcslen(ValueBuffer) + 1) * sizeof(WCHAR));
if (!NT_SUCCESS(Status))
{
DPRINT1("SMSS: Failed writing %wZ environment variable -
%x\n",
@@ -2335,25 +2337,29 @@
return Status;
}
- /* Loop every page file */
- Head = &SmpPagingFileList;
- while (!IsListEmpty(Head))
- {
- /* Remove each one from the list */
- NextEntry = RemoveHeadList(Head);
-
- /* Create the descriptor for it */
- RegEntry = CONTAINING_RECORD(NextEntry, SMP_REGISTRY_VALUE, Entry);
- SmpCreatePagingFileDescriptor(&RegEntry->Name);
-
- /* And free it */
- if (RegEntry->AnsiValue) RtlFreeHeap(RtlGetProcessHeap(), 0,
RegEntry->AnsiValue);
- if (RegEntry->Value.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0,
RegEntry->Value.Buffer);
- RtlFreeHeap(RtlGetProcessHeap(), 0, RegEntry);
- }
-
- /* Now create all the paging files for the descriptors that we have */
- SmpCreatePagingFiles();
+ /* Create the needed page files */
+ if (!MiniNTBoot)
+ {
+ /* Loop every page file */
+ Head = &SmpPagingFileList;
+ while (!IsListEmpty(Head))
+ {
+ /* Remove each one from the list */
+ NextEntry = RemoveHeadList(Head);
+
+ /* Create the descriptor for it */
+ RegEntry = CONTAINING_RECORD(NextEntry, SMP_REGISTRY_VALUE, Entry);
+ SmpCreatePagingFileDescriptor(&RegEntry->Name);
+
+ /* And free it */
+ if (RegEntry->AnsiValue) RtlFreeHeap(RtlGetProcessHeap(), 0,
RegEntry->AnsiValue);
+ if (RegEntry->Value.Buffer) RtlFreeHeap(RtlGetProcessHeap(), 0,
RegEntry->Value.Buffer);
+ RtlFreeHeap(RtlGetProcessHeap(), 0, RegEntry);
+ }
+
+ /* Now create all the paging files for the descriptors that we have */
+ SmpCreatePagingFiles();
+ }
/* Tell Cm it's now safe to fully enable write access to the registry */
NtInitializeRegistry(CM_BOOT_FLAG_SMSS);
Modified: branches/ros-branch-0_4_0/reactos/base/system/smss/smloop.c
URL:
http://svn.reactos.org/svn/reactos/branches/ros-branch-0_4_0/reactos/base/s…
==============================================================================
--- branches/ros-branch-0_4_0/reactos/base/system/smss/smloop.c [iso-8859-1] (original)
+++ branches/ros-branch-0_4_0/reactos/base/system/smss/smloop.c [iso-8859-1] Thu Jan 7
19:54:20 2016
@@ -380,7 +380,7 @@
case LPC_CONNECTION_REQUEST:
/* Create the right structures for it */
SmpHandleConnectionRequest(SmApiPort, (PSB_API_MSG)&RequestMsg);
- ReplyMsg = NULL;
+ ReplyMsg = NULL;
break;
/* A closed connection */