ReactOS 0.4.15-dev-8127-g6338913
cmmapvw.c File Reference
#include "ntoskrnl.h"
#include "debug.h"
Include dependency graph for cmmapvw.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

VOID NTAPI CmpInitHiveViewList (IN PCMHIVE Hive)
 
VOID NTAPI CmpDestroyHiveViewList (IN PCMHIVE Hive)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 12 of file cmmapvw.c.

Function Documentation

◆ CmpDestroyHiveViewList()

VOID NTAPI CmpDestroyHiveViewList ( IN PCMHIVE  Hive)

Definition at line 35 of file cmmapvw.c.

36{
37 PCM_VIEW_OF_FILE CmView;
38 PLIST_ENTRY EntryList;
39
40 /* Do NOT destroy the views of read-only hives */
41 ASSERT(Hive->Hive.ReadOnly == FALSE);
42
43 /* Free all the views inside the Pinned View List */
44 while (!IsListEmpty(&Hive->PinViewListHead))
45 {
46 EntryList = RemoveHeadList(&Hive->PinViewListHead);
47
48 CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE, PinViewList);
49
50 /* FIXME: Unmap the view if it is mapped */
51
52 ExFreePool(CmView);
53
54 Hive->PinnedViews--;
55 }
56
57 /* The Pinned View List should be empty */
58 ASSERT(IsListEmpty(&Hive->PinViewListHead) == TRUE);
59 ASSERT(Hive->PinnedViews == 0);
60
61 /* Now, free all the views inside the LRU View List */
62 while (!IsListEmpty(&Hive->LRUViewListHead))
63 {
64 EntryList = RemoveHeadList(&Hive->LRUViewListHead);
65
66 CmView = CONTAINING_RECORD(EntryList, CM_VIEW_OF_FILE, LRUViewList);
67
68 /* FIXME: Unmap the view if it is mapped */
69
70 ExFreePool(CmView);
71
72 Hive->MappedViews--;
73 }
74
75 /* The LRU View List should be empty */
76 ASSERT(IsListEmpty(&Hive->LRUViewListHead) == TRUE);
77 ASSERT(Hive->MappedViews == 0);
78}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define ExFreePool(addr)
Definition: env_spec_w32.h:352
#define RemoveHeadList(ListHead)
Definition: env_spec_w32.h:964
#define ASSERT(a)
Definition: mode.c:44
Definition: typedefs.h:120
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

Referenced by CmpDestroyHive(), and CmUnloadKey().

◆ CmpInitHiveViewList()

VOID NTAPI CmpInitHiveViewList ( IN PCMHIVE  Hive)

Definition at line 21 of file cmmapvw.c.

22{
23 /* Initialize the list heads */
24 InitializeListHead(&Hive->LRUViewListHead);
25 InitializeListHead(&Hive->PinViewListHead);
26
27 /* Reset data */
28 Hive->MappedViews = 0;
29 Hive->PinnedViews = 0;
30 Hive->UseCount = 0;
31}
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944

Referenced by CmGetSystemControlValues(), and CmpInitializeHive().