ReactOS 0.4.16-dev-258-g81860b4
rxprocs.h File Reference
#include "backpack.h"
#include "rxlog.h"
#include "rxtimer.h"
#include "rxstruc.h"
Include dependency graph for rxprocs.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define RxLogFailure(DO, Originator, Event, Status)    RxLogEventDirect(DO, Originator, Event, Status, __LINE__)
 
#define FCB_MODE_EXCLUSIVE   1
 
#define FCB_MODE_SHARED   2
 
#define FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE   3
 
#define FCB_MODE_SHARED_STARVE_EXCLUSIVE   4
 
#define CHANGE_BUFFERING_STATE_CONTEXT   ((PRX_CONTEXT)IntToPtr(0xffffffff))
 
#define CHANGE_BUFFERING_STATE_CONTEXT_WAIT   ((PRX_CONTEXT)IntToPtr(0xfffffffe))
 
#define RxAcquireExclusiveFcb(R, F)   __RxAcquireFcb((F), (R), FCB_MODE_EXCLUSIVE)
 
#define RX_GET_MRX_FCB(F)   ((PMRX_FCB)((F)))
 
#define RxAcquireSharedFcb(R, F)   __RxAcquireFcb((F), (R), FCB_MODE_SHARED)
 
#define RxAcquireSharedFcbWaitForEx(R, F)   __RxAcquireFcb((F), (R), FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE)
 
#define RxReleaseFcb(R, F)   __RxReleaseFcb((R), RX_GET_MRX_FCB(F))
 
#define RxReleaseFcbForThread(R, F, T)   __RxReleaseFcbForThread((R), RX_GET_MRX_FCB(F), (T))
 
#define RxTrackerUpdateHistory(R, F, O, L, F, S)   { NOTHING; }
 
#define RxIsFcbAcquiredShared(Fcb)   ExIsResourceAcquiredSharedLite((Fcb)->Header.Resource)
 
#define RxIsFcbAcquiredExclusive(Fcb)   ExIsResourceAcquiredExclusiveLite((Fcb)->Header.Resource)
 
#define RxIsFcbAcquired(Fcb)
 
#define RxAcquirePagingIoResource(RxContext, Fcb)
 
#define RxAcquirePagingIoResourceShared(RxContext, Fcb, Flag)
 
#define RxReleasePagingIoResource(RxContext, Fcb)
 
#define RxReleasePagingIoResourceForThread(RxContext, Fcb, Thread)
 
#define RxConvertToSharedFcb(R, F)   ExConvertExclusiveToSharedLite(RX_GET_MRX_FCB(F)->Header.Resource)
 
#define QuadAlign(V)   (ALIGN_UP(V, ULONGLONG))
 
#define RxCompleteAsynchronousRequest(C, S)   RxCompleteRequest(C, S)
 
#define RxDumpWantedAccess(w1, w2, wlt, DA, DSA)   {NOTHING;}
 
#define RxDumpCurrentAccess(w1, w2, wlt, SA)   {NOTHING;}
 
#define RxCheckShareAccess(a1, a2, a3, a4, a5, a6, a7)   IoCheckShareAccess(a1, a2, a3, a4, a5)
 
#define RxRemoveShareAccess(a1, a2, a3, a4)   IoRemoveShareAccess(a1, a2)
 
#define RxSetShareAccess(a1, a2, a3, a4, a5, a6)   IoSetShareAccess(a1, a2, a3, a4)
 
#define RxUpdateShareAccess(a1, a2, a3, a4)   IoUpdateShareAccess(a1, a2)
 
#define RxEqualConnectionId(C1, C2)   RtlEqualMemory(C1, C2, sizeof(RX_CONNECTION_ID))
 

Typedefs

typedef enum _RX_NAME_CONJURING_METHODS RX_NAME_CONJURING_METHODS
 

Enumerations

enum  _RX_NAME_CONJURING_METHODS { VNetRoot_As_Prefix , VNetRoot_As_UNC_Name , VNetRoot_As_DriveLetter }
 

Functions

VOID NTAPI RxLogEventDirect (_In_ PRDBSS_DEVICE_OBJECT DeviceObject, _In_ PUNICODE_STRING OriginatorId, _In_ ULONG EventId, _In_ NTSTATUS Status, _In_ ULONG Line)
 
VOID NTAPI RxLogEventWithAnnotation (_In_ PRDBSS_DEVICE_OBJECT DeviceObject, _In_ ULONG EventId, _In_ NTSTATUS Status, _In_ PVOID DataBuffer, _In_ USHORT DataBufferLength, _In_ PUNICODE_STRING Annotation, _In_ ULONG AnnotationCount)
 
NTSTATUS RxPrefixClaim (_In_ PRX_CONTEXT RxContext)
 
VOID RxpPrepareCreateContextForReuse (_In_ PRX_CONTEXT RxContext)
 
NTSTATUS RxLowIoCompletionTail (_In_ PRX_CONTEXT RxContext)
 
LUID RxGetUid (_In_ PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext)
 
ULONG RxGetSessionId (_In_ PIO_STACK_LOCATION IrpSp)
 
NTSTATUS RxFindOrCreateConnections (_In_ PRX_CONTEXT RxContext, _In_ PUNICODE_STRING CanonicalName, _In_ NET_ROOT_TYPE NetRootType, _Out_ PUNICODE_STRING LocalNetRootName, _Out_ PUNICODE_STRING FilePathName, _Inout_ PLOCK_HOLDING_STATE LockState, _In_ PRX_CONNECTION_ID RxConnectionId)
 
VOID RxConjureOriginalName (_Inout_ PFCB Fcb, _Inout_ PFOBX Fobx, _Out_ PULONG ActualNameLength, _Out_writes_bytes_(*LengthRemaining) PWCHAR OriginalName, _Inout_ PLONG LengthRemaining, _In_ RX_NAME_CONJURING_METHODS NameConjuringMethod)
 
NTSTATUS NTAPI RxCompleteMdl (_In_ PRX_CONTEXT RxContext)
 
VOID RxLockUserBuffer (_In_ PRX_CONTEXT RxContext, _In_ LOCK_OPERATION Operation, _In_ ULONG BufferLength)
 
PVOID RxMapSystemBuffer (_In_ PRX_CONTEXT RxContext)
 
NTSTATUS __RxAcquireFcb (_Inout_ PFCB Fcb, _Inout_opt_ PRX_CONTEXT RxContext, _In_ ULONG Mode)
 
VOID __RxReleaseFcb (_Inout_opt_ PRX_CONTEXT RxContext, _Inout_ PMRX_FCB MrxFcb)
 
VOID __RxReleaseFcbForThread (_Inout_opt_ PRX_CONTEXT RxContext, _Inout_ PMRX_FCB MrxFcb, _In_ ERESOURCE_THREAD ResourceThreadId)
 
VOID RxTrackPagingIoResource (_Inout_ PVOID Instance, _In_ ULONG Type, _In_ ULONG Line, _In_ PCSTR File)
 
BOOLEAN NTAPI RxAcquireFcbForLazyWrite (_In_ PVOID Null, _In_ BOOLEAN Wait)
 
VOID NTAPI RxReleaseFcbFromLazyWrite (_In_ PVOID Null)
 
BOOLEAN NTAPI RxAcquireFcbForReadAhead (_In_ PVOID Null, _In_ BOOLEAN Wait)
 
VOID NTAPI RxReleaseFcbFromReadAhead (_In_ PVOID Null)
 
BOOLEAN NTAPI RxNoOpAcquire (_In_ PVOID Fcb, _In_ BOOLEAN Wait)
 
VOID NTAPI RxNoOpRelease (_In_ PVOID Fcb)
 
VOID RxVerifyOperationIsLegal (_In_ PRX_CONTEXT RxContext)
 
VOID RxPrePostIrp (_In_ PVOID Context, _In_ PIRP Irp)
 
VOID NTAPI RxAddToWorkque (_In_ PRX_CONTEXT RxContext, _In_ PIRP Irp)
 
NTSTATUS RxFsdPostRequest (_In_ PRX_CONTEXT RxContext)
 
VOID RxCompleteRequest_Real (_In_ PRX_CONTEXT RxContext, _In_ PIRP Irp, _In_ NTSTATUS Status)
 
NTSTATUS RxCompleteRequest (_In_ PRX_CONTEXT pContext, _In_ NTSTATUS Status)
 
NTSTATUS RxConstructSrvCall (_In_ PRX_CONTEXT RxContext, _In_ PSRV_CALL SrvCall, _Out_ PLOCK_HOLDING_STATE LockHoldingState)
 
NTSTATUS RxConstructNetRoot (_In_ PRX_CONTEXT RxContext, _In_ PSRV_CALL SrvCall, _In_ PNET_ROOT NetRoot, _In_ PV_NET_ROOT VirtualNetRoot, _Out_ PLOCK_HOLDING_STATE LockHoldingState)
 
NTSTATUS RxConstructVirtualNetRoot (_In_ PRX_CONTEXT RxContext, _In_ PUNICODE_STRING CanonicalName, _In_ NET_ROOT_TYPE NetRootType, _Out_ PV_NET_ROOT *VirtualNetRootPointer, _Out_ PLOCK_HOLDING_STATE LockHoldingState, _Out_ PRX_CONNECTION_ID RxConnectionId)
 
NTSTATUS RxFindOrConstructVirtualNetRoot (_In_ PRX_CONTEXT RxContext, _In_ PUNICODE_STRING CanonicalName, _In_ NET_ROOT_TYPE NetRootType, _In_ PUNICODE_STRING RemainingName)
 
NTSTATUS RxLowIoLockControlShell (_In_ PRX_CONTEXT RxContext)
 
NTSTATUS NTAPI RxChangeBufferingState (PSRV_OPEN SrvOpen, PVOID Context, BOOLEAN ComputeNewState)
 
VOID NTAPI RxIndicateChangeOfBufferingStateForSrvOpen (PMRX_SRV_CALL SrvCall, PMRX_SRV_OPEN SrvOpen, PVOID SrvOpenKey, PVOID Context)
 
NTSTATUS NTAPI RxPrepareToReparseSymbolicLink (PRX_CONTEXT RxContext, BOOLEAN SymbolicLinkEmbeddedInOldPath, PUNICODE_STRING NewPath, BOOLEAN NewPathIsAbsolute, PBOOLEAN ReparseRequired)
 
VOID RxReference (_Inout_ PVOID Instance)
 
VOID RxDereference (_Inout_ PVOID Instance, _In_ LOCK_HOLDING_STATE LockHoldingState)
 
VOID RxWaitForStableCondition (_In_ PRX_BLOCK_CONDITION Condition, _Inout_ PLIST_ENTRY TransitionWaitList, _Inout_ PRX_CONTEXT RxContext, _Out_opt_ NTSTATUS *AsyncStatus)
 
VOID RxUpdateCondition (_In_ RX_BLOCK_CONDITION NewConditionValue, _Out_ PRX_BLOCK_CONDITION Condition, _In_ OUT PLIST_ENTRY TransitionWaitList)
 
NTSTATUS RxCloseAssociatedSrvOpen (_In_ PFOBX Fobx, _In_opt_ PRX_CONTEXT RxContext)
 
NTSTATUS NTAPI RxFinalizeConnection (_Inout_ PNET_ROOT NetRoot, _Inout_opt_ PV_NET_ROOT VNetRoot, _In_ LOGICAL ForceFilesClosed)
 
NTSTATUS RxCheckShareAccessPerSrvOpens (_In_ PFCB Fcb, _In_ ACCESS_MASK DesiredAccess, _In_ ULONG DesiredShareAccess)
 
VOID RxUpdateShareAccessPerSrvOpens (_In_ PSRV_OPEN SrvOpen)
 
VOID RxRemoveShareAccessPerSrvOpens (_Inout_ PSRV_OPEN SrvOpen)
 
NTSTATUS NTAPI RxDriverEntry (_In_ PDRIVER_OBJECT DriverObject, _In_ PUNICODE_STRING RegistryPath)
 
VOID NTAPI RxUnload (_In_ PDRIVER_OBJECT DriverObject)
 
VOID RxInitializeMinirdrDispatchTable (_In_ PDRIVER_OBJECT DriverObject)
 
ULONG RxGetNetworkProviderPriority (_In_ PUNICODE_STRING DeviceName)
 
VOID RxPrepareRequestForReuse (PCHANGE_BUFFERING_STATE_REQUEST Request)
 
VOID RxpDiscardChangeBufferingStateRequests (_Inout_ PLIST_ENTRY DiscardedRequests)
 
VOID RxGatherRequestsForSrvOpen (_Inout_ PSRV_CALL SrvCall, _In_ PSRV_OPEN SrvOpen, _Inout_ PLIST_ENTRY RequestsListHead)
 
NTSTATUS RxpLookupSrvOpenForRequestLite (_In_ PSRV_CALL SrvCall, _Inout_ PCHANGE_BUFFERING_STATE_REQUEST Request)
 
VOID RxProcessChangeBufferingStateRequestsForSrvOpen (PSRV_OPEN SrvOpen)
 
NTSTATUS RxPurgeFobxFromCache (PFOBX FobxToBePurged)
 
BOOLEAN RxPurgeFobx (PFOBX pFobx)
 
VOID RxUndoScavengerFinalizationMarking (PVOID Instance)
 
ULONG RxTableComputePathHashValue (_In_ PUNICODE_STRING Name)
 
VOID RxExtractServerName (_In_ PUNICODE_STRING FilePathName, _Out_ PUNICODE_STRING SrvCallName, _Out_ PUNICODE_STRING RestOfName)
 
VOID NTAPI RxCreateNetRootCallBack (_In_ PMRX_CREATENETROOT_CONTEXT CreateNetRootContext)
 
PVOID RxAllocateObject (_In_ NODE_TYPE_CODE NodeType, _In_opt_ PMINIRDR_DISPATCH MRxDispatch, _In_ ULONG NameLength)
 
VOID RxFreeObject (_In_ PVOID pObject)
 
NTSTATUS RxInitializeSrvCallParameters (_In_ PRX_CONTEXT RxContext, _Inout_ PSRV_CALL SrvCall)
 
VOID RxAddVirtualNetRootToNetRoot (_In_ PNET_ROOT NetRoot, _In_ PV_NET_ROOT VNetRoot)
 
VOID RxRemoveVirtualNetRootFromNetRoot (_In_ PNET_ROOT NetRoot, _In_ PV_NET_ROOT VNetRoot)
 
PVOID RxAllocateFcbObject (_In_ PRDBSS_DEVICE_OBJECT RxDeviceObject, _In_ NODE_TYPE_CODE NodeType, _In_ POOL_TYPE PoolType, _In_ ULONG NameSize, _In_opt_ PVOID AlreadyAllocatedObject)
 
VOID RxFreeFcbObject (_In_ PVOID Object)
 
VOID RxPurgeFcb (_In_ PFCB Fcb)
 
BOOLEAN RxFinalizeNetFcb (_Out_ PFCB ThisFcb, _In_ BOOLEAN RecursiveFinalize, _In_ BOOLEAN ForceFinalize, _In_ LONG ReferenceCount)
 
BOOLEAN RxIsThisACscAgentOpen (_In_ PRX_CONTEXT RxContext)
 
VOID NTAPI RxCheckFcbStructuresForAlignment (VOID)
 
NTSTATUS RxInitializeWorkQueueDispatcher (_In_ PRX_WORK_QUEUE_DISPATCHER Dispatcher)
 
VOID RxInitializeWorkQueue (_In_ PRX_WORK_QUEUE WorkQueue, _In_ WORK_QUEUE_TYPE WorkQueueType, _In_ ULONG MaximumNumberOfWorkerThreads, _In_ ULONG MinimumNumberOfWorkerThreads)
 
NTSTATUS RxSpinUpWorkerThread (_In_ PRX_WORK_QUEUE WorkQueue, _In_ PRX_WORKERTHREAD_ROUTINE Routine, _In_ PVOID Parameter)
 
VOID RxSpinUpWorkerThreads (_In_ PRX_WORK_QUEUE WorkQueue)
 
VOID NTAPI RxSpinUpRequestsDispatcher (_In_ PVOID Dispatcher)
 
VOID RxpWorkerThreadDispatcher (_In_ PRX_WORK_QUEUE WorkQueue, _In_ PLARGE_INTEGER WaitInterval)
 
VOID NTAPI RxBootstrapWorkerThreadDispatcher (_In_ PVOID WorkQueue)
 
PRX_PREFIX_ENTRY RxTableLookupName_ExactLengthMatch (_In_ PRX_PREFIX_TABLE ThisTable, _In_ PUNICODE_STRING Name, _In_ ULONG HashValue, _In_opt_ PRX_CONNECTION_ID RxConnectionId)
 
PVOID RxTableLookupName (_In_ PRX_PREFIX_TABLE ThisTable, _In_ PUNICODE_STRING Name, _Out_ PUNICODE_STRING RemainingName, _In_opt_ PRX_CONNECTION_ID RxConnectionId)
 
VOID RxOrphanSrvOpens (_In_ PV_NET_ROOT ThisVNetRoot)
 
VOID RxOrphanThisFcb (_In_ PFCB Fcb)
 
VOID RxOrphanSrvOpensForThisFcb (_In_ PFCB Fcb, _In_ PV_NET_ROOT ThisVNetRoot, _In_ BOOLEAN OrphanAll)
 
NTSTATUS NTAPI RxLockOperationCompletion (_In_ PVOID Context, _In_ PIRP Irp)
 
VOID NTAPI RxUnlockOperation (_In_ PVOID Context, _In_ PFILE_LOCK_INFO LockInfo)
 
NTSTATUS RxPostStackOverflowRead (_In_ PRX_CONTEXT RxContext)
 
VOID NTAPI RxCancelRoutine (_In_ PDEVICE_OBJECT DeviceObject, _In_ PIRP Irp)
 

Variables

PVOID RxNull
 

Macro Definition Documentation

◆ CHANGE_BUFFERING_STATE_CONTEXT

#define CHANGE_BUFFERING_STATE_CONTEXT   ((PRX_CONTEXT)IntToPtr(0xffffffff))

Definition at line 135 of file rxprocs.h.

◆ CHANGE_BUFFERING_STATE_CONTEXT_WAIT

#define CHANGE_BUFFERING_STATE_CONTEXT_WAIT   ((PRX_CONTEXT)IntToPtr(0xfffffffe))

Definition at line 136 of file rxprocs.h.

◆ FCB_MODE_EXCLUSIVE

#define FCB_MODE_EXCLUSIVE   1

Definition at line 130 of file rxprocs.h.

◆ FCB_MODE_SHARED

#define FCB_MODE_SHARED   2

Definition at line 131 of file rxprocs.h.

◆ FCB_MODE_SHARED_STARVE_EXCLUSIVE

#define FCB_MODE_SHARED_STARVE_EXCLUSIVE   4

Definition at line 133 of file rxprocs.h.

◆ FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE

#define FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE   3

Definition at line 132 of file rxprocs.h.

◆ QuadAlign

#define QuadAlign (   V)    (ALIGN_UP(V, ULONGLONG))

Definition at line 358 of file rxprocs.h.

◆ RX_GET_MRX_FCB

#define RX_GET_MRX_FCB (   F)    ((PMRX_FCB)((F)))

Definition at line 157 of file rxprocs.h.

◆ RxAcquireExclusiveFcb

#define RxAcquireExclusiveFcb (   R,
  F 
)    __RxAcquireFcb((F), (R), FCB_MODE_EXCLUSIVE)

Definition at line 154 of file rxprocs.h.

◆ RxAcquirePagingIoResource

#define RxAcquirePagingIoResource (   RxContext,
  Fcb 
)
Value:
ExAcquireResourceExclusiveLite((Fcb)->Header.PagingIoResource, TRUE); \
if (RxContext != NULL) \
{ \
(RxContext)->FcbPagingIoResourceAcquired = TRUE; \
} \
RxTrackPagingIoResource(Fcb, 1, __LINE__, __FILE__)
_In_ PFCB Fcb
Definition: cdprocs.h:159
Definition: Header.h:9
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
#define ExAcquireResourceExclusiveLite(res, wait)
Definition: env_spec_w32.h:615

Definition at line 233 of file rxprocs.h.

◆ RxAcquirePagingIoResourceShared

#define RxAcquirePagingIoResourceShared (   RxContext,
  Fcb,
  Flag 
)
Value:
ExAcquireResourceSharedLite((Fcb)->Header.PagingIoResource, Flag); \
if (AcquiredFile) \
{ \
if (RxContext != NULL) \
{ \
((PRX_CONTEXT)RxContext)->FcbPagingIoResourceAcquired = TRUE; \
} \
RxTrackPagingIoResource(Fcb, 2, __LINE__, __FILE__); \
}
#define ExAcquireResourceSharedLite(res, wait)
Definition: env_spec_w32.h:621
struct _RX_CONTEXT * PRX_CONTEXT
Definition: xml2sdb.h:80

Definition at line 242 of file rxprocs.h.

◆ RxAcquireSharedFcb

#define RxAcquireSharedFcb (   R,
  F 
)    __RxAcquireFcb((F), (R), FCB_MODE_SHARED)

Definition at line 162 of file rxprocs.h.

◆ RxAcquireSharedFcbWaitForEx

#define RxAcquireSharedFcbWaitForEx (   R,
  F 
)    __RxAcquireFcb((F), (R), FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE)

Definition at line 168 of file rxprocs.h.

◆ RxCheckShareAccess

#define RxCheckShareAccess (   a1,
  a2,
  a3,
  a4,
  a5,
  a6,
  a7 
)    IoCheckShareAccess(a1, a2, a3, a4, a5)

Definition at line 578 of file rxprocs.h.

◆ RxCompleteAsynchronousRequest

#define RxCompleteAsynchronousRequest (   C,
  S 
)    RxCompleteRequest(C, S)

Definition at line 386 of file rxprocs.h.

◆ RxConvertToSharedFcb

#define RxConvertToSharedFcb (   R,
  F 
)    ExConvertExclusiveToSharedLite(RX_GET_MRX_FCB(F)->Header.Resource)

Definition at line 337 of file rxprocs.h.

◆ RxDumpCurrentAccess

#define RxDumpCurrentAccess (   w1,
  w2,
  wlt,
  SA 
)    {NOTHING;}

Definition at line 527 of file rxprocs.h.

◆ RxDumpWantedAccess

#define RxDumpWantedAccess (   w1,
  w2,
  wlt,
  DA,
  DSA 
)    {NOTHING;}

Definition at line 526 of file rxprocs.h.

◆ RxEqualConnectionId

#define RxEqualConnectionId (   C1,
  C2 
)    RtlEqualMemory(C1, C2, sizeof(RX_CONNECTION_ID))

Definition at line 774 of file rxprocs.h.

◆ RxIsFcbAcquired

#define RxIsFcbAcquired (   Fcb)
Value:
ExIsResourceAcquiredExclusiveLite((Fcb)->Header.Resource))
ULONG NTAPI ExIsResourceAcquiredSharedLite(IN PERESOURCE Resource)
Definition: resource.c:1663

Definition at line 230 of file rxprocs.h.

◆ RxIsFcbAcquiredExclusive

#define RxIsFcbAcquiredExclusive (   Fcb)    ExIsResourceAcquiredExclusiveLite((Fcb)->Header.Resource)

Definition at line 229 of file rxprocs.h.

◆ RxIsFcbAcquiredShared

#define RxIsFcbAcquiredShared (   Fcb)    ExIsResourceAcquiredSharedLite((Fcb)->Header.Resource)

Definition at line 228 of file rxprocs.h.

◆ RxLogFailure

#define RxLogFailure (   DO,
  Originator,
  Event,
  Status 
)     RxLogEventDirect(DO, Originator, Event, Status, __LINE__)

Definition at line 11 of file rxprocs.h.

◆ RxReleaseFcb

#define RxReleaseFcb (   R,
  F 
)    __RxReleaseFcb((R), RX_GET_MRX_FCB(F))

Definition at line 186 of file rxprocs.h.

◆ RxReleaseFcbForThread

#define RxReleaseFcbForThread (   R,
  F,
  T 
)    __RxReleaseFcbForThread((R), RX_GET_MRX_FCB(F), (T))

Definition at line 205 of file rxprocs.h.

◆ RxReleasePagingIoResource

#define RxReleasePagingIoResource (   RxContext,
  Fcb 
)
Value:
RxTrackPagingIoResource(Fcb, 3, __LINE__, __FILE__); \
if (RxContext != NULL) \
{ \
(RxContext)->FcbPagingIoResourceAcquired = FALSE; \
} \
ExReleaseResourceLite((Fcb)->Header.PagingIoResource)
#define FALSE
Definition: types.h:117
VOID RxTrackPagingIoResource(_Inout_ PVOID Instance, _In_ ULONG Type, _In_ ULONG Line, _In_ PCSTR File)
Definition: rxce.c:8654

Definition at line 268 of file rxprocs.h.

◆ RxReleasePagingIoResourceForThread

#define RxReleasePagingIoResourceForThread (   RxContext,
  Fcb,
  Thread 
)
Value:
RxTrackPagingIoResource(Fcb, 3, __LINE__, __FILE__); \
if (RxContext != NULL) \
{ \
(RxContext)->FcbPagingIoResourceAcquired = FALSE; \
} \
ExReleaseResourceForThreadLite((Fcb)->Header.PagingIoResource, (Thread))
_In_opt_ PFILE_OBJECT _In_opt_ PETHREAD Thread
Definition: fltkernel.h:2653

Definition at line 276 of file rxprocs.h.

◆ RxRemoveShareAccess

#define RxRemoveShareAccess (   a1,
  a2,
  a3,
  a4 
)    IoRemoveShareAccess(a1, a2)

Definition at line 579 of file rxprocs.h.

◆ RxSetShareAccess

#define RxSetShareAccess (   a1,
  a2,
  a3,
  a4,
  a5,
  a6 
)    IoSetShareAccess(a1, a2, a3, a4)

Definition at line 580 of file rxprocs.h.

◆ RxTrackerUpdateHistory

#define RxTrackerUpdateHistory (   R,
  F,
  O,
  L,
  F,
  S 
)    { NOTHING; }

Definition at line 218 of file rxprocs.h.

◆ RxUpdateShareAccess

#define RxUpdateShareAccess (   a1,
  a2,
  a3,
  a4 
)    IoUpdateShareAccess(a1, a2)

Definition at line 581 of file rxprocs.h.

Typedef Documentation

◆ RX_NAME_CONJURING_METHODS

Enumeration Type Documentation

◆ _RX_NAME_CONJURING_METHODS

Enumerator
VNetRoot_As_Prefix 
VNetRoot_As_UNC_Name 
VNetRoot_As_DriveLetter 

Definition at line 78 of file rxprocs.h.

79{
enum _RX_NAME_CONJURING_METHODS RX_NAME_CONJURING_METHODS
@ VNetRoot_As_DriveLetter
Definition: rxprocs.h:82
@ VNetRoot_As_Prefix
Definition: rxprocs.h:80
@ VNetRoot_As_UNC_Name
Definition: rxprocs.h:81

Function Documentation

◆ __RxAcquireFcb()

NTSTATUS __RxAcquireFcb ( _Inout_ PFCB  Fcb,
_Inout_opt_ PRX_CONTEXT  RxContext,
_In_ ULONG  Mode 
)

Definition at line 8973 of file rxce.c.

8984{
8986 BOOLEAN SpecialContext, CanWait, Acquired, ContextIsPresent;
8987
8988 PAGED_CODE();
8989
8990 DPRINT("__RxAcquireFcb(%p, %p, %d, %d, %s, %d)\n", Fcb, RxContext, Mode, LineNumber, FileName, SerialNumber);
8991
8992 SpecialContext = FALSE;
8993 ContextIsPresent = FALSE;
8994 /* Check for special context */
8996 {
8997 SpecialContext = TRUE;
8998 }
8999
9000 /* We don't handle buffering state change yet... */
9001 if (!RxIsFcbAcquired(Fcb) && !SpecialContext &&
9003 {
9005 }
9006
9007 /* Nor special contexts */
9008 if (SpecialContext)
9009 {
9011 }
9012
9013 /* If we don't have a context, assume we can wait! */
9014 if (RxContext == NULL)
9015 {
9016 CanWait = TRUE;
9017 }
9018 else
9019 {
9020 /* That said: we have a real context! */
9021 ContextIsPresent = TRUE;
9022
9023 /* If we've been cancelled in between, give up */
9025 if (!NT_SUCCESS(Status))
9026 {
9027 return Status;
9028 }
9029
9030 /* Can we wait? */
9031 CanWait = BooleanFlagOn(RxContext->Flags, RX_CONTEXT_FLAG_WAIT);
9032 }
9033
9034 while (TRUE)
9035 {
9036 /* Assume we cannot lock */
9038
9039 /* Lock according to what the caller asked */
9040 switch (Mode)
9041 {
9042 case FCB_MODE_EXCLUSIVE:
9043 Acquired = ExAcquireResourceExclusiveLite(Fcb->Header.Resource, CanWait);
9044 break;
9045
9046 case FCB_MODE_SHARED:
9047 Acquired = ExAcquireResourceSharedLite(Fcb->Header.Resource, CanWait);
9048 break;
9049
9051 Acquired = ExAcquireSharedWaitForExclusive(Fcb->Header.Resource, CanWait);
9052 break;
9053
9054 default:
9056 Acquired = ExAcquireSharedStarveExclusive(Fcb->Header.Resource, CanWait);
9057 break;
9058 }
9059
9060 /* Lock granted! */
9061 if (Acquired)
9062 {
9065
9066 /* Handle paging write - not implemented */
9068 {
9070 }
9071 }
9072
9073 /* And break, that cool! */
9074 if (Acquired)
9075 {
9076 break;
9077 }
9078
9079 /* If it failed, return immediately */
9080 if (!NT_SUCCESS(Status))
9081 {
9082 return Status;
9083 }
9084 }
9085
9086 /* If we don't have to check for valid operation, job done, nothing more to do */
9087 if (!ContextIsPresent || BooleanFlagOn(RxContext->Flags, RX_CONTEXT_FLAG_BYPASS_VALIDOP_CHECK))
9088 {
9089 if (NT_SUCCESS(Status))
9090 {
9091 RxTrackerUpdateHistory(RxContext, RX_GET_MRX_FCB(Fcb), TRACKER_ACQUIRE_FCB, LineNumber, FileName, SerialNumber);
9092 }
9093
9094 return Status;
9095 }
9096
9097 /* Verify operation */
9098 _SEH2_TRY
9099 {
9100 RxVerifyOperationIsLegal(RxContext);
9101 }
9103 {
9104 /* If it failed, release lock and fail */
9106 {
9107 ExReleaseResourceLite(Fcb->Header.Resource);
9109 }
9110 }
9111 _SEH2_END;
9112
9113 if (NT_SUCCESS(Status))
9114 {
9115 RxTrackerUpdateHistory(RxContext, RX_GET_MRX_FCB(Fcb), TRACKER_ACQUIRE_FCB, LineNumber, FileName, SerialNumber);
9116 }
9117
9118 DPRINT("Status: %x\n", Status);
9119 return Status;
9120}
#define PAGED_CODE()
unsigned char BOOLEAN
ACPI_BUFFER *RetBuffer ACPI_BUFFER *RetBuffer char ACPI_WALK_RESOURCE_CALLBACK void *Context ACPI_BUFFER *RetBuffer UINT16 ACPI_RESOURCE **ResourcePtr ACPI_GENERIC_ADDRESS *Reg UINT32 *ReturnValue UINT8 UINT8 *Slp_TypB ACPI_PHYSICAL_ADDRESS PhysicalAddress64 UINT32 UINT32 *TimeElapsed UINT32 LineNumber
Definition: acpixf.h:1220
LONG NTSTATUS
Definition: precomp.h:26
#define UNIMPLEMENTED
Definition: ntoskrnl.c:15
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:33
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
#define FCB_STATE_BUFFERING_STATE_CHANGE_PENDING
Definition: fcb.h:207
#define ASSERT_CORRECT_FCB_STRUCTURE(Fcb)
Definition: fcb.h:562
#define _SEH2_FINALLY
Definition: filesup.c:21
#define _SEH2_END
Definition: filesup.c:22
#define _SEH2_TRY
Definition: filesup.c:19
Status
Definition: gdiplustypes.h:25
_In_ ULONG Mode
Definition: hubbusif.h:303
#define ASSERT(a)
Definition: mode.c:44
BOOLEAN NTAPI ExAcquireSharedWaitForExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:1222
BOOLEAN NTAPI ExAcquireSharedStarveExclusive(IN PERESOURCE Resource, IN BOOLEAN Wait)
Definition: resource.c:1068
VOID FASTCALL ExReleaseResourceLite(IN PERESOURCE Resource)
Definition: resource.c:1822
#define STATUS_LOCK_NOT_GRANTED
Definition: ntstatus.h:321
#define _SEH2_AbnormalTermination()
Definition: pseh2_64.h:166
VOID RxVerifyOperationIsLegal(IN PRX_CONTEXT RxContext)
Definition: rxce.c:8759
ULONG SerialNumber
Definition: rxce.c:117
@ RX_CONTEXT_FLAG_CANCELLED
Definition: rxcontx.h:300
@ RX_CONTEXT_FLAG_BYPASS_VALIDOP_CHECK
Definition: rxcontx.h:303
@ RX_CONTEXT_FLAG_WAIT
Definition: rxcontx.h:282
#define FCB_MODE_EXCLUSIVE
Definition: rxprocs.h:130
#define CHANGE_BUFFERING_STATE_CONTEXT
Definition: rxprocs.h:135
#define FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE
Definition: rxprocs.h:132
#define FCB_MODE_SHARED_STARVE_EXCLUSIVE
Definition: rxprocs.h:133
#define RX_GET_MRX_FCB(F)
Definition: rxprocs.h:157
#define RxTrackerUpdateHistory(R, F, O, L, F, S)
Definition: rxprocs.h:218
#define CHANGE_BUFFERING_STATE_CONTEXT_WAIT
Definition: rxprocs.h:136
#define RxIsFcbAcquired(Fcb)
Definition: rxprocs.h:230
#define FCB_MODE_SHARED
Definition: rxprocs.h:131
#define STATUS_SUCCESS
Definition: shellext.h:65
#define DPRINT
Definition: sndvol32.h:73
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:925
ULONG FcbState
Definition: cdstruc.h:971
PNON_PAGED_FCB NonPaged
Definition: fatstruc.h:811
ULONG OutstandingAsyncWrites
Definition: fatstruc.h:737
#define STATUS_CANCELLED
Definition: udferr_usr.h:170

◆ __RxReleaseFcb()

VOID __RxReleaseFcb ( _Inout_opt_ PRX_CONTEXT  RxContext,
_Inout_ PMRX_FCB  MrxFcb 
)

Definition at line 9142 of file rxce.c.

9152{
9153 BOOLEAN IsExclusive, BufferingPending;
9154
9156
9157 BufferingPending = BooleanFlagOn(MrxFcb->FcbState, FCB_STATE_BUFFERING_STATE_CHANGE_PENDING);
9158 IsExclusive = !!RxIsResourceOwnershipStateExclusive(MrxFcb->Header.Resource);
9159
9160 /* If no buffering pending, or no exclusive lock (we can only handle with an exclusive lock),
9161 * then just release the FCB
9162 */
9163 if (!BufferingPending || !IsExclusive)
9164 {
9165 RxTrackerUpdateHistory(RxContext, MrxFcb, (!BufferingPending ? TRACKER_RELEASE_FCB_NO_BUFF_PENDING : TRACKER_RELEASE_NON_EXCL_FCB_BUFF_PENDING),
9167 ExReleaseResourceLite(MrxFcb->Header.Resource);
9168 }
9169
9171
9172 /* And finally leave */
9173 if (!BufferingPending || !IsExclusive)
9174 {
9175 return;
9176 }
9177
9179
9180 /* Otherwise, handle buffering state and release */
9182
9183 RxTrackerUpdateHistory(RxContext, MrxFcb, TRACKER_RELEASE_EXCL_FCB_BUFF_PENDING, LineNumber, FileName, SerialNumber);
9184 ExReleaseResourceLite(MrxFcb->Header.Resource);
9185}
#define RxIsResourceOwnershipStateExclusive(Resource)
Definition: ntrxdef.h:28
VOID RxProcessFcbChangeBufferingStateRequest(PFCB Fcb)
Definition: rxce.c:6685
#define RxReleaseSerializationMutex()
Definition: rxdata.h:9
#define RxAcquireSerializationMutex()
Definition: rxdata.h:8
#define RxIsFcbAcquiredExclusive(Fcb)
Definition: rxprocs.h:229
Definition: cdstruc.h:902
_In_ PWDFDEVICE_INIT _In_ BOOLEAN IsExclusive
Definition: wdfdevice.h:3112

◆ __RxReleaseFcbForThread()

VOID __RxReleaseFcbForThread ( _Inout_opt_ PRX_CONTEXT  RxContext,
_Inout_ PMRX_FCB  MrxFcb,
_In_ ERESOURCE_THREAD  ResourceThreadId 
)

Definition at line 9188 of file rxce.c.

9199{
9200 BOOLEAN IsExclusive, BufferingPending;
9201
9203
9204 BufferingPending = BooleanFlagOn(MrxFcb->FcbState, FCB_STATE_BUFFERING_STATE_CHANGE_PENDING);
9205 IsExclusive = !!RxIsResourceOwnershipStateExclusive(MrxFcb->Header.Resource);
9206
9207 /* If no buffering pending, or no exclusive lock (we can only handle with an exclusive lock),
9208 * then just release the FCB
9209 */
9210 if (!BufferingPending || !IsExclusive)
9211 {
9212 RxTrackerUpdateHistory(RxContext, MrxFcb,
9213 (!BufferingPending ? TRACKER_RELEASE_FCB_FOR_THRD_NO_BUFF_PENDING : TRACKER_RELEASE_NON_EXCL_FCB_FOR_THRD_BUFF_PENDING),
9215 ExReleaseResourceForThreadLite(MrxFcb->Header.Resource, ResourceThreadId);
9216 }
9217
9219
9220 /* And finally leave */
9221 if (!BufferingPending || !IsExclusive)
9222 {
9223 return;
9224 }
9225
9226 /* Otherwise, handle buffering state and release */
9227 RxTrackerUpdateHistory(RxContext, MrxFcb, TRACKER_RELEASE_EXCL_FCB_FOR_THRD_BUFF_PENDING, LineNumber, FileName, SerialNumber);
9229 ExReleaseResourceForThreadLite(MrxFcb->Header.Resource, ResourceThreadId);
9230}
#define ExReleaseResourceForThreadLite(res, thrdID)
Definition: env_spec_w32.h:635
_In_ ERESOURCE_THREAD ResourceThreadId
Definition: exfuncs.h:1052

◆ RxAcquireFcbForLazyWrite()

BOOLEAN NTAPI RxAcquireFcbForLazyWrite ( _In_ PVOID  Null,
_In_ BOOLEAN  Wait 
)

◆ RxAcquireFcbForReadAhead()

BOOLEAN NTAPI RxAcquireFcbForReadAhead ( _In_ PVOID  Null,
_In_ BOOLEAN  Wait 
)

◆ RxAddToWorkque()

VOID NTAPI RxAddToWorkque ( _In_ PRX_CONTEXT  RxContext,
_In_ PIRP  Irp 
)

◆ RxAddVirtualNetRootToNetRoot()

VOID RxAddVirtualNetRootToNetRoot ( _In_ PNET_ROOT  NetRoot,
_In_ PV_NET_ROOT  VNetRoot 
)

◆ RxAllocateFcbObject()

PVOID RxAllocateFcbObject ( _In_ PRDBSS_DEVICE_OBJECT  RxDeviceObject,
_In_ NODE_TYPE_CODE  NodeType,
_In_ POOL_TYPE  PoolType,
_In_ ULONG  NameSize,
_In_opt_ PVOID  AlreadyAllocatedObject 
)

◆ RxAllocateObject()

PVOID RxAllocateObject ( _In_ NODE_TYPE_CODE  NodeType,
_In_opt_ PMINIRDR_DISPATCH  MRxDispatch,
_In_ ULONG  NameLength 
)

◆ RxBootstrapWorkerThreadDispatcher()

VOID NTAPI RxBootstrapWorkerThreadDispatcher ( _In_ PVOID  WorkQueue)

◆ RxCancelRoutine()

VOID NTAPI RxCancelRoutine ( _In_ PDEVICE_OBJECT  DeviceObject,
_In_ PIRP  Irp 
)

◆ RxChangeBufferingState()

NTSTATUS NTAPI RxChangeBufferingState ( PSRV_OPEN  SrvOpen,
PVOID  Context,
BOOLEAN  ComputeNewState 
)

Definition at line 783 of file rxce.c.

787{
788 PFCB Fcb;
790 ULONG NewBufferingState, OldBufferingState;
791
792 PAGED_CODE();
793
794 DPRINT("RxChangeBufferingState(%p, %p, %d)\n", SrvOpen, Context, ComputeNewState);
795
796 Fcb = (PFCB)SrvOpen->pFcb;
798 /* First of all, mark that buffering state is changing */
800
801 /* Assume success */
804 {
805 /* If we're asked to compute a new state, ask the mini-rdr for it */
806 if (ComputeNewState)
807 {
808 MINIRDR_CALL_THROUGH(MiniStatus, Fcb->MRxDispatch, MRxComputeNewBufferingState,
809 ((PMRX_SRV_OPEN)SrvOpen, Context, &NewBufferingState));
811 {
812 NewBufferingState = 0;
813 }
814 }
815 else
816 {
817 /* If not, use SRV_OPEN state */
818 NewBufferingState = SrvOpen->BufferingFlags;
819 }
820
821 /* If no shared access, and if we're not asked to compute a new state, use maximum flags set */
822 if ((Fcb->ShareAccess.SharedRead + Fcb->ShareAccess.SharedWrite + Fcb->ShareAccess.SharedDelete) == 0 && !ComputeNewState)
823 {
824 SetFlag(NewBufferingState, FCB_STATE_BUFFERING_STATE_WITH_NO_SHARES);
825 }
826
827 /* If there's a lock operation to complete, clear that flag */
828 if (Fcb->OutstandingLockOperationsCount != 0)
829 {
831 }
832
833 /* Get the old state */
834 OldBufferingState = Fcb->FcbState & FCB_STATE_BUFFERING_STATE_MASK;
835 DPRINT("ChangeBufferingState %x -> %x (%x)\n", OldBufferingState, NewBufferingState, SrvOpen->BufferingFlags);
836
837 /* If we're dropping write cache, then flush the FCB */
838 if (BooleanFlagOn(OldBufferingState, FCB_STATE_WRITECACHING_ENABLED) &&
840 {
841 DPRINT("Flushing\n");
842
844 }
845
846 /* If we're dropping read cache, then purge */
847 if (Fcb->UncleanCount == 0 ||
848 (BooleanFlagOn(OldBufferingState, FCB_STATE_READCACHING_ENABLED) &&
849 !BooleanFlagOn(NewBufferingState, FCB_STATE_READCACHING_ENABLED)) ||
850 BooleanFlagOn(NewBufferingState, FCB_STATE_DELETE_ON_CLOSE))
851 {
852 DPRINT("Purging\n");
853
854 if (!NT_SUCCESS(Status))
855 {
856 DPRINT("Previous flush failed with status: %lx\n", Status);
857 }
858
860 }
861
862 /* If there's already a change pending in SRV_OPEN */
863 if (ComputeNewState && BooleanFlagOn(SrvOpen->Flags, SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING))
864 {
865 /* If there's a FOBX at least */
866 if (!IsListEmpty(&SrvOpen->FobxList))
867 {
868 PRX_CONTEXT RxContext;
869
870 /* Create a fake context to pass to the mini-rdr */
872 if (RxContext != NULL)
873 {
874 PFOBX Fobx;
875
876 RxContext->pFcb = RX_GET_MRX_FCB(Fcb);
877
878 /* Give the first FOBX */
879 Fobx = CONTAINING_RECORD(SrvOpen->FobxList.Flink, FOBX, FobxQLinks);
880 RxContext->pFobx = (PMRX_FOBX)Fobx;
881 RxContext->pRelevantSrvOpen = Fobx->pSrvOpen;
882
883 /* If there was a delayed close, perform it */
884 if (BooleanFlagOn(SrvOpen->Flags, SRVOPEN_FLAG_CLOSE_DELAYED))
885 {
886 DPRINT("Oplock break close for %p\n", SrvOpen);
887
888 RxCloseAssociatedSrvOpen(Fobx, RxContext);
889 }
890 /* Otherwise, inform the mini-rdr about completion */
891 else
892 {
893 MINIRDR_CALL_THROUGH(MiniStatus, Fcb->MRxDispatch, MRxCompleteBufferingStateChangeRequest,
894 (RxContext, (PMRX_SRV_OPEN)SrvOpen, Context));
896 }
897
899 }
900 }
901 }
902
903 /* Set the new state */
904 Fcb->FcbState ^= (NewBufferingState ^ Fcb->FcbState) & FCB_STATE_BUFFERING_STATE_MASK;
905 }
907 {
908 /* Job done, clear the flag */
910
911 if (!BooleanFlagOn(NewBufferingState, FCB_STATE_FILETIMECACHEING_ENABLED))
912 {
914 }
915 }
916 _SEH2_END;
917
918 return Status;
919}
FCB * PFCB
Definition: cdstruc.h:1040
#define IsListEmpty(ListHead)
Definition: env_spec_w32.h:954
#define ClearFlag(_F, _SF)
Definition: ext2fs.h:191
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define FCB_STATE_DELETE_ON_CLOSE
Definition: fatstruc.h:1193
#define FCB_STATE_WRITECACHING_ENABLED
Definition: fcb.h:226
#define FCB_STATE_TIME_AND_SIZE_ALREADY_SET
Definition: fcb.h:217
#define FCB_STATE_BUFFERSTATE_CHANGING
Definition: fcb.h:215
#define FCB_STATE_READCACHING_ENABLED
Definition: fcb.h:224
#define FCB_STATE_FILETIMECACHEING_ENABLED
Definition: fcb.h:218
#define FCB_STATE_BUFFERING_STATE_MASK
Definition: fcb.h:232
#define FCB_STATE_LOCK_BUFFERING_ENABLED
Definition: fcb.h:220
BOOLEAN NTAPI CcPurgeCacheSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN OPTIONAL PLARGE_INTEGER FileOffset, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps)
Definition: fssup.c:386
struct _MRX_FOBX_ * PMRX_FOBX
#define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING
Definition: mrxfcb.h:136
#define SRVOPEN_FLAG_CLOSE_DELAYED
Definition: mrxfcb.h:133
VOID NTAPI MiniStatus(IN NDIS_HANDLE MiniportHandle, IN NDIS_STATUS GeneralStatus, IN PVOID StatusBuffer, IN UINT StatusBufferSize)
Definition: miniport.c:1384
NTSTATUS RxFlushFcbInSystemCache(IN PFCB Fcb, IN BOOLEAN SynchronizeWithLazyWriter)
Definition: rxce.c:4249
PRX_CONTEXT NTAPI RxCreateRxContext(IN PIRP Irp, IN PRDBSS_DEVICE_OBJECT RxDeviceObject, IN ULONG InitialContextFlags)
Definition: rxce.c:1797
@ RX_CONTEXT_FLAG_MUST_SUCCEED_NONBLOCKING
Definition: rxcontx.h:309
#define MINIRDR_CALL_THROUGH(STATUS, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:375
#define RxDereferenceAndDeleteRxContext(RXCONTEXT)
Definition: rxcontx.h:514
NTSTATUS RxCloseAssociatedSrvOpen(_In_ PFOBX Fobx, _In_opt_ PRX_CONTEXT RxContext)
#define NodeTypeIsFcb(FCB)
Definition: nodetype.h:68
SHARE_ACCESS ShareAccess
Definition: cdstruc.h:1009
PMINIRDR_DISPATCH MRxDispatch
Definition: fcb.h:150
CLONG UncleanCount
Definition: fatstruc.h:873
PRDBSS_DEVICE_OBJECT RxDeviceObject
Definition: fcb.h:149
Definition: fcb.h:305
struct _LIST_ENTRY * Flink
Definition: typedefs.h:121
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: fatstruc.h:729
PMRX_FOBX pFobx
Definition: rxcontx.h:113
PMRX_SRV_OPEN pRelevantSrvOpen
Definition: rxcontx.h:114
PMRX_FCB pFcb
Definition: rxcontx.h:112
ULONG SharedRead
Definition: iotypes.h:529
ULONG SharedWrite
Definition: iotypes.h:530
ULONG SharedDelete
Definition: iotypes.h:531
LIST_ENTRY FobxList
Definition: fcb.h:279
#define CONTAINING_RECORD(address, type, field)
Definition: typedefs.h:260
uint32_t ULONG
Definition: typedefs.h:59

Referenced by enable_caching(), and RxCreateFromNetRoot().

◆ RxCheckFcbStructuresForAlignment()

VOID NTAPI RxCheckFcbStructuresForAlignment ( VOID  )

Definition at line 1447 of file rdbss.c.

1449{
1450 PAGED_CODE();
1451}

Referenced by RxDriverEntry().

◆ RxCheckShareAccessPerSrvOpens()

NTSTATUS RxCheckShareAccessPerSrvOpens ( _In_ PFCB  Fcb,
_In_ ACCESS_MASK  DesiredAccess,
_In_ ULONG  DesiredShareAccess 
)

◆ RxCloseAssociatedSrvOpen()

NTSTATUS RxCloseAssociatedSrvOpen ( _In_ PFOBX  Fobx,
_In_opt_ PRX_CONTEXT  RxContext 
)

◆ RxCompleteMdl()

NTSTATUS NTAPI RxCompleteMdl ( _In_ PRX_CONTEXT  RxContext)

◆ RxCompleteRequest()

NTSTATUS RxCompleteRequest ( _In_ PRX_CONTEXT  pContext,
_In_ NTSTATUS  Status 
)

◆ RxCompleteRequest_Real()

VOID RxCompleteRequest_Real ( _In_ PRX_CONTEXT  RxContext,
_In_ PIRP  Irp,
_In_ NTSTATUS  Status 
)

Referenced by RxFsdCommonDispatch().

◆ RxConjureOriginalName()

VOID RxConjureOriginalName ( _Inout_ PFCB  Fcb,
_Inout_ PFOBX  Fobx,
_Out_ PULONG  ActualNameLength,
_Out_writes_bytes_ *LengthRemaining PWCHAR  OriginalName,
_Inout_ PLONG  LengthRemaining,
_In_ RX_NAME_CONJURING_METHODS  NameConjuringMethod 
)

◆ RxConstructNetRoot()

NTSTATUS RxConstructNetRoot ( _In_ PRX_CONTEXT  RxContext,
_In_ PSRV_CALL  SrvCall,
_In_ PNET_ROOT  NetRoot,
_In_ PV_NET_ROOT  VirtualNetRoot,
_Out_ PLOCK_HOLDING_STATE  LockHoldingState 
)

◆ RxConstructSrvCall()

NTSTATUS RxConstructSrvCall ( _In_ PRX_CONTEXT  RxContext,
_In_ PSRV_CALL  SrvCall,
_Out_ PLOCK_HOLDING_STATE  LockHoldingState 
)

◆ RxConstructVirtualNetRoot()

NTSTATUS RxConstructVirtualNetRoot ( _In_ PRX_CONTEXT  RxContext,
_In_ PUNICODE_STRING  CanonicalName,
_In_ NET_ROOT_TYPE  NetRootType,
_Out_ PV_NET_ROOT VirtualNetRootPointer,
_Out_ PLOCK_HOLDING_STATE  LockHoldingState,
_Out_ PRX_CONNECTION_ID  RxConnectionId 
)

◆ RxCreateNetRootCallBack()

VOID NTAPI RxCreateNetRootCallBack ( _In_ PMRX_CREATENETROOT_CONTEXT  CreateNetRootContext)

◆ RxDereference()

VOID RxDereference ( _Inout_ PVOID  Instance,
_In_ LOCK_HOLDING_STATE  LockHoldingState 
)

◆ RxDriverEntry()

NTSTATUS NTAPI RxDriverEntry ( _In_ PDRIVER_OBJECT  DriverObject,
_In_ PUNICODE_STRING  RegistryPath 
)

Referenced by DriverEntry().

◆ RxExtractServerName()

VOID RxExtractServerName ( _In_ PUNICODE_STRING  FilePathName,
_Out_ PUNICODE_STRING  SrvCallName,
_Out_ PUNICODE_STRING  RestOfName 
)

◆ RxFinalizeConnection()

NTSTATUS NTAPI RxFinalizeConnection ( _Inout_ PNET_ROOT  NetRoot,
_Inout_opt_ PV_NET_ROOT  VNetRoot,
_In_ LOGICAL  ForceFilesClosed 
)

Referenced by nfs41_DeleteConnection().

◆ RxFinalizeNetFcb()

BOOLEAN RxFinalizeNetFcb ( _Out_ PFCB  ThisFcb,
_In_ BOOLEAN  RecursiveFinalize,
_In_ BOOLEAN  ForceFinalize,
_In_ LONG  ReferenceCount 
)

◆ RxFindOrConstructVirtualNetRoot()

NTSTATUS RxFindOrConstructVirtualNetRoot ( _In_ PRX_CONTEXT  RxContext,
_In_ PUNICODE_STRING  CanonicalName,
_In_ NET_ROOT_TYPE  NetRootType,
_In_ PUNICODE_STRING  RemainingName 
)

◆ RxFindOrCreateConnections()

NTSTATUS RxFindOrCreateConnections ( _In_ PRX_CONTEXT  RxContext,
_In_ PUNICODE_STRING  CanonicalName,
_In_ NET_ROOT_TYPE  NetRootType,
_Out_ PUNICODE_STRING  LocalNetRootName,
_Out_ PUNICODE_STRING  FilePathName,
_Inout_ PLOCK_HOLDING_STATE  LockState,
_In_ PRX_CONNECTION_ID  RxConnectionId 
)

Definition at line 3675 of file rxce.c.

3683{
3684 PVOID Container;
3685 PSRV_CALL SrvCall;
3686 PNET_ROOT NetRoot;
3687 PV_NET_ROOT VNetRoot;
3689 PRX_PREFIX_TABLE PrefixTable;
3690 UNICODE_STRING RemainingName, NetRootName;
3691
3692 PAGED_CODE();
3693
3694 DPRINT("RxFindOrCreateConnections(%p, %wZ, %x, %p, %p, %p, %p)\n",
3695 RxContext, CanonicalName, NetRootType, LocalNetRootName,
3696 FilePathName, LockState, RxConnectionId);
3697
3698 *FilePathName = *CanonicalName;
3699 LocalNetRootName->Length = 0;
3700 LocalNetRootName->MaximumLength = 0;
3701 LocalNetRootName->Buffer = CanonicalName->Buffer;
3702
3703 /* UNC path, split it */
3704 if (FilePathName->Buffer[1] == ';')
3705 {
3706 BOOLEAN Slash;
3707 USHORT i, Length;
3708
3709 Slash = FALSE;
3710 for (i = 2; i < FilePathName->Length / sizeof(WCHAR); ++i)
3711 {
3712 if (FilePathName->Buffer[i] == OBJ_NAME_PATH_SEPARATOR)
3713 {
3714 Slash = TRUE;
3715 break;
3716 }
3717 }
3718
3719 if (!Slash)
3720 {
3722 }
3723
3724 FilePathName->Buffer = &FilePathName->Buffer[i];
3725 Length = (USHORT)((ULONG_PTR)FilePathName->Buffer - (ULONG_PTR)LocalNetRootName->Buffer);
3726 LocalNetRootName->Length = Length;
3727 LocalNetRootName->MaximumLength = Length;
3728 FilePathName->Length -= Length;
3729
3730 DPRINT("CanonicalName: %wZ\n", CanonicalName);
3731 DPRINT(" -> FilePathName: %wZ\n", FilePathName);
3732 DPRINT(" -> LocalNetRootName: %wZ\n", LocalNetRootName);
3733 }
3734
3735 Container = NULL;
3736 PrefixTable = RxContext->RxDeviceObject->pRxNetNameTable;
3737
3738 _SEH2_TRY
3739 {
3740RetryLookup:
3742
3743 /* If previous lookup left something, dereference it */
3744 if (Container != NULL)
3745 {
3746 switch (NodeType(Container))
3747 {
3748 case RDBSS_NTC_SRVCALL:
3749 RxDereferenceSrvCall(Container, *LockState);
3750 break;
3751
3752 case RDBSS_NTC_NETROOT:
3753 RxDereferenceNetRoot(Container, *LockState);
3754 break;
3755
3757 RxDereferenceVNetRoot(Container, *LockState);
3758 break;
3759
3760 default:
3761 /* Should never happen */
3762 ASSERT(FALSE);
3763 break;
3764 }
3765 }
3766
3767 /* Look for our NetRoot in prefix table */
3768 Container = RxPrefixTableLookupName(PrefixTable, FilePathName, &RemainingName, RxConnectionId);
3769 DPRINT("Container %p for path %wZ\n", Container, FilePathName);
3770
3771 while (TRUE)
3772 {
3773 UNICODE_STRING SrvCallName;
3774
3775 SrvCall = NULL;
3776 NetRoot = NULL;
3777 VNetRoot = NULL;
3778
3779 /* Assume we didn't succeed */
3780 RxContext->Create.pVNetRoot = NULL;
3781 RxContext->Create.pNetRoot = NULL;
3782 RxContext->Create.pSrvCall = NULL;
3783 RxContext->Create.Type = NetRootType;
3784
3785 /* If we found something */
3786 if (Container != NULL)
3787 {
3788 /* A VNetRoot */
3789 if (NodeType(Container) == RDBSS_NTC_V_NETROOT)
3790 {
3791 VNetRoot = Container;
3792 /* Use its NetRoot */
3793 NetRoot = VNetRoot->NetRoot;
3794
3795 /* If it's not stable, wait for it to be stable */
3796 if (NetRoot->Condition == Condition_InTransition)
3797 {
3798 RxReleasePrefixTableLock(PrefixTable);
3799 DPRINT("Waiting for stable condition for: %p\n", NetRoot);
3800 RxWaitForStableNetRoot(NetRoot, RxContext);
3803
3804 /* Now that's it's ok, retry lookup to find what we want */
3805 if (NetRoot->Condition == Condition_Good)
3806 {
3807 goto RetryLookup;
3808 }
3809 }
3810
3811 /* Is the associated netroot good? */
3812 if (NetRoot->Condition == Condition_Good)
3813 {
3814 SrvCall = (PSRV_CALL)NetRoot->pSrvCall;
3815
3816 /* If it is, and SrvCall as well, then, we have our active connection */
3817 if (SrvCall->Condition == Condition_Good &&
3818 SrvCall->RxDeviceObject == RxContext->RxDeviceObject)
3819 {
3820 RxContext->Create.pVNetRoot = (PMRX_V_NET_ROOT)VNetRoot;
3821 RxContext->Create.pNetRoot = (PMRX_NET_ROOT)NetRoot;
3822 RxContext->Create.pSrvCall = (PMRX_SRV_CALL)SrvCall;
3823
3826 }
3827 }
3828
3829 /* If VNetRoot was well constructed, it means the connection is active */
3830 if (VNetRoot->ConstructionStatus == STATUS_SUCCESS)
3831 {
3833 }
3834 else
3835 {
3836 Status = VNetRoot->ConstructionStatus;
3837 }
3838
3839 RxDereferenceVNetRoot(VNetRoot, *LockState);
3841 }
3842 /* Can only be a SrvCall */
3843 else
3844 {
3845 ASSERT(NodeType(Container) == RDBSS_NTC_SRVCALL);
3846 SrvCall = Container;
3847
3848 /* Wait for the SRV_CALL to be stable */
3849 if (SrvCall->Condition == Condition_InTransition)
3850 {
3851 RxReleasePrefixTableLock(PrefixTable);
3852 DPRINT("Waiting for stable condition for: %p\n", SrvCall);
3853 RxWaitForStableSrvCall(SrvCall, RxContext);
3856
3857 /* It went good, loop again to find what we look for */
3858 if (SrvCall->Condition == Condition_Good)
3859 {
3860 goto RetryLookup;
3861 }
3862 }
3863
3864 /* If it's not good... */
3865 if (SrvCall->Condition != Condition_Good)
3866 {
3867 /* But SRV_CALL was well constructed, assume a connection was active */
3868 if (SrvCall->Status == STATUS_SUCCESS)
3869 {
3871 }
3872 else
3873 {
3874 Status = SrvCall->Status;
3875 }
3876
3879 }
3880 }
3881 }
3882
3883 /* If we found a SRV_CALL not matching our DO, quit */
3884 if (SrvCall != NULL && SrvCall->Condition == Condition_Good &&
3885 SrvCall->RxDeviceObject != RxContext->RxDeviceObject)
3886 {
3890 }
3891
3892 /* Now, we want exclusive lock */
3894 {
3895 if (!RxAcquirePrefixTableLockExclusive(PrefixTable, FALSE))
3896 {
3897 RxReleasePrefixTableLock(PrefixTable);
3900 goto RetryLookup;
3901 }
3902
3903 RxReleasePrefixTableLock(PrefixTable);
3905 }
3906
3908
3909 /* If we reach that point, we found something, no need to create something */
3910 if (Container != NULL)
3911 {
3912 break;
3913 }
3914
3915 /* Get the name for the SRV_CALL */
3916 RxExtractServerName(FilePathName, &SrvCallName, NULL);
3917 DPRINT(" -> SrvCallName: %wZ\n", &SrvCallName);
3918 /* And create the SRV_CALL */
3919 SrvCall = RxCreateSrvCall(RxContext, &SrvCallName, NULL, RxConnectionId);
3920 if (SrvCall == NULL)
3921 {
3924 }
3925
3926 /* Reset RX_CONTEXT, so far, connection creation isn't a success */
3927 RxReferenceSrvCall(SrvCall);
3928 RxContext->Create.pVNetRoot = NULL;
3929 RxContext->Create.pNetRoot = NULL;
3930 RxContext->Create.pSrvCall = NULL;
3931 RxContext->Create.Type = NetRootType;
3932 Container = SrvCall;
3933
3934 /* Construct SRV_CALL, ie, use mini-rdr */
3935 Status = RxConstructSrvCall(RxContext, SrvCall, LockState);
3937 if (Status != STATUS_SUCCESS)
3938 {
3939 DPRINT1("RxConstructSrvCall() = Status: %x\n", Status);
3942 RxReleasePrefixTableLock(PrefixTable);
3944 }
3945
3946 /* Loop again to make use of SRV_CALL stable condition wait */
3947 }
3948
3949 /* At that point, we have a stable SRV_CALL (either found or constructed) */
3950 ASSERT((NodeType(SrvCall) == RDBSS_NTC_SRVCALL) && (SrvCall->Condition == Condition_Good));
3951 ASSERT(NetRoot == NULL && VNetRoot == NULL);
3952 ASSERT(SrvCall->RxDeviceObject == RxContext->RxDeviceObject);
3953
3954 /* Call mini-rdr to get NetRoot name */
3955 SrvCall->RxDeviceObject->Dispatch->MRxExtractNetRootName(FilePathName, (PMRX_SRV_CALL)SrvCall, &NetRootName, NULL);
3956 /* And create the NetRoot with that name */
3957 NetRoot = RxCreateNetRoot(SrvCall, &NetRootName, 0, RxConnectionId);
3958 if (NetRoot == NULL)
3959 {
3962 }
3963 NetRoot->Type = NetRootType;
3964
3966
3967 /* Finally, create the associated VNetRoot */
3968 VNetRoot = RxCreateVNetRoot(RxContext, NetRoot, CanonicalName, LocalNetRootName, FilePathName, RxConnectionId);
3969 if (VNetRoot == NULL)
3970 {
3971 RxFinalizeNetRoot(NetRoot, TRUE, TRUE);
3974 }
3975 RxReferenceVNetRoot(VNetRoot);
3976
3977 /* We're get closer! */
3979 RxContext->Create.pSrvCall = (PMRX_SRV_CALL)SrvCall;
3980 RxContext->Create.pNetRoot = (PMRX_NET_ROOT)NetRoot;
3981 RxContext->Create.pVNetRoot = (PMRX_V_NET_ROOT)VNetRoot;
3982
3983 /* Construct the NetRoot, involving the mini-rdr now that we have our three control structs */
3984 Status = RxConstructNetRoot(RxContext, SrvCall, NetRoot, VNetRoot, LockState);
3985 if (!NT_SUCCESS(Status))
3986 {
3988 DPRINT1("RxConstructNetRoot failed Ctxt: %p, VNet: %p, Status: %lx, Condition: %d\n", RxContext, VNetRoot, Status, VNetRoot->Condition);
3989 RxDereferenceVNetRoot(VNetRoot, *LockState);
3990
3991 RxContext->Create.pNetRoot = NULL;
3992 RxContext->Create.pVNetRoot = NULL;
3993 }
3994 else
3995 {
3997
3999
4000 Stack = RxContext->CurrentIrpSp;
4001 if (BooleanFlagOn(Stack->Parameters.Create.Options, FILE_CREATE_TREE_CONNECTION))
4002 {
4005 }
4006 }
4007 }
4009 {
4011 {
4012 if (*LockState != LHS_LockNotHeld)
4013 {
4014 RxReleasePrefixTableLock(PrefixTable);
4016 }
4017 }
4018 }
4019 _SEH2_END;
4020
4021 DPRINT("RxFindOrCreateConnections() = Status: %x\n", Status);
4022 return Status;
4023}
#define OBJ_NAME_PATH_SEPARATOR
Definition: arcname_tests.c:25
#define DPRINT1
Definition: precomp.h:8
_Inout_ PFCB _Inout_ PUNICODE_STRING RemainingName
Definition: cdprocs.h:802
#define NodeType(P)
Definition: nodetype.h:51
#define ULONG_PTR
Definition: config.h:101
#define RxDereferenceNetRoot(NetRoot, LockHoldingState)
Definition: fcb.h:403
struct _SRV_CALL * PSRV_CALL
#define RxTransitionVNetRoot(V, C)
Definition: fcb.h:515
#define RxWaitForStableSrvCall(S, R)
Definition: fcb.h:450
#define RxReferenceVNetRoot(VNetRoot)
Definition: fcb.h:407
#define RxWaitForStableNetRoot(N, R)
Definition: fcb.h:473
#define RxReferenceSrvCall(SrvCall)
Definition: fcb.h:391
#define RxDereferenceVNetRoot(VNetRoot, LockHoldingState)
Definition: fcb.h:411
#define RxDereferenceSrvCall(SrvCall, LockHoldingState)
Definition: fcb.h:395
#define _SEH2_LEAVE
Definition: filesup.c:20
IN OUT PLONG IN OUT PLONG Addend IN OUT PLONG IN LONG IN OUT PLONG IN LONG Increment IN PNDIS_RW_LOCK Lock IN PNDIS_RW_LOCK IN PLOCK_STATE LockState
Definition: CrNtStubs.h:104
#define FILE_CREATE_TREE_CONNECTION
Definition: from_kernel.h:33
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
if(dx< 0)
Definition: linetemp.h:194
@ Condition_InTransition
Definition: mrx.h:74
@ Condition_Good
Definition: mrx.h:76
@ Condition_Bad
Definition: mrx.h:77
struct _MRX_NET_ROOT_ * PMRX_NET_ROOT
struct _MRX_V_NET_ROOT_ * PMRX_V_NET_ROOT
struct _MRX_SRV_CALL_ * PMRX_SRV_CALL
_In_ ULONG _In_ ULONG _In_ ULONG Length
Definition: ntddpcm.h:102
#define STATUS_BAD_NETWORK_NAME
Definition: ntstatus.h:440
#define STATUS_CONNECTION_ACTIVE
Definition: ntstatus.h:703
unsigned short USHORT
Definition: pedump.c:61
#define RxIsPrefixTableLockAcquired(T)
Definition: prefix.h:113
#define RxAcquirePrefixTableLockExclusive(T, W)
Definition: prefix.h:83
#define RxReleasePrefixTableLock(T)
Definition: prefix.h:84
VOID RxExclusivePrefixTableLockToShared(PRX_PREFIX_TABLE Table)
Definition: rxce.c:2440
PV_NET_ROOT RxCreateVNetRoot(IN PRX_CONTEXT RxContext, IN PNET_ROOT NetRoot, IN PUNICODE_STRING CanonicalName, IN PUNICODE_STRING LocalNetRootName, IN PUNICODE_STRING FilePath, IN PRX_CONNECTION_ID RxConnectionId)
Definition: rxce.c:2052
VOID RxExtractServerName(IN PUNICODE_STRING FilePathName, OUT PUNICODE_STRING SrvCallName, OUT PUNICODE_STRING RestOfName)
Definition: rxce.c:2452
PNET_ROOT RxCreateNetRoot(IN PSRV_CALL SrvCall, IN PUNICODE_STRING Name, IN ULONG NetRootFlags, IN PRX_CONNECTION_ID OPTIONAL RxConnectionId)
Definition: rxce.c:1705
BOOLEAN RxFinalizeNetRoot(OUT PNET_ROOT ThisNetRoot, IN BOOLEAN RecursiveFinalize, IN BOOLEAN ForceFinalize)
Definition: rxce.c:3062
PVOID RxPrefixTableLookupName(IN PRX_PREFIX_TABLE ThisTable, IN PUNICODE_STRING CanonicalName, OUT PUNICODE_STRING RemainingName, IN PRX_CONNECTION_ID ConnectionId)
Definition: rxce.c:6487
PSRV_CALL RxCreateSrvCall(IN PRX_CONTEXT RxContext, IN PUNICODE_STRING Name, IN PUNICODE_STRING InnerNamePrefix OPTIONAL, IN PRX_CONNECTION_ID RxConnectionId)
Definition: rxce.c:1843
NTSTATUS RxConstructNetRoot(IN PRX_CONTEXT RxContext, IN PSRV_CALL SrvCall, IN PNET_ROOT NetRoot, IN PV_NET_ROOT VirtualNetRoot, OUT PLOCK_HOLDING_STATE LockHoldingState)
Definition: rxce.c:1163
NTSTATUS RxConstructSrvCall(IN PRX_CONTEXT RxContext, IN PSRV_CALL SrvCall, OUT PLOCK_HOLDING_STATE LockHoldingState)
Definition: rxce.c:1262
@ LHS_LockNotHeld
Definition: rxstruc.h:20
@ LHS_SharedLockHeld
Definition: rxstruc.h:21
@ LHS_ExclusiveLockHeld
Definition: rxstruc.h:22
#define RDBSS_NTC_NETROOT
Definition: nodetype.h:49
#define RDBSS_NTC_SRVCALL
Definition: nodetype.h:48
#define RDBSS_NTC_V_NETROOT
Definition: nodetype.h:50
Definition: fcb.h:34
RX_BLOCK_CONDITION Condition
Definition: fcb.h:45
Definition: fcb.h:10
RX_BLOCK_CONDITION Condition
Definition: fcb.h:21
PNET_ROOT NetRoot
Definition: fcb.h:65
RX_BLOCK_CONDITION Condition
Definition: fcb.h:70
uint32_t ULONG_PTR
Definition: typedefs.h:65
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
#define STATUS_OBJECT_NAME_INVALID
Definition: udferr_usr.h:148
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
_In_ WDFREQUEST _In_ PIO_STACK_LOCATION Stack
Definition: wdfrequest.h:639
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by RxConstructVirtualNetRoot().

◆ RxFreeFcbObject()

VOID RxFreeFcbObject ( _In_ PVOID  Object)

◆ RxFreeObject()

VOID RxFreeObject ( _In_ PVOID  pObject)

◆ RxFsdPostRequest()

NTSTATUS RxFsdPostRequest ( _In_ PRX_CONTEXT  RxContext)

◆ RxGatherRequestsForSrvOpen()

VOID RxGatherRequestsForSrvOpen ( _Inout_ PSRV_CALL  SrvCall,
_In_ PSRV_OPEN  SrvOpen,
_Inout_ PLIST_ENTRY  RequestsListHead 
)

◆ RxGetNetworkProviderPriority()

ULONG RxGetNetworkProviderPriority ( _In_ PUNICODE_STRING  DeviceName)

◆ RxGetSessionId()

ULONG RxGetSessionId ( _In_ PIO_STACK_LOCATION  IrpSp)

◆ RxGetUid()

LUID RxGetUid ( _In_ PSECURITY_SUBJECT_CONTEXT  SubjectSecurityContext)

◆ RxIndicateChangeOfBufferingStateForSrvOpen()

VOID NTAPI RxIndicateChangeOfBufferingStateForSrvOpen ( PMRX_SRV_CALL  SrvCall,
PMRX_SRV_OPEN  SrvOpen,
PVOID  SrvOpenKey,
PVOID  Context 
)

Definition at line 6880 of file rdbss.c.

6885{
6887}

Referenced by fcbopen_main(), and nfs41_invalidate_cache().

◆ RxInitializeMinirdrDispatchTable()

VOID RxInitializeMinirdrDispatchTable ( _In_ PDRIVER_OBJECT  DriverObject)

◆ RxInitializeSrvCallParameters()

NTSTATUS RxInitializeSrvCallParameters ( _In_ PRX_CONTEXT  RxContext,
_Inout_ PSRV_CALL  SrvCall 
)

◆ RxInitializeWorkQueue()

VOID RxInitializeWorkQueue ( _In_ PRX_WORK_QUEUE  WorkQueue,
_In_ WORK_QUEUE_TYPE  WorkQueueType,
_In_ ULONG  MaximumNumberOfWorkerThreads,
_In_ ULONG  MinimumNumberOfWorkerThreads 
)

◆ RxInitializeWorkQueueDispatcher()

NTSTATUS RxInitializeWorkQueueDispatcher ( _In_ PRX_WORK_QUEUE_DISPATCHER  Dispatcher)

◆ RxIsThisACscAgentOpen()

BOOLEAN RxIsThisACscAgentOpen ( _In_ PRX_CONTEXT  RxContext)

◆ RxLockOperationCompletion()

NTSTATUS NTAPI RxLockOperationCompletion ( _In_ PVOID  Context,
_In_ PIRP  Irp 
)

◆ RxLockUserBuffer()

VOID RxLockUserBuffer ( _In_ PRX_CONTEXT  RxContext,
_In_ LOCK_OPERATION  Operation,
_In_ ULONG  BufferLength 
)

◆ RxLogEventDirect()

VOID NTAPI RxLogEventDirect ( _In_ PRDBSS_DEVICE_OBJECT  DeviceObject,
_In_ PUNICODE_STRING  OriginatorId,
_In_ ULONG  EventId,
_In_ NTSTATUS  Status,
_In_ ULONG  Line 
)

◆ RxLogEventWithAnnotation()

VOID NTAPI RxLogEventWithAnnotation ( _In_ PRDBSS_DEVICE_OBJECT  DeviceObject,
_In_ ULONG  EventId,
_In_ NTSTATUS  Status,
_In_ PVOID  DataBuffer,
_In_ USHORT  DataBufferLength,
_In_ PUNICODE_STRING  Annotation,
_In_ ULONG  AnnotationCount 
)

◆ RxLowIoCompletionTail()

NTSTATUS RxLowIoCompletionTail ( _In_ PRX_CONTEXT  RxContext)

◆ RxLowIoLockControlShell()

NTSTATUS RxLowIoLockControlShell ( _In_ PRX_CONTEXT  RxContext)

◆ RxMapSystemBuffer()

PVOID RxMapSystemBuffer ( _In_ PRX_CONTEXT  RxContext)

◆ RxNoOpAcquire()

BOOLEAN NTAPI RxNoOpAcquire ( _In_ PVOID  Fcb,
_In_ BOOLEAN  Wait 
)

◆ RxNoOpRelease()

VOID NTAPI RxNoOpRelease ( _In_ PVOID  Fcb)

◆ RxOrphanSrvOpens()

VOID RxOrphanSrvOpens ( _In_ PV_NET_ROOT  ThisVNetRoot)

◆ RxOrphanSrvOpensForThisFcb()

VOID RxOrphanSrvOpensForThisFcb ( _In_ PFCB  Fcb,
_In_ PV_NET_ROOT  ThisVNetRoot,
_In_ BOOLEAN  OrphanAll 
)

◆ RxOrphanThisFcb()

VOID RxOrphanThisFcb ( _In_ PFCB  Fcb)

Referenced by RxCommonClose(), and RxFindOrCreateFcb().

◆ RxpDiscardChangeBufferingStateRequests()

VOID RxpDiscardChangeBufferingStateRequests ( _Inout_ PLIST_ENTRY  DiscardedRequests)

Definition at line 6065 of file rxce.c.

6067{
6069
6070 PAGED_CODE();
6071
6072 /* No requests to discard */
6073 if (IsListEmpty(DiscardedRequests))
6074 {
6075 return;
6076 }
6077
6078 /* Free all the discarded requests */
6079 Entry = DiscardedRequests->Flink;
6080 while (Entry != DiscardedRequests)
6081 {
6083
6085 Entry = Entry->Flink;
6086
6087 DPRINT("Req %p for %p (%p) discarded\n", Request, Request->SrvOpenKey, Request->SrvOpen);
6088
6091 }
6092}
#define RxFreePool
Definition: ntrxdef.h:26
VOID RxPrepareRequestForReuse(PCHANGE_BUFFERING_STATE_REQUEST Request)
Definition: rxce.c:6607
base of all file and directory entries
Definition: entries.h:83
Definition: typedefs.h:120
_In_ WDFREQUEST Request
Definition: wdfdevice.h:547

Referenced by RxCompleteSrvOpenKeyAssociation(), RxGatherRequestsForSrvOpen(), and RxPurgeChangeBufferingStateRequestsForSrvOpen().

◆ RxpLookupSrvOpenForRequestLite()

NTSTATUS RxpLookupSrvOpenForRequestLite ( _In_ PSRV_CALL  SrvCall,
_Inout_ PCHANGE_BUFFERING_STATE_REQUEST  Request 
)

◆ RxPostStackOverflowRead()

NTSTATUS RxPostStackOverflowRead ( _In_ PRX_CONTEXT  RxContext)

◆ RxpPrepareCreateContextForReuse()

VOID RxpPrepareCreateContextForReuse ( _In_ PRX_CONTEXT  RxContext)

◆ RxPrefixClaim()

NTSTATUS RxPrefixClaim ( _In_ PRX_CONTEXT  RxContext)

◆ RxPrepareRequestForReuse()

VOID RxPrepareRequestForReuse ( PCHANGE_BUFFERING_STATE_REQUEST  Request)

Definition at line 6607 of file rxce.c.

6609{
6610 PSRV_OPEN SrvOpen;
6611
6612 PAGED_CODE();
6613
6614 SrvOpen = Request->SrvOpen;
6615
6616 /* If the request was already prepared for service */
6618 {
6619 /* We have to dereference the associated SRV_OPEN depending on the lock */
6620 if (RxIsFcbAcquiredExclusive(SrvOpen->pFcb))
6621 {
6623 }
6624 else
6625 {
6627 }
6628 }
6629 /* Otherwise, just dereference */
6630 else if (SrvOpen != NULL)
6631 {
6633 }
6634
6635 Request->SrvOpen = NULL;
6636}
#define RX_REQUEST_PREPARED_FOR_HANDLING
Definition: buffring.h:4
#define RxDereferenceSrvOpen(SrvOpen, LockHoldingState)
Definition: fcb.h:427
Definition: fcb.h:261

Referenced by RxpDiscardChangeBufferingStateRequests().

◆ RxPrepareToReparseSymbolicLink()

NTSTATUS NTAPI RxPrepareToReparseSymbolicLink ( PRX_CONTEXT  RxContext,
BOOLEAN  SymbolicLinkEmbeddedInOldPath,
PUNICODE_STRING  NewPath,
BOOLEAN  NewPathIsAbsolute,
PBOOLEAN  ReparseRequired 
)

Definition at line 7825 of file rdbss.c.

7831{
7832 PWSTR NewBuffer;
7835
7836 /* Assume no reparse is required first */
7837 *ReparseRequired = FALSE;
7838
7839 /* Only supported for IRP_MJ_CREATE */
7840 if (RxContext->MajorFunction != IRP_MJ_CREATE)
7841 {
7843 }
7844
7845 /* If symbolic link is not embedded, and DELETE is specified, fail */
7846 if (!SymbolicLinkEmbeddedInOldPath)
7847 {
7848 /* Excepted if DELETE is the only flag specified, then, open has to succeed
7849 * See: https://msdn.microsoft.com/en-us/library/windows/hardware/ff554649(v=vs.85).aspx (remarks)
7850 */
7851 if (BooleanFlagOn(RxContext->Create.NtCreateParameters.DesiredAccess, DELETE) &&
7852 BooleanFlagOn(RxContext->Create.NtCreateParameters.DesiredAccess, ~DELETE))
7853 {
7854 return STATUS_ACCESS_DENIED;
7855 }
7856 }
7857
7858 /* At that point, assume reparse will be required */
7859 *ReparseRequired = TRUE;
7860
7861 /* If new path isn't absolute, it's up to us to make it absolute */
7862 if (!NewPathIsAbsolute)
7863 {
7864 /* The prefix will be \Device\Mup */
7865 NewLength = NewPath->Length + (sizeof(L"\\Device\\Mup") - sizeof(UNICODE_NULL));
7868 if (NewBuffer == NULL)
7869 {
7871 }
7872
7873 /* Copy data for the new path */
7874 RtlMoveMemory(NewBuffer, L"\\Device\\Mup", (sizeof(L"\\Device\\Mup") - sizeof(UNICODE_NULL)));
7875 RtlMoveMemory(Add2Ptr(NewBuffer, (sizeof(L"\\Device\\Mup") - sizeof(UNICODE_NULL))),
7876 NewPath->Buffer, NewPath->Length);
7877 }
7878 /* Otherwise, use caller path as it */
7879 else
7880 {
7881 NewLength = NewPath->Length;
7882 NewBuffer = NewPath->Buffer;
7883 }
7884
7885 /* Get the FILE_OBJECT we'll modify */
7886 FileObject = RxContext->CurrentIrpSp->FileObject;
7887
7888 /* Free old path first */
7889 ExFreePoolWithTag(FileObject->FileName.Buffer, 0);
7890 /* And setup new one */
7891 FileObject->FileName.Length = NewLength;
7892 FileObject->FileName.MaximumLength = NewLength;
7893 FileObject->FileName.Buffer = NewBuffer;
7894
7895 /* And set reparse flag */
7897
7898 /* Done! */
7899 return STATUS_SUCCESS;
7900}
static USHORT USHORT * NewLength
#define ExAllocatePoolWithTag(hernya, size, tag)
Definition: env_spec_w32.h:350
#define PagedPool
Definition: env_spec_w32.h:308
#define Add2Ptr(PTR, INC)
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1109
#define DELETE
Definition: nt_native.h:57
#define UNICODE_NULL
#define L(x)
Definition: ntvdm.h:50
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
@ RX_CONTEXT_CREATE_FLAG_REPARSE
Definition: rxcontx.h:327
#define RX_MISC_POOLTAG
Definition: rxpooltg.h:10
PFILE_OBJECT FileObject
Definition: iotypes.h:3169
UCHAR MajorFunction
Definition: rxcontx.h:105
PIO_STACK_LOCATION CurrentIrpSp
Definition: rxcontx.h:111
struct _RX_CONTEXT::@2155::@2167 Create
uint16_t * PWSTR
Definition: typedefs.h:56
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:264
#define STATUS_ACCESS_DENIED
Definition: udferr_usr.h:145
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
_In_ WDFREQUEST _In_ WDFFILEOBJECT FileObject
Definition: wdfdevice.h:550
#define POOL_COLD_ALLOCATION
* PFILE_OBJECT
Definition: iotypes.h:1998

◆ RxPrePostIrp()

VOID RxPrePostIrp ( _In_ PVOID  Context,
_In_ PIRP  Irp 
)

Referenced by RxConstructSrvCall().

◆ RxProcessChangeBufferingStateRequestsForSrvOpen()

VOID RxProcessChangeBufferingStateRequestsForSrvOpen ( PSRV_OPEN  SrvOpen)

Definition at line 6655 of file rxce.c.

6657{
6658 LONG NumberOfBufferingChangeRequests, LockedOldBufferingToken, OldBufferingToken;
6659
6660 /* Get the current number of change requests */
6661 NumberOfBufferingChangeRequests = ((PSRV_CALL)SrvOpen->pVNetRoot->pNetRoot->pSrvCall)->BufferingManager.CumulativeNumberOfBufferingChangeRequests;
6662 /* Get our old token */
6663 OldBufferingToken = SrvOpen->BufferingToken;
6664 LockedOldBufferingToken = InterlockedCompareExchange(&SrvOpen->BufferingToken,
6665 NumberOfBufferingChangeRequests,
6666 NumberOfBufferingChangeRequests);
6667 /* If buffering state changed in between, process changes */
6668 if (OldBufferingToken != LockedOldBufferingToken)
6669 {
6670 PFCB Fcb;
6672
6673 /* Acquire the FCB and start processing */
6674 Fcb = (PFCB)SrvOpen->pFcb;
6676 if (Status == STATUS_SUCCESS)
6677 {
6680 }
6681 }
6682}
#define InterlockedCompareExchange
Definition: interlocked.h:104
long LONG
Definition: pedump.c:60
#define RxAcquireExclusiveFcb(R, F)
Definition: rxprocs.h:154
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
volatile LONG BufferingToken
Definition: fcb.h:276

Referenced by RxFastIoCheckIfPossible().

◆ RxPurgeFcb()

VOID RxPurgeFcb ( _In_ PFCB  Fcb)

◆ RxPurgeFobx()

BOOLEAN RxPurgeFobx ( PFOBX  pFobx)

Definition at line 7051 of file rxce.c.

7053{
7055 PFCB FcbToBePurged;
7056
7057 PAGED_CODE();
7058
7059 /* Get the associated FCB */
7060 FcbToBePurged = (PFCB)pFobx->pSrvOpen->pFcb;
7061 Status = RxAcquireExclusiveFcb(NULL, FcbToBePurged);
7063
7064 /* Purge it */
7065 Status = RxPurgeFcbInSystemCache(FcbToBePurged, NULL, 0, FALSE, TRUE);
7066 if (Status != STATUS_SUCCESS)
7067 {
7068 DPRINT1("Purge failed for %p (%p)\n", FcbToBePurged, pFobx);
7069 return FALSE;
7070 }
7071
7072 /* And flush */
7073 if (!MmFlushImageSection(&FcbToBePurged->NonPaged->SectionObjectPointers, MmFlushForWrite))
7074 {
7075 DPRINT1("Image section flush failed for %p (%p)\n", FcbToBePurged, pFobx);
7076 return FALSE;
7077 }
7078
7079 DPRINT("Purge OK for %p (%p)\n", FcbToBePurged, pFobx);
7080 return TRUE;
7081}
NTSTATUS RxPurgeFcbInSystemCache(IN PFCB Fcb, IN PLARGE_INTEGER FileOffset OPTIONAL, IN ULONG Length, IN BOOLEAN UninitializeCacheMaps, IN BOOLEAN FlushFile)
Definition: rxce.c:6998
BOOLEAN NTAPI MmFlushImageSection(IN PSECTION_OBJECT_POINTERS SectionObjectPointer, IN MMFLUSH_TYPE FlushType)
Definition: section.c:4361

Referenced by RxPurgeRelatedFobxs().

◆ RxPurgeFobxFromCache()

NTSTATUS RxPurgeFobxFromCache ( PFOBX  FobxToBePurged)

Definition at line 7087 of file rxce.c.

7089{
7091 PFCB FcbToBePurged;
7092
7093 PAGED_CODE();
7094
7095 FcbToBePurged = (PFCB)FobxToBePurged->pSrvOpen->pFcb;
7096 ASSERT(FcbToBePurged != NULL);
7097
7098 /* If we cannot have our FCB exclusively, give up */
7099 Status = RxAcquireExclusiveFcb(NULL, FcbToBePurged);
7100 if (Status != STATUS_SUCCESS)
7101 {
7102 RxDereferenceNetFobx(FobxToBePurged, LHS_LockNotHeld);
7103 return Status;
7104 }
7105
7106 /* Don't let the FCB disappear */
7107 RxReferenceNetFcb(FcbToBePurged);
7108
7109 /* If the SRV_OPEN was already closed, or if there are unclean FOBX, give up */
7110 if (BooleanFlagOn(FobxToBePurged->Flags, FOBX_FLAG_SRVOPEN_CLOSED) || FobxToBePurged->pSrvOpen->UncleanFobxCount != 0)
7111 {
7112 DPRINT("FCB purge skipped\n");
7113 }
7114 else
7115 {
7116 Status = RxPurgeFcbInSystemCache(FcbToBePurged, NULL, 0, FALSE, TRUE);
7117 }
7118
7120 /* Drop our extra reference */
7121 if (!RxDereferenceAndFinalizeNetFcb(FcbToBePurged, NULL, FALSE, FALSE))
7122 {
7123 RxReleaseFcb(NULL, FcbToBePurged);
7124 }
7125
7126 return Status;
7127}
#define RxReferenceNetFcb(Fcb)
Definition: fcb.h:431
#define RxDereferenceAndFinalizeNetFcb(Fcb, RxContext, RecursiveFinalize, ForceFinalize)
Definition: fcb.h:439
#define FOBX_FLAG_SRVOPEN_CLOSED
Definition: fcb.h:296
#define RxDereferenceNetFobx(Fobx, LockHoldingState)
Definition: fcb.h:419

Referenced by RxMarkFobxOnCleanup().

◆ RxpWorkerThreadDispatcher()

VOID RxpWorkerThreadDispatcher ( _In_ PRX_WORK_QUEUE  WorkQueue,
_In_ PLARGE_INTEGER  WaitInterval 
)

◆ RxReference()

VOID RxReference ( _Inout_ PVOID  Instance)

◆ RxReleaseFcbFromLazyWrite()

VOID NTAPI RxReleaseFcbFromLazyWrite ( _In_ PVOID  Null)

◆ RxReleaseFcbFromReadAhead()

VOID NTAPI RxReleaseFcbFromReadAhead ( _In_ PVOID  Null)

◆ RxRemoveShareAccessPerSrvOpens()

VOID RxRemoveShareAccessPerSrvOpens ( _Inout_ PSRV_OPEN  SrvOpen)

◆ RxRemoveVirtualNetRootFromNetRoot()

VOID RxRemoveVirtualNetRootFromNetRoot ( _In_ PNET_ROOT  NetRoot,
_In_ PV_NET_ROOT  VNetRoot 
)

◆ RxSpinUpRequestsDispatcher()

VOID NTAPI RxSpinUpRequestsDispatcher ( _In_ PVOID  Dispatcher)

◆ RxSpinUpWorkerThread()

NTSTATUS RxSpinUpWorkerThread ( _In_ PRX_WORK_QUEUE  WorkQueue,
_In_ PRX_WORKERTHREAD_ROUTINE  Routine,
_In_ PVOID  Parameter 
)

◆ RxSpinUpWorkerThreads()

VOID RxSpinUpWorkerThreads ( _In_ PRX_WORK_QUEUE  WorkQueue)

◆ RxTableComputePathHashValue()

ULONG RxTableComputePathHashValue ( _In_ PUNICODE_STRING  Name)

◆ RxTableLookupName()

PVOID RxTableLookupName ( _In_ PRX_PREFIX_TABLE  ThisTable,
_In_ PUNICODE_STRING  Name,
_Out_ PUNICODE_STRING  RemainingName,
_In_opt_ PRX_CONNECTION_ID  RxConnectionId 
)

◆ RxTableLookupName_ExactLengthMatch()

PRX_PREFIX_ENTRY RxTableLookupName_ExactLengthMatch ( _In_ PRX_PREFIX_TABLE  ThisTable,
_In_ PUNICODE_STRING  Name,
_In_ ULONG  HashValue,
_In_opt_ PRX_CONNECTION_ID  RxConnectionId 
)

◆ RxTrackPagingIoResource()

VOID RxTrackPagingIoResource ( _Inout_ PVOID  Instance,
_In_ ULONG  Type,
_In_ ULONG  Line,
_In_ PCSTR  File 
)

Definition at line 8654 of file rxce.c.

8659{
8661}

◆ RxUndoScavengerFinalizationMarking()

VOID RxUndoScavengerFinalizationMarking ( PVOID  Instance)

Definition at line 8667 of file rxce.c.

8669{
8670 /* Just call internal routine with mutex held */
8674}
VOID RxpUndoScavengerFinalizationMarking(PVOID Instance)
Definition: rxce.c:6862
#define RxReleaseScavengerMutex()
Definition: scavengr.h:27
#define RxAcquireScavengerMutex()
Definition: scavengr.h:26
_Must_inspect_result_ _In_ WDFDEVICE _In_ PWDF_WMI_INSTANCE_CONFIG _In_opt_ PWDF_OBJECT_ATTRIBUTES _Out_opt_ WDFWMIINSTANCE * Instance
Definition: wdfwmi.h:481

Referenced by RxProcessChangeBufferingStateRequests().

◆ RxUnload()

VOID NTAPI RxUnload ( _In_ PDRIVER_OBJECT  DriverObject)

Referenced by nfs41_driver_unload().

◆ RxUnlockOperation()

VOID NTAPI RxUnlockOperation ( _In_ PVOID  Context,
_In_ PFILE_LOCK_INFO  LockInfo 
)

◆ RxUpdateCondition()

VOID RxUpdateCondition ( _In_ RX_BLOCK_CONDITION  NewConditionValue,
_Out_ PRX_BLOCK_CONDITION  Condition,
_In_ OUT PLIST_ENTRY  TransitionWaitList 
)

◆ RxUpdateShareAccessPerSrvOpens()

VOID RxUpdateShareAccessPerSrvOpens ( _In_ PSRV_OPEN  SrvOpen)

◆ RxVerifyOperationIsLegal()

VOID RxVerifyOperationIsLegal ( _In_ PRX_CONTEXT  RxContext)

◆ RxWaitForStableCondition()

VOID RxWaitForStableCondition ( _In_ PRX_BLOCK_CONDITION  Condition,
_Inout_ PLIST_ENTRY  TransitionWaitList,
_Inout_ PRX_CONTEXT  RxContext,
_Out_opt_ NTSTATUS AsyncStatus 
)

Variable Documentation

◆ RxNull

PVOID RxNull
extern

Definition at line 118 of file rxce.c.

Referenced by RxFsdCommonDispatch().