ReactOS 0.4.15-dev-8096-ga0eec98
FxRelatedDeviceList Class Reference

#include <fxrelateddevicelist.hpp>

Inheritance diagram for FxRelatedDeviceList:
Collaboration diagram for FxRelatedDeviceList:

Public Member Functions

 FxRelatedDeviceList (VOID)
 
VOID LockForEnum (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID UnlockFromEnum (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
_Must_inspect_result_ NTSTATUS Add (__in PFX_DRIVER_GLOBALS Globals, __inout FxRelatedDevice *Entry)
 
VOID Remove (__in PFX_DRIVER_GLOBALS Globals, __in MdDeviceObject Device)
 
_Must_inspect_result_ FxRelatedDeviceGetNextEntry (__in_opt FxRelatedDevice *Entry)
 
UCHAR IncrementRetries (VOID)
 
VOID ZeroRetries (VOID)
 
_Must_inspect_result_ PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID operator delete (__in PVOID pointer)
 

Public Attributes

ULONG m_NeedReportMissing
 

Protected Member Functions

virtual _Must_inspect_result_ NTSTATUS ProcessAdd (__in FxTransactionedEntry *Entry)
 
virtual BOOLEAN Compare (__in FxTransactionedEntry *Entry, __in PVOID Data)
 
virtual VOID EntryRemoved (__in FxTransactionedEntry *Entry)
 
- Protected Member Functions inherited from FxSpinLockTransactionedList
 __drv_raisesIRQL (DISPATCH_LEVEL) __drv_maxIRQL(DISPATCH_LEVEL) virtual VOID AcquireLock(__in PFX_DRIVER_GLOBALS FxDriverGlobals
 
 __drv_requiresIRQL (DISPATCH_LEVEL) virtual VOID ReleaseLock(__in PFX_DRIVER_GLOBALS FxDriverGlobals
 
 FxSpinLockTransactionedList ()
 
- Protected Member Functions inherited from FxTransactionedList
virtual VOID AcquireLock (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __out PKIRQL Irql)=0
 
virtual VOID ReleaseLock (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in KIRQL Irql)=0
 
virtual _Must_inspect_result_ NTSTATUS ProcessAdd (__in FxTransactionedEntry *Entry)
 
virtual VOID EntryAdded (__in FxTransactionedEntry *Entry)
 
virtual VOID EntryRemoved (__in FxTransactionedEntry *Entry)
 
virtual BOOLEAN Compare (__in FxTransactionedEntry *Entry, __in PVOID Data)
 
VOID SearchForAndRemove (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PVOID EntryData)
 
_Must_inspect_result_ FxTransactionedEntryGetNextEntryLocked (__in_opt FxTransactionedEntry *Entry)
 
BOOLEAN RemoveLocked (__in FxTransactionedEntry *Entry)
 
VOID ProcessTransactionList (__in PLIST_ENTRY ReleaseHead)
 
VOID ProcessObjectsToRelease (__in PLIST_ENTRY ReleaseHead)
 
 FxTransactionedList ()
 
 ~FxTransactionedList ()
 
VOID LockForEnum (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID UnlockFromEnum (__in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
NTSTATUS Add (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxTransactionedEntry *Entry)
 
VOID Remove (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxTransactionedEntry *Entry)
 
_Must_inspect_result_ FxTransactionedEntryGetNextEntry (__in_opt FxTransactionedEntry *Entry)
 
BOOLEAN Deleting (__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in_opt MxEvent *DeleteDoneEvent)
 
- Protected Member Functions inherited from FxStump
 FxStump (VOID)
 
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
PVOID operator new (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals, __in POOL_TYPE PoolType)
 
VOID operator delete (__in PVOID pointer)
 
PVOID operator new[] (__in size_t Size, __in PFX_DRIVER_GLOBALS FxDriverGlobals)
 
VOID operator delete[] (__in PVOID pointer)
 

Additional Inherited Members

- Protected Attributes inherited from FxSpinLockTransactionedList
__out PKIRQL Irql
 
__in __drv_restoresIRQL KIRQL Irql
 
MxLock m_ListLock
 
- Protected Attributes inherited from FxTransactionedList
LIST_ENTRY m_ListHead
 
LIST_ENTRY m_TransactionHead
 
MxEventm_DeletingDoneEvent
 
ULONG m_ListLockedRecursionCount
 
BOOLEAN m_DeleteOnRemove
 
BOOLEAN m_Deleting
 
UCHAR m_Retries
 

Detailed Description

Definition at line 7 of file fxrelateddevicelist.hpp.

Constructor & Destructor Documentation

◆ FxRelatedDeviceList()

FxRelatedDeviceList::FxRelatedDeviceList ( VOID  )
inline

Definition at line 9 of file fxrelateddevicelist.hpp.

12 {
15 }
#define TRUE
Definition: types.h:120

Member Function Documentation

◆ Add()

_Must_inspect_result_ NTSTATUS FxRelatedDeviceList::Add ( __in PFX_DRIVER_GLOBALS  Globals,
__inout FxRelatedDevice Entry 
)

Definition at line 29 of file fxrelateddevicelist.cpp.

33{
34 return FxSpinLockTransactionedList::Add(FxDriverGlobals,
35 &Entry->m_TransactionedEntry);
36}
NTSTATUS Add(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in FxTransactionedEntry *Entry)
base of all file and directory entries
Definition: entries.h:83

Referenced by FxPkgPdo::AddEjectionDevice(), FxPkgPnp::AddRemovalDevice(), and FxPkgPnp::AddUsageDevice().

◆ Compare()

BOOLEAN FxRelatedDeviceList::Compare ( __in FxTransactionedEntry Entry,
__in PVOID  Data 
)
protectedvirtual

Reimplemented from FxTransactionedList.

Definition at line 126 of file fxrelateddevicelist.cpp.

130{
131 FxRelatedDevice *pRelated;
132
133 pRelated = CONTAINING_RECORD(Entry, FxRelatedDevice, m_TransactionedEntry);
134
135 return pRelated->GetDevice() == (PDEVICE_OBJECT) Data ? TRUE : FALSE;
136}
MdDeviceObject GetDevice(VOID)
#define FALSE
Definition: types.h:117
struct _DEVICE_OBJECT * PDEVICE_OBJECT
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260

◆ EntryRemoved()

VOID FxRelatedDeviceList::EntryRemoved ( __in FxTransactionedEntry Entry)
protectedvirtual

Reimplemented from FxTransactionedList.

Definition at line 139 of file fxrelateddevicelist.cpp.

142{
143 FxRelatedDevice *pRelated;
144
145 pRelated = CONTAINING_RECORD(Entry, FxRelatedDevice, m_TransactionedEntry);
146
149 }
150}
FxRelatedDeviceState m_State
@ RelatedDeviceStateReportedPresent

◆ GetNextEntry()

_Must_inspect_result_ FxRelatedDevice * FxRelatedDeviceList::GetNextEntry ( __in_opt FxRelatedDevice Entry)

Definition at line 49 of file fxrelateddevicelist.cpp.

52{
54
55 if (Entry == NULL) {
56 pEntry = NULL;
57 }
58 else {
59 pEntry = &Entry->m_TransactionedEntry;
60 }
61
63
64 if (pReturn != NULL) {
65 return CONTAINING_RECORD(pReturn, FxRelatedDevice, m_TransactionedEntry);
66 }
67 else {
68 return NULL;
69 }
70}
_Must_inspect_result_ FxTransactionedEntry * GetNextEntry(__in_opt FxTransactionedEntry *Entry)
#define NULL
Definition: types.h:112
PLIST_ENTRY pEntry
Definition: fxioqueue.cpp:4484

Referenced by FxPkgPdo::ClearEjectionDevicesList(), FxPkgPnp::ClearRemovalDevicesList(), and FxPkgPnp::PnpDeviceUsageNotification().

◆ IncrementRetries()

UCHAR FxRelatedDeviceList::IncrementRetries ( VOID  )
inline

Definition at line 53 of file fxrelateddevicelist.hpp.

56 {
57 m_Retries++;
58 return m_Retries;
59 }

◆ LockForEnum()

VOID FxRelatedDeviceList::LockForEnum ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)
inline

Definition at line 18 of file fxrelateddevicelist.hpp.

21 {
22 FxSpinLockTransactionedList::LockForEnum(FxDriverGlobals); // __super call
23 }
VOID LockForEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)

Referenced by FxPkgPdo::ClearEjectionDevicesList(), FxPkgPnp::ClearRemovalDevicesList(), and FxPkgPnp::PnpDeviceUsageNotification().

◆ operator delete()

VOID FxRelatedDeviceList::operator delete ( __in PVOID  pointer)
inline

Definition at line 80 of file fxrelateddevicelist.hpp.

83 {
85 }
void FxPoolFree(__in_xcount(ptr is at an offset from AllocationStart) PVOID ptr)
Definition: wdfpool.cpp:361
GLsizei const GLvoid * pointer
Definition: glext.h:5848

◆ operator new()

_Must_inspect_result_ PVOID FxRelatedDeviceList::operator new ( __in size_t  Size,
__in PFX_DRIVER_GLOBALS  FxDriverGlobals 
)
inline

Definition at line 71 of file fxrelateddevicelist.hpp.

75 {
76 return FxPoolAllocate(FxDriverGlobals, NonPagedPool, Size);
77 }
#define NonPagedPool
Definition: env_spec_w32.h:307
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_DEVICE_PROPERTY_DATA _In_ DEVPROPTYPE _In_ ULONG Size
Definition: wdfdevice.h:4533

◆ ProcessAdd()

_Must_inspect_result_ NTSTATUS FxRelatedDeviceList::ProcessAdd ( __in FxTransactionedEntry Entry)
protectedvirtual

Reimplemented from FxTransactionedList.

Definition at line 74 of file fxrelateddevicelist.cpp.

77{
78 FxRelatedDevice* pNew, *pInList;
81
82 pNew = CONTAINING_RECORD(NewEntry, FxRelatedDevice, m_TransactionedEntry);
83
84 pEntry = NULL;
85
86 //
87 // Go over the transactions first because the device could be in the real
88 // list with a transaction to remove it, so we catch first here instead
89 // of adding complexity to the iteration of the already inserted list.
90 //
93 ple = ple->Flink) {
95 pInList = CONTAINING_RECORD(pEntry, FxRelatedDevice, m_TransactionedEntry);
96
97 if (pInList->m_DeviceObject == pNew->m_DeviceObject) {
98 if (pEntry->GetTransactionAction() == FxTransactionActionAdd) {
99 //
100 // An additional add, failure
101 //
103 }
104
105
106 // Removal is OK b/c our add will be right behind it
107 //
108 ASSERT(pEntry->GetTransactionAction() == FxTransactionActionRemove);
109 return STATUS_SUCCESS;
110 }
111 }
112
113 pEntry = NULL;
114 while ((pEntry = FxSpinLockTransactionedList::GetNextEntryLocked(pEntry)) != NULL) { // __super call
115 pInList = CONTAINING_RECORD(pEntry, FxRelatedDevice, m_TransactionedEntry);
116
117 if (pInList->m_DeviceObject == pNew->m_DeviceObject) {
119 }
120 }
121
122 return STATUS_SUCCESS;
123}
MdDeviceObject m_DeviceObject
_Must_inspect_result_ FxTransactionedEntry * GetNextEntryLocked(__in_opt FxTransactionedEntry *Entry)
PSINGLE_LIST_ENTRY ple
@ FxTransactionActionAdd
@ FxTransactionActionRemove
#define ASSERT(a)
Definition: mode.c:44
#define STATUS_DUPLICATE_OBJECTID
Definition: ntstatus.h:686
#define STATUS_SUCCESS
Definition: shellext.h:65
static FxTransactionedEntry * _FromEntry(__in PLIST_ENTRY Entry)
Definition: typedefs.h:120
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121

◆ Remove()

VOID FxRelatedDeviceList::Remove ( __in PFX_DRIVER_GLOBALS  Globals,
__in MdDeviceObject  Device 
)

Definition at line 39 of file fxrelateddevicelist.cpp.

43{
44 SearchForAndRemove(FxDriverGlobals, (PVOID) Device);
45}
VOID SearchForAndRemove(__in PFX_DRIVER_GLOBALS FxDriverGlobals, __in PVOID EntryData)
_Must_inspect_result_ _In_ WDFDEVICE Device
Definition: wdfchildlist.h:474

Referenced by FxPkgPdo::ClearEjectionDevicesList(), FxPkgPnp::ClearRemovalDevicesList(), FxPkgPdo::RemoveEjectionDevice(), FxPkgPnp::RemoveRemovalDevice(), and FxPkgPnp::RemoveUsageDevice().

◆ UnlockFromEnum()

VOID FxRelatedDeviceList::UnlockFromEnum ( __in PFX_DRIVER_GLOBALS  FxDriverGlobals)
inline

Definition at line 26 of file fxrelateddevicelist.hpp.

29 {
30 FxSpinLockTransactionedList::UnlockFromEnum(FxDriverGlobals); // __super call
31 }
VOID UnlockFromEnum(__in PFX_DRIVER_GLOBALS FxDriverGlobals)

Referenced by FxPkgPdo::ClearEjectionDevicesList(), FxPkgPnp::ClearRemovalDevicesList(), and FxPkgPnp::PnpDeviceUsageNotification().

◆ ZeroRetries()

VOID FxRelatedDeviceList::ZeroRetries ( VOID  )
inline

Definition at line 62 of file fxrelateddevicelist.hpp.

65 {
66 m_Retries = 0;
67 }

Member Data Documentation

◆ m_NeedReportMissing

ULONG FxRelatedDeviceList::m_NeedReportMissing

Definition at line 109 of file fxrelateddevicelist.hpp.

Referenced by EntryRemoved(), and FxRelatedDeviceList().


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