Author: ekohl
Date: Mon Jun 29 20:29:19 2015
New Revision: 68315
URL:
http://svn.reactos.org/svn/reactos?rev=68315&view=rev
Log:
[NTOSKRNL]
Fix CmpDestroyHiveViewList adding checks for empty lists.
Thank you very much Thomas!
Modified:
trunk/reactos/ntoskrnl/config/cmmapvw.c
Modified: trunk/reactos/ntoskrnl/config/cmmapvw.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/config/cmmapvw.c?…
==============================================================================
--- trunk/reactos/ntoskrnl/config/cmmapvw.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/config/cmmapvw.c [iso-8859-1] Mon Jun 29 20:29:19 2015
@@ -34,7 +34,6 @@
NTAPI
CmpDestroyHiveViewList(IN PCMHIVE Hive)
{
-#if 0
PCM_VIEW_OF_FILE CmView;
PLIST_ENTRY EntryList;
@@ -42,9 +41,10 @@
ASSERT(Hive->Hive.ReadOnly == FALSE);
/* Free all the views inside the Pinned View List */
- EntryList = RemoveHeadList(&Hive->PinViewListHead);
- while (EntryList != &Hive->PinViewListHead)
+ while (!IsListEmpty(&Hive->PinViewListHead))
{
+ EntryList = RemoveHeadList(&Hive->PinViewListHead);
+
CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE, PinViewList);
/* FIXME: Unmap the view if it is mapped */
@@ -52,8 +52,6 @@
ExFreePool(CmView);
Hive->PinnedViews--;
-
- EntryList = RemoveHeadList(&Hive->PinViewListHead);
}
/* The Pinned View List should be empty */
@@ -61,9 +59,10 @@
ASSERT(Hive->PinnedViews == 0);
/* Now, free all the views inside the LRU View List */
- EntryList = RemoveHeadList(&Hive->LRUViewListHead);
- while (EntryList != &Hive->LRUViewListHead)
+ while (!IsListEmpty(&Hive->LRUViewListHead))
{
+ EntryList = RemoveHeadList(&Hive->LRUViewListHead);
+
CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE, LRUViewList);
/* FIXME: Unmap the view if it is mapped */
@@ -71,14 +70,11 @@
ExFreePool(CmView);
Hive->MappedViews--;
-
- EntryList = RemoveHeadList(&Hive->LRUViewListHead);
}
/* The LRU View List should be empty */
ASSERT(IsListEmpty(&Hive->LRUViewListHead) == TRUE);
ASSERT(Hive->MappedViews == 0);
-#endif
}
/* EOF */