ReactOS  0.4.15-dev-3163-gf17c2c0
FxCollectionInternal Struct Reference

#include <fxcollection.hpp>

Inheritance diagram for FxCollectionInternal:
Collaboration diagram for FxCollectionInternal:

Public Member Functions

 FxCollectionInternal (VOID)
 
 ~FxCollectionInternal (VOID)
 
_Must_inspect_result_ FxCollectionEntryFindEntry (__in ULONG Index)
 
_Must_inspect_result_ FxCollectionEntryFindEntryByObject (__in FxObject *Object)
 
ULONG Count (VOID)
 
BOOLEAN Add (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxObject *Item)
 
_Must_inspect_result_ FxObjectGetItem (__in ULONG Index)
 
_Must_inspect_result_ FxObjectGetFirstItem (VOID)
 
_Must_inspect_result_ FxObjectGetLastItem (VOID)
 
NTSTATUS Remove (__in ULONG Index)
 
VOID CleanupEntry (__in FxCollectionEntry *Entry)
 
VOID CleanupEntryObject (__in FxObject *Object)
 
NTSTATUS RemoveEntry (__in FxCollectionEntry *Entry)
 
_Must_inspect_result_ NTSTATUS RemoveItem (__in FxObject *Item)
 
_Must_inspect_result_ FxCollectionEntryStart (VOID)
 
_Must_inspect_result_ FxCollectionEntryEnd (VOID)
 
VOID Clear (VOID)
 

Protected Member Functions

_Must_inspect_result_ FxCollectionEntryAllocateEntry (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID AddEntry (__in FxCollectionEntry *Node, __in FxObject *Item)
 

Protected Attributes

ULONG m_Count
 
LIST_ENTRY m_ListHead
 

Detailed Description

Definition at line 56 of file fxcollection.hpp.

Constructor & Destructor Documentation

◆ FxCollectionInternal()

FxCollectionInternal::FxCollectionInternal ( VOID  )

Definition at line 28 of file fxcollection.cpp.

31 {
32  m_Count = 0;
34 }
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944

◆ ~FxCollectionInternal()

FxCollectionInternal::~FxCollectionInternal ( VOID  )

Definition at line 36 of file fxcollection.cpp.

39 {
40  Clear();
41 }

Member Function Documentation

◆ Add()

BOOLEAN FxCollectionInternal::Add ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals,
__in FxObject Item 
)

Definition at line 62 of file fxcollection.cpp.

66 {
67  FxCollectionEntry *pNode;
68 
69  pNode = AllocateEntry(FxDriverGlobals);
70 
71  if (pNode != NULL) {
73 
74  AddEntry(pNode, Item);
75  }
76 
77  return pNode != NULL;
78 }
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ FxCollectionEntry * AllocateEntry(__in PFX_DRIVER_GLOBALS FxDriverGlobals)
LIST_ENTRY m_ListEntry
VOID AddEntry(__in FxCollectionEntry *Node, __in FxObject *Item)
#define NULL
Definition: types.h:112
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

Referenced by FxCollection::Add().

◆ AddEntry()

VOID FxCollectionInternal::AddEntry ( __in FxCollectionEntry Node,
__in FxObject Item 
)
inlineprotected

Definition at line 175 of file fxcollection.hpp.

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  }
_In_ WDFCOLLECTION _In_ WDFOBJECT Item
Definition: dlist.c:348

Referenced by Add(), and FxResourceCollection::AddAt().

◆ AllocateEntry()

_Must_inspect_result_ FxCollectionEntry* FxCollectionInternal::AllocateEntry ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)
inlineprotected

Definition at line 167 of file fxcollection.hpp.

170  {
171  return new(FxDriverGlobals) FxCollectionEntry();
172  }

Referenced by Add(), and FxResourceCollection::AddAt().

◆ CleanupEntry()

VOID FxCollectionInternal::CleanupEntry ( __in FxCollectionEntry Entry)

Definition at line 161 of file fxcollection.cpp.

164 {
165  RemoveEntryList(&Entry->m_ListEntry);
166  delete Entry;
167 
168  m_Count--;
169 }
struct _Entry Entry
Definition: kefuncs.h:627
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
base of all file and directory entries
Definition: entries.h:82

Referenced by if(), and RemoveEntry().

◆ CleanupEntryObject()

VOID FxCollectionInternal::CleanupEntryObject ( __in FxObject Object)
inline

Definition at line 123 of file fxcollection.hpp.

126  {
127  Object->RELEASE(this);
128  }
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object

Referenced by if(), and RemoveEntry().

◆ Clear()

VOID FxCollectionInternal::Clear ( VOID  )

Definition at line 44 of file fxcollection.cpp.

47 {
48  while (!IsListEmpty(&m_ListHead)) {
49  Remove(0);
50  }
51 }
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
NTSTATUS Remove(__in ULONG Index)

Referenced by FxCmResList::BuildFromWdmList(), FxCollection::~FxCollection(), and ~FxCollectionInternal().

◆ Count()

◆ End()

_Must_inspect_result_ FxCollectionEntry* FxCollectionInternal::End ( VOID  )
inline

Definition at line 152 of file fxcollection.hpp.

155  {
156  return CONTAINING_RECORD(&m_ListHead, FxCollectionEntry, m_ListEntry);
157  }
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

Referenced by FxResourceCollection::AddAt(), FxCmResList::CreateWdmList(), FxIoResReqList::CreateWdmList(), FxPkgPnp::PnpMatchResources(), and FxPkgPnp::ValidateCmResource().

◆ FindEntry()

_Must_inspect_result_ FxCollectionEntry * FxCollectionInternal::FindEntry ( __in ULONG  Index)

Definition at line 82 of file fxcollection.cpp.

85 {
87  ULONG i;
88 
89  if (Index >= m_Count) {
90  return NULL;
91  }
92 
93  for (i = 0, ple = m_ListHead.Flink;
94  ple != &m_ListHead;
95  ple = ple->Flink, i++) {
96  if (i != Index) {
97  continue;
98  }
99 
100  return CONTAINING_RECORD(ple, FxCollectionEntry, m_ListEntry);
101  }
102 
103  return NULL;
104 }
PSINGLE_LIST_ENTRY ple
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
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
_In_ WDFCOLLECTION _In_ ULONG Index
Definition: typedefs.h:119
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
#define NULL
Definition: types.h:112
unsigned int ULONG
Definition: retypes.h:1

Referenced by GetItem(), Remove(), and FxResourceCollection::RemoveAndDelete().

◆ FindEntryByObject()

_Must_inspect_result_ FxCollectionEntry * FxCollectionInternal::FindEntryByObject ( __in FxObject Object)

Definition at line 108 of file fxcollection.cpp.

111 {
113 
114  for (ple = m_ListHead.Flink; ple != &m_ListHead; ple = ple->Flink) {
115  FxCollectionEntry* pNode;
116 
117  pNode = CONTAINING_RECORD(ple, FxCollectionEntry, m_ListEntry);
118  if (pNode->m_Object == Object) {
119  return pNode;
120  }
121  }
122 
123  return NULL;
124 }
PSINGLE_LIST_ENTRY ple
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
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
FxObject * m_Object
Definition: typedefs.h:119
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
#define NULL
Definition: types.h:112

Referenced by RemoveItem().

◆ GetFirstItem()

_Must_inspect_result_ FxObject * FxCollectionInternal::GetFirstItem ( VOID  )

Definition at line 202 of file fxcollection.cpp.

205 {
206  if (IsListEmpty(&m_ListHead)) {
207  return NULL;
208  }
209  else {
212  m_ListEntry)->m_Object;
213  }
214 }
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
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
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
#define NULL
Definition: types.h:112

◆ GetItem()

_Must_inspect_result_ FxObject * FxCollectionInternal::GetItem ( __in ULONG  Index)

Definition at line 184 of file fxcollection.cpp.

188 {
189  FxCollectionEntry* pNode;
190 
191  pNode = FindEntry(Index);
192  if (pNode != NULL) {
193  return pNode->m_Object;
194  }
195  else {
196  return NULL;
197  }
198 }
_Must_inspect_result_ FxCollectionEntry * FindEntry(__in ULONG Index)
_In_ WDFCOLLECTION _In_ ULONG Index
FxObject * m_Object
#define NULL
Definition: types.h:112

Referenced by FxCmResList::GetDescriptor().

◆ GetLastItem()

_Must_inspect_result_ FxObject * FxCollectionInternal::GetLastItem ( VOID  )

Definition at line 218 of file fxcollection.cpp.

221 {
222  if (IsListEmpty(&m_ListHead)) {
223  return NULL;
224  }
225  else {
228  m_ListEntry)->m_Object;
229  }
230 }
struct _LIST_ENTRY * Blink
Definition: typedefs.h:122
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
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
#define NULL
Definition: types.h:112

◆ Remove()

NTSTATUS FxCollectionInternal::Remove ( __in ULONG  Index)

Definition at line 127 of file fxcollection.cpp.

130 {
131  FxCollectionEntry *pNode;
132 
133  pNode = FindEntry(Index);
134 
135  if (pNode != NULL) {
136  return RemoveEntry(pNode);
137  }
138  else {
139  return STATUS_NOT_FOUND;
140  }
141 }
_Must_inspect_result_ FxCollectionEntry * FindEntry(__in ULONG Index)
#define STATUS_NOT_FOUND
Definition: shellext.h:72
_In_ WDFCOLLECTION _In_ ULONG Index
NTSTATUS RemoveEntry(__in FxCollectionEntry *Entry)
#define NULL
Definition: types.h:112

Referenced by Clear().

◆ RemoveEntry()

NTSTATUS FxCollectionInternal::RemoveEntry ( __in FxCollectionEntry Entry)

Definition at line 172 of file fxcollection.cpp.

175 {
176  CleanupEntryObject(Entry->m_Object);
178 
179  return STATUS_SUCCESS;
180 }
VOID CleanupEntryObject(__in FxObject *Object)
VOID CleanupEntry(__in FxCollectionEntry *Entry)
#define STATUS_SUCCESS
Definition: shellext.h:65
base of all file and directory entries
Definition: entries.h:82

Referenced by Remove(), FxResourceCollection::RemoveAndDelete(), RemoveItem(), and while().

◆ RemoveItem()

_Must_inspect_result_ NTSTATUS FxCollectionInternal::RemoveItem ( __in FxObject Item)

Definition at line 145 of file fxcollection.cpp.

148 {
149  FxCollectionEntry* pNode;
150 
151  pNode = FindEntryByObject(Item);
152 
153  if (pNode != NULL) {
154  return RemoveEntry(pNode);
155  }
156 
157  return STATUS_NOT_FOUND;
158 }
#define STATUS_NOT_FOUND
Definition: shellext.h:72
_Must_inspect_result_ FxCollectionEntry * FindEntryByObject(__in FxObject *Object)
NTSTATUS RemoveEntry(__in FxCollectionEntry *Entry)
#define NULL
Definition: types.h:112
_In_ WDFCOLLECTION _In_ WDFOBJECT Item

◆ Start()

_Must_inspect_result_ FxCollectionEntry* FxCollectionInternal::Start ( VOID  )
inline

Definition at line 143 of file fxcollection.hpp.

146  {
147  return CONTAINING_RECORD(m_ListHead.Flink, FxCollectionEntry, m_ListEntry);
148  }
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
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121

Referenced by FxResourceCollection::AddAt(), FxCmResList::CreateWdmList(), FxIoResReqList::CreateWdmList(), FxCmResList::GetResourceLength(), FxPkgPnp::PnpMatchResources(), and FxPkgPnp::ValidateCmResource().

Member Data Documentation

◆ m_Count

ULONG FxCollectionInternal::m_Count
protected

◆ m_ListHead


The documentation for this struct was generated from the following files: