ReactOS  0.4.15-dev-2701-g34593d9
fxcollection.hpp
Go to the documentation of this file.
1 /*++
2 
3 Copyright (c) Microsoft Corporation
4 
5 Module Name:
6 
7  FxCollection.hpp
8 
9 Abstract:
10 
11  This module implements a simple collection class to operate on
12  objects derived from FxObject.
13 
14 Author:
15 
16 
17 
18 Environment:
19 
20  Both kernel and user mode
21 
22 Revision History:
23 
24 --*/
25 
26 #ifndef _FXCOLLECTION_HPP_
27 #define _FXCOLLECTION_HPP_
28 
29 class FxCollectionEntry : public FxStump {
30 
31  friend FxCollection;
33 
34 protected:
36  VOID
37  )
38  {
39  }
40 
41 public:
43 
45 
46 public:
49  VOID
50  )
51  {
53  }
54 };
55 
57 protected:
59 
61 
62 public:
64  VOID
65  );
66 
68  VOID
69  );
70 
73  FindEntry(
75  );
76 
81  );
82 
83  ULONG
84  Count(
85  VOID
86  );
87 
88  BOOLEAN
89  Add(
90  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
92  );
93 
95  FxObject *
96  GetItem(
98  );
99 
101  FxObject*
102  GetFirstItem(
103  VOID
104  );
105 
107  FxObject*
108  GetLastItem(
109  VOID
110  );
111 
112  NTSTATUS
113  Remove(
115  );
116 
117  VOID
118  CleanupEntry(
120  );
121 
122  VOID
125  )
126  {
127  Object->RELEASE(this);
128  }
129 
130  NTSTATUS
131  RemoveEntry(
133  );
134 
136  NTSTATUS
137  RemoveItem(
139  );
140 
144  VOID
145  )
146  {
147  return CONTAINING_RECORD(m_ListHead.Flink, FxCollectionEntry, m_ListEntry);
148  }
149 
153  VOID
154  )
155  {
156  return CONTAINING_RECORD(&m_ListHead, FxCollectionEntry, m_ListEntry);
157  }
158 
159  VOID
160  Clear(
161  VOID
162  );
163 
164 protected:
168  __in PFX_DRIVER_GLOBALS FxDriverGlobals
169  )
170  {
171  return new(FxDriverGlobals) FxCollectionEntry();
172  }
173 
174  VOID
178  )
179  {
180  Node->m_Object = Item;
181 
182  //
183  // Refcount the item we are adding to the list.
184  //
185  Item->ADDREF(this);
186 
187  //
188  // Increment the number of items in the collection.
189  //
190  m_Count++;
191  }
192 };
193 
195 
196 public:
197  FxCollection(
198  __in PFX_DRIVER_GLOBALS FxDriverGlobals
199  );
200 
202  VOID
203  );
204 
205  BOOLEAN
208  )
209  {
211  }
212 
213  VOID
216  );
217 
218 protected:
219  FxCollection(
220  __in PFX_DRIVER_GLOBALS FxDriverGlobals,
221  __in WDFTYPE Type,
223  );
224 
225 };
226 
227 #endif // _FXCOLLECTION_HPP_
#define _Must_inspect_result_
Definition: no_sal2.h:62
_Must_inspect_result_ FxCollectionEntry * Start(VOID)
VOID StealCollection(__in FxCollection *Collection)
FxCollection(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING _In_opt_ PWDF_OBJECT_ATTRIBUTES _In_ WDFCOLLECTION Collection
Definition: wdfregistry.h:367
_Must_inspect_result_ FxObject * GetFirstItem(VOID)
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN Add(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Item)
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
friend FxCollectionInternal
BOOLEAN Add(__in FxObject *Item)
_Must_inspect_result_ FxCollectionEntry * AllocateEntry(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
_Must_inspect_result_ FxCollectionEntry * FindEntry(__in ULONG Index)
unsigned char BOOLEAN
_Must_inspect_result_ FxCollectionEntry * End(VOID)
VOID CleanupEntryObject(__in FxObject *Object)
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
_Must_inspect_result_ FxObject * GetLastItem(VOID)
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
_Must_inspect_result_ FxCollectionEntry * FindEntryByObject(__in FxObject *Object)
_In_ WDFCOLLECTION _In_ ULONG Index
FxObject * m_Object
Type
Definition: Type.h:6
Definition: typedefs.h:119
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
VOID CleanupEntry(__in FxCollectionEntry *Entry)
LIST_ENTRY m_ListEntry
__inline PFX_DRIVER_GLOBALS GetDriverGlobals(VOID)
Definition: fxobject.hpp:734
VOID AddEntry(__in FxCollectionEntry *Node, __in FxObject *Item)
NTSTATUS RemoveEntry(__in FxCollectionEntry *Entry)
unsigned short USHORT
Definition: pedump.c:61
USHORT WDFTYPE
Definition: fxtypes.h:29
NTSTATUS Remove(__in ULONG Index)
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
unsigned int ULONG
Definition: retypes.h:1
_Must_inspect_result_ NTSTATUS RemoveItem(__in FxObject *Item)
_Must_inspect_result_ FxObject * GetItem(__in ULONG Index)
#define __in
Definition: dbghelp.h:35
FxCollectionEntry * Next(VOID)
base of all file and directory entries
Definition: entries.h:82
Definition: dlist.c:348