reactos/sdk/include/ddk/prefix.h

121 lines
3.3 KiB
C
Raw Normal View History

#ifndef _RXPREFIX_
#define _RXPREFIX_
typedef struct _RX_CONNECTION_ID
{
union
{
ULONG SessionID;
LUID Luid;
};
} RX_CONNECTION_ID, *PRX_CONNECTION_ID;
ULONG
RxTableComputeHashValue(
_In_ PUNICODE_STRING Name);
PVOID
RxPrefixTableLookupName(
_In_ PRX_PREFIX_TABLE ThisTable,
_In_ PUNICODE_STRING CanonicalName,
_Out_ PUNICODE_STRING RemainingName,
_In_ PRX_CONNECTION_ID ConnectionId);
PRX_PREFIX_ENTRY
RxPrefixTableInsertName(
_Inout_ PRX_PREFIX_TABLE ThisTable,
_Inout_ PRX_PREFIX_ENTRY ThisEntry,
_In_ PVOID Container,
_In_ PULONG ContainerRefCount,
_In_ USHORT CaseInsensitiveLength,
_In_ PRX_CONNECTION_ID ConnectionId);
[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
RxRemovePrefixTableEntry(
_Inout_ PRX_PREFIX_TABLE ThisTable,
_Inout_ PRX_PREFIX_ENTRY Entry);
VOID
RxInitializePrefixTable(
_Inout_ PRX_PREFIX_TABLE ThisTable,
_In_opt_ ULONG TableSize,
_In_ BOOLEAN CaseInsensitiveMatch);
typedef struct _RX_PREFIX_ENTRY
{
NODE_TYPE_CODE NodeTypeCode;
NODE_BYTE_SIZE NodeByteSize;
USHORT CaseInsensitiveLength;
USHORT Spare1;
ULONG SavedHashValue;
LIST_ENTRY HashLinks;
LIST_ENTRY MemberQLinks;
UNICODE_STRING Prefix;
PULONG ContainerRefCount;
PVOID ContainingRecord;
PVOID Context;
RX_CONNECTION_ID ConnectionId;
} RX_PREFIX_ENTRY, *PRX_PREFIX_ENTRY;
#define RX_PREFIX_TABLE_DEFAULT_LENGTH 32
typedef struct _RX_PREFIX_TABLE {
NODE_TYPE_CODE NodeTypeCode;
NODE_BYTE_SIZE NodeByteSize;
ULONG Version;
LIST_ENTRY MemberQueue;
ERESOURCE TableLock;
PRX_PREFIX_ENTRY TableEntryForNull;
BOOLEAN CaseInsensitiveMatch;
BOOLEAN IsNetNameTable;
ULONG TableSize;
#if DBG
ULONG Lookups;
ULONG FailedLookups;
ULONG Considers;
ULONG Compares;
#endif
LIST_ENTRY HashBuckets[RX_PREFIX_TABLE_DEFAULT_LENGTH];
} RX_PREFIX_TABLE, *PRX_PREFIX_TABLE;
#if (_WIN32_WINNT < 0x0600)
#define RxAcquirePrefixTableLockShared(T, W) RxpAcquirePrefixTableLockShared((T),(W),TRUE)
#define RxAcquirePrefixTableLockExclusive(T, W) RxpAcquirePrefixTableLockExclusive((T), (W), TRUE)
#define RxReleasePrefixTableLock(T) RxpReleasePrefixTableLock((T), TRUE)
BOOLEAN
RxpAcquirePrefixTableLockShared(
_In_ PRX_PREFIX_TABLE pTable,
_In_ BOOLEAN Wait,
_In_ BOOLEAN ProcessBufferingStateChangeRequests);
BOOLEAN
RxpAcquirePrefixTableLockExclusive(
_In_ PRX_PREFIX_TABLE pTable,
_In_ BOOLEAN Wait,
_In_ BOOLEAN ProcessBufferingStateChangeRequests);
VOID
RxpReleasePrefixTableLock(
_In_ PRX_PREFIX_TABLE pTable,
_In_ BOOLEAN ProcessBufferingStateChangeRequests);
#else
#define RxAcquirePrefixTableLockShared(T, W) ExAcquireResourceSharedLite(&(T)->TableLock, (W))
#define RxAcquirePrefixTableLockExclusive(T, W) ExAcquireResourceExclusiveLite(&(T)->TableLock, (W))
#define RxReleasePrefixTableLock(T) ExReleaseResourceLite(&(T)->TableLock)
#endif
VOID
RxExclusivePrefixTableLockToShared(
_In_ PRX_PREFIX_TABLE Table);
#define RxIsPrefixTableLockExclusive(T) ExIsResourceAcquiredExclusiveLite(&(T)->TableLock)
#define RxIsPrefixTableLockAcquired(T) (ExIsResourceAcquiredSharedLite(&(T)->TableLock) || \
ExIsResourceAcquiredExclusiveLite(&(T)->TableLock))
#ifdef __REACTOS__
#define HASH_BUCKET(T, H) &(T)->HashBuckets[H % (T)->TableSize]
#endif
#endif