reactos/sdk/include/ddk/fcbtable.h

68 lines
1.8 KiB
C
Raw Normal View History

#ifndef _RXFCBTABLE_
#define _RXFCBTABLE_
typedef struct _RX_FCB_TABLE_ENTRY {
NODE_TYPE_CODE NodeTypeCode;
NODE_BYTE_SIZE NodeByteSize;
ULONG HashValue;
UNICODE_STRING Path;
LIST_ENTRY HashLinks;
LONG Lookups;
} RX_FCB_TABLE_ENTRY, *PRX_FCB_TABLE_ENTRY;
#define RX_FCB_TABLE_NUMBER_OF_HASH_BUCKETS 32
typedef struct _RX_FCB_TABLE
{
NODE_TYPE_CODE NodeTypeCode;
NODE_BYTE_SIZE NodeByteSize;
volatile ULONG Version;
BOOLEAN CaseInsensitiveMatch;
USHORT NumberOfBuckets;
volatile LONG Lookups;
volatile LONG FailedLookups;
volatile LONG Compares;
ERESOURCE TableLock;
PRX_FCB_TABLE_ENTRY TableEntryForNull;
LIST_ENTRY HashBuckets[RX_FCB_TABLE_NUMBER_OF_HASH_BUCKETS];
} RX_FCB_TABLE, *PRX_FCB_TABLE;
VOID
RxInitializeFcbTable(
_Inout_ PRX_FCB_TABLE FcbTable,
_In_ BOOLEAN CaseInsensitiveMatch);
[RXCE] - Implemented RxCompleteSrvOpenKeyAssociation(), RxInitiateSrvOpenKeyAssociation(), RxProcessChangeBufferingStateRequests() - Implemented RxFinalizeFcbTable(), RxFinalizeNetFobx(), RxFinalizeNetRoot(), RxFinalizeSrvCall(), RxFinalizeVNetRoot(), RxFreeObject(), RxpDestroySrvCall(), RxRemovePrefixTableEntry(), RxRemoveVirtualNetRootFromNetRoot(), RxScavengeRelatedFobxs(), RxTearDownBufferingManager(), RxUndoScavengerFinalizationMarking() - Implemented RxPostToWorkerThread() - Implemented RxFlushFcbInSystemCache(), RxPurgeFcb(), RxPurgeFcbInSystemCache() - Stubbed RxOrphanSrvOpens(), RxpDiscardChangeBufferingStateRequests(), RxpDispatchChangeBufferingStateRequests(), RxpProcessChangeBufferingStateRequests() - Continued implementation of RxDereference() so that it supports more objects than just SRV_CALL - Reworked RxInsertWorkQueueItem() implementation so that it accepts any work item, and not just dispatch work items - Finished implementation of RxTableLookupName() so that it properly returns a V_NET_ROOT on NET_ROOT match Notable effects of this commit are: - RXCE/RDBSS leak less memory; now objects without references are properly deleted from the system - This means that stale objects are also deleted; this fixes CORE-13483 were same stale SRV_CALL was used again and again - Because in prefix table NET_ROOT are correctly handled, it's now possible to mount several path from the same prefix; this fixes CORE-13482 CORE-8204 CORE-11327 CORE-13482 CORE-13483 svn path=/trunk/; revision=75195
2017-06-25 11:55:37 +00:00
VOID
RxFinalizeFcbTable(
_Inout_ PRX_FCB_TABLE FcbTable);
PFCB
RxFcbTableLookupFcb(
_In_ PRX_FCB_TABLE FcbTable,
_In_ PUNICODE_STRING Path);
NTSTATUS
RxFcbTableInsertFcb(
_Inout_ PRX_FCB_TABLE FcbTable,
_Inout_ PFCB Fcb);
NTSTATUS
RxFcbTableRemoveFcb(
_Inout_ PRX_FCB_TABLE FcbTable,
_Inout_ PFCB Fcb);
#define RxAcquireFcbTableLockShared(T, W) ExAcquireResourceSharedLite(&(T)->TableLock, W)
#define RxAcquireFcbTableLockExclusive(T, W) ExAcquireResourceExclusiveLite(&(T)->TableLock, W)
#define RxReleaseFcbTableLock(T) ExReleaseResourceLite(&(T)->TableLock)
#define RxIsFcbTableLockExclusive(T) ExIsResourceAcquiredExclusiveLite(&(T)->TableLock)
#define RxIsFcbTableLockAcquired(T) (ExIsResourceAcquiredSharedLite(&(T)->TableLock) || \
ExIsResourceAcquiredExclusiveLite(&(T)->TableLock))
#ifdef __REACTOS__
#define FCB_HASH_BUCKET(T, H) &(T)->HashBuckets[H % (T)->NumberOfBuckets]
#endif
#endif