[RDBSS]
[RXCE]
[DDK]
Add an initial implementation of the RXCE and RDBSS libraries that are used to implement mini-redirectors
The associated headers are also added to DDK
The implementation is partial (really!) and is only working for read-only operations.
It leaks memory as hell (no refcounting implemented) and thus, objects freeing is not implemented.
It was tested with NFS41 driver. With such RDBSS, it's possible for the driver to mount a remote share, to list
files, to query their properties, to query volume properties, and finally to read files (with some corruption under
specific conditions).
Please refrain from committing in this (especially for modifying whitespaces or fixing comments...), this is still WIP
and under development, it would mess with my local changes!
In itself, it doesn't bring anything to ReactOS yet, as no mini redirector is available in ReactOS source tree.
This may come later on with NFS41.
More to follow...
CORE-11327
svn path=/trunk/; revision=74674
2017-05-26 20:52:18 +00:00
|
|
|
#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);
|
|
|
|
|
[RDBSS]
[RXCE]
[DDK]
Add an initial implementation of the RXCE and RDBSS libraries that are used to implement mini-redirectors
The associated headers are also added to DDK
The implementation is partial (really!) and is only working for read-only operations.
It leaks memory as hell (no refcounting implemented) and thus, objects freeing is not implemented.
It was tested with NFS41 driver. With such RDBSS, it's possible for the driver to mount a remote share, to list
files, to query their properties, to query volume properties, and finally to read files (with some corruption under
specific conditions).
Please refrain from committing in this (especially for modifying whitespaces or fixing comments...), this is still WIP
and under development, it would mess with my local changes!
In itself, it doesn't bring anything to ReactOS yet, as no mini redirector is available in ReactOS source tree.
This may come later on with NFS41.
More to follow...
CORE-11327
svn path=/trunk/; revision=74674
2017-05-26 20:52:18 +00:00
|
|
|
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);
|
2018-09-08 08:05:41 +00:00
|
|
|
#else
|
|
|
|
#define RxAcquirePrefixTableLockShared(T, W) ExAcquireResourceSharedLite(&(T)->TableLock, (W))
|
|
|
|
#define RxAcquirePrefixTableLockExclusive(T, W) ExAcquireResourceExclusiveLite(&(T)->TableLock, (W))
|
|
|
|
#define RxReleasePrefixTableLock(T) ExReleaseResourceLite(&(T)->TableLock)
|
[RDBSS]
[RXCE]
[DDK]
Add an initial implementation of the RXCE and RDBSS libraries that are used to implement mini-redirectors
The associated headers are also added to DDK
The implementation is partial (really!) and is only working for read-only operations.
It leaks memory as hell (no refcounting implemented) and thus, objects freeing is not implemented.
It was tested with NFS41 driver. With such RDBSS, it's possible for the driver to mount a remote share, to list
files, to query their properties, to query volume properties, and finally to read files (with some corruption under
specific conditions).
Please refrain from committing in this (especially for modifying whitespaces or fixing comments...), this is still WIP
and under development, it would mess with my local changes!
In itself, it doesn't bring anything to ReactOS yet, as no mini redirector is available in ReactOS source tree.
This may come later on with NFS41.
More to follow...
CORE-11327
svn path=/trunk/; revision=74674
2017-05-26 20:52:18 +00:00
|
|
|
#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
|