Author: ion
Date: Thu Oct 4 06:19:42 2012
New Revision: 57475
URL: http://svn.reactos.org/svn/reactos?rev=57475&view=rev
Log:
[NTOSKRNL]: CORE-6698 #resolve #time 5m #comment Add correct error handling during session space view mapping.
Modified:
trunk/reactos/ntoskrnl/mm/ARM3/section.c
Modified: trunk/reactos/ntoskrnl/mm/ARM3/section.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/mm/ARM3/section.c…
==============================================================================
--- trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/mm/ARM3/section.c [iso-8859-1] Thu Oct 4 06:19:42 2012
@@ -1021,8 +1021,10 @@
/* Check if the caller wanted a larger section than the view */
if (*ViewSize > SectionSize)
{
- /* We should probably fail. FIXME TODO */
- ASSERT(FALSE);
+ /* Fail */
+ DPRINT1("View is too large\n");
+ MiDereferenceControlArea(ControlArea);
+ return STATUS_INVALID_VIEW_SIZE;
}
/* Get the number of 64K buckets required for this mapping */
@@ -1032,14 +1034,22 @@
/* Check if the view is more than 4GB large */
if (Buckets >= MI_SYSTEM_VIEW_BUCKET_SIZE)
{
- /* We should probably fail */
- ASSERT(FALSE);
+ /* Fail */
+ DPRINT1("View is too large\n");
+ MiDereferenceControlArea(ControlArea);
+ return STATUS_INVALID_VIEW_SIZE;
}
/* Insert this view into system space and get a base address for it */
Base = MiInsertInSystemSpace(Session, Buckets, ControlArea);
- ASSERT(Base);
-
+ if (!Base)
+ {
+ /* Fail */
+ DPRINT1("Out of system space\n");
+ MiDereferenceControlArea(ControlArea);
+ return STATUS_NO_MEMORY;
+ }
+
/* What's the underlying session? */
if (Session == &MmSession)
{
Author: ion
Date: Thu Oct 4 06:16:53 2012
New Revision: 57474
URL: http://svn.reactos.org/svn/reactos?rev=57474&view=rev
Log:
[NTOS]: CORE-6204 #resolve #time 10m #comment Do not touch NextEntry after removing it, instead restart the scan at the head of the list (checked against w2k3sp1).
Modified:
trunk/reactos/ntoskrnl/ke/thrdobj.c
Modified: trunk/reactos/ntoskrnl/ke/thrdobj.c
URL: http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ke/thrdobj.c?rev=…
==============================================================================
--- trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ke/thrdobj.c [iso-8859-1] Thu Oct 4 06:16:53 2012
@@ -470,9 +470,6 @@
0);
}
- /* Move on, but save NextEntry before we remove */
- NextEntry = NextEntry->Flink;
-
/* Now we can remove it */
RemoveEntryList(&Mutant->MutantListEntry);
@@ -487,6 +484,9 @@
/* Wake the Mutant */
KiWaitTest(&Mutant->Header, MUTANT_INCREMENT);
}
+
+ /* Move on */
+ NextEntry = Thread->MutantListHead.Flink;
}
/* Release the Lock */