ReactOS  0.4.13-dev-99-g7e18b6d
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
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
Definition: typedefs.h:117
#define ExFreePool(addr)
Definition: env_spec_w32.h:352

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().