2 * PROJECT: ReactOS Kernel
3 * LICENSE: GPL - See COPYING in the top level directory
4 * FILE: ntoskrnl/config/cmmapvw.c
5 * PURPOSE: Configuration Manager - Map-Viewed Hive Support
6 * PROGRAMMERS: Alex Ionescu (alex.ionescu@reactos.org)
9 /* INCLUDES ******************************************************************/
15 /* GLOBALS *******************************************************************/
17 /* FUNCTIONS *****************************************************************/
21 CmpInitHiveViewList(IN PCMHIVE Hive
)
23 /* Initialize the list heads */
24 InitializeListHead(&Hive
->LRUViewListHead
);
25 InitializeListHead(&Hive
->PinViewListHead
);
28 Hive
->MappedViews
= 0;
29 Hive
->PinnedViews
= 0;
35 CmpDestroyHiveViewList(IN PCMHIVE Hive
)
37 PCM_VIEW_OF_FILE CmView
;
38 PLIST_ENTRY EntryList
;
40 /* Do NOT destroy the views of read-only hives */
41 ASSERT(Hive
->Hive
.ReadOnly
== FALSE
);
43 /* Free all the views inside the Pinned View List */
44 while (!IsListEmpty(&Hive
->PinViewListHead
))
46 EntryList
= RemoveHeadList(&Hive
->PinViewListHead
);
48 CmView
= CONTAINING_RECORD(EntryList
, CM_VIEW_OF_FILE
, PinViewList
);
50 /* FIXME: Unmap the view if it is mapped */
57 /* The Pinned View List should be empty */
58 ASSERT(IsListEmpty(&Hive
->PinViewListHead
) == TRUE
);
59 ASSERT(Hive
->PinnedViews
== 0);
61 /* Now, free all the views inside the LRU View List */
62 while (!IsListEmpty(&Hive
->LRUViewListHead
))
64 EntryList
= RemoveHeadList(&Hive
->LRUViewListHead
);
66 CmView
= CONTAINING_RECORD(EntryList
, CM_VIEW_OF_FILE
, LRUViewList
);
68 /* FIXME: Unmap the view if it is mapped */
75 /* The LRU View List should be empty */
76 ASSERT(IsListEmpty(&Hive
->LRUViewListHead
) == TRUE
);
77 ASSERT(Hive
->MappedViews
== 0);