ReactOS  0.4.14-dev-317-g96040ec
rdbss.c File Reference
#include <rx.h>
#include <pseh/pseh2.h>
#include <limits.h>
#include <dfs.h>
#include <copysup.h>
#include <debug.h>
Include dependency graph for rdbss.c:

Go to the source code of this file.

Classes

struct  _RX_FSD_DISPATCH_VECTOR
 

Macros

#define NDEBUG
 
#define RX_TOPLEVELCTX_FLAG_FROM_POOL   1
 
#define ALLSCR_LENGTH   (sizeof(L"all.scr") - sizeof(UNICODE_NULL))
 
#define BugCheckFileId   RDBSS_BUG_CHECK_CLEANUP
 
#define BugCheckFileId   RDBSS_BUG_CHECK_CLOSE
 
#define SET_SIZE_AND_QUERY(AlreadyConsummed, Function)
 
#define _SEH2_TRY_RETURN(S)   S; goto try_exit
 
#define _SEH2_TRY_RETURN(S)   S; goto try_exit
 
#define BugCheckFileId   RDBSS_BUG_CHECK_CACHESUP
 
#define FILE_ATTRIBUTE_VOLUME   0x8
 
#define VALID_FILE_ATTRIBUTES
 
#define VALID_DIR_ATTRIBUTES   (VALID_FILE_ATTRIBUTES | FILE_ATTRIBUTE_DIRECTORY)
 

Typedefs

typedef NTSTATUS(NTAPIPRX_FSD_DISPATCH) (PRX_CONTEXT Context)
 
typedef struct _RX_FSD_DISPATCH_VECTOR RX_FSD_DISPATCH_VECTOR
 
typedef struct _RX_FSD_DISPATCH_VECTORPRX_FSD_DISPATCH_VECTOR
 

Functions

VOID NTAPI RxAcquireFileForNtCreateSection (PFILE_OBJECT FileObject)
 
NTSTATUS NTAPI RxAcquireForCcFlush (PFILE_OBJECT FileObject, PDEVICE_OBJECT DeviceObject)
 
VOID RxAddToTopLevelIrpAllocatedContextsList (PRX_TOPLEVELIRP_CONTEXT TopLevelContext)
 
VOID RxAssert (PVOID Assert, PVOID File, ULONG Line, PVOID Message)
 
NTSTATUS NTAPI RxCommonCleanup (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonClose (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonCreate (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDevFCBCleanup (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDevFCBClose (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDevFCBFsCtl (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDevFCBIoCtl (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDevFCBQueryVolInfo (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDeviceControl (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDirectoryControl (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonDispatchProblem (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonFileSystemControl (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonFlushBuffers (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonLockControl (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonQueryEa (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonQueryInformation (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonQueryQuotaInformation (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonQuerySecurity (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonQueryVolumeInformation (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonRead (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonSetEa (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonSetInformation (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonSetQuotaInformation (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonSetSecurity (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonSetVolumeInformation (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonUnimplemented (PRX_CONTEXT Context)
 
NTSTATUS NTAPI RxCommonWrite (PRX_CONTEXT Context)
 
VOID RxCopyCreateParameters (IN PRX_CONTEXT RxContext)
 
NTSTATUS RxCreateFromNetRoot (PRX_CONTEXT Context, PUNICODE_STRING NetRootName)
 
NTSTATUS RxCreateTreeConnect (IN PRX_CONTEXT RxContext)
 
BOOLEAN NTAPI RxFastIoCheckIfPossible (PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, ULONG Length, BOOLEAN Wait, ULONG LockKey, BOOLEAN CheckForReadOperation, PIO_STATUS_BLOCK IoStatus, PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI RxFastIoDeviceControl (PFILE_OBJECT FileObject, BOOLEAN Wait, PVOID InputBuffer OPTIONAL, ULONG InputBufferLength, PVOID OutputBuffer OPTIONAL, ULONG OutputBufferLength, ULONG IoControlCode, PIO_STATUS_BLOCK IoStatus, PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI RxFastIoRead (PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, ULONG Length, BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, PDEVICE_OBJECT DeviceObject)
 
BOOLEAN NTAPI RxFastIoWrite (PFILE_OBJECT FileObject, PLARGE_INTEGER FileOffset, ULONG Length, BOOLEAN Wait, ULONG LockKey, PVOID Buffer, PIO_STATUS_BLOCK IoStatus, PDEVICE_OBJECT DeviceObject)
 
NTSTATUS RxFindOrCreateFcb (PRX_CONTEXT RxContext, PUNICODE_STRING NetRootName)
 
NTSTATUS RxFirstCanonicalize (PRX_CONTEXT RxContext, PUNICODE_STRING FileName, PUNICODE_STRING CanonicalName, PNET_ROOT_TYPE NetRootType)
 
VOID RxFreeCanonicalNameBuffer (PRX_CONTEXT Context)
 
VOID NTAPI RxFspDispatch (IN PVOID Context)
 
VOID NTAPI RxGetRegistryParameters (IN PUNICODE_STRING RegistryPath)
 
NTSTATUS NTAPI RxGetStringRegistryParameter (IN HANDLE KeyHandle, IN PCWSTR KeyName, OUT PUNICODE_STRING OutString, IN PUCHAR Buffer, IN ULONG BufferLength, IN BOOLEAN LogFailure)
 
VOID NTAPI RxInitializeDebugSupport (VOID)
 
VOID NTAPI RxInitializeDispatchVectors (PDRIVER_OBJECT DriverObject)
 
NTSTATUS NTAPI RxInitializeRegistrationStructures (VOID)
 
VOID NTAPI RxInitializeTopLevelIrpPackage (VOID)
 
VOID NTAPI RxInitUnwind (PDRIVER_OBJECT DriverObject, USHORT State)
 
BOOLEAN RxIsThisAnRdbssTopLevelContext (PRX_TOPLEVELIRP_CONTEXT TopLevelContext)
 
NTSTATUS NTAPI RxLowIoIoCtlShellCompletion (PRX_CONTEXT RxContext)
 
NTSTATUS RxLowIoReadShell (PRX_CONTEXT RxContext)
 
NTSTATUS NTAPI RxLowIoReadShellCompletion (PRX_CONTEXT RxContext)
 
NTSTATUS RxLowIoWriteShell (IN PRX_CONTEXT RxContext)
 
NTSTATUS NTAPI RxLowIoWriteShellCompletion (PRX_CONTEXT RxContext)
 
PVOID RxNewMapUserBuffer (PRX_CONTEXT RxContext)
 
NTSTATUS RxNotifyChangeDirectory (PRX_CONTEXT RxContext)
 
VOID NTAPI RxpCancelRoutine (PVOID Context)
 
NTSTATUS RxpQueryInfoMiniRdr (PRX_CONTEXT RxContext, FILE_INFORMATION_CLASS FileInfoClass, PVOID Buffer)
 
VOID RxPurgeNetFcb (PFCB Fcb, PRX_CONTEXT LocalContext)
 
NTSTATUS RxQueryAlternateNameInfo (PRX_CONTEXT RxContext, PFILE_NAME_INFORMATION AltNameInfo)
 
NTSTATUS RxQueryBasicInfo (PRX_CONTEXT RxContext, PFILE_BASIC_INFORMATION BasicInfo)
 
NTSTATUS RxQueryCompressedInfo (PRX_CONTEXT RxContext, PFILE_COMPRESSION_INFORMATION CompressionInfo)
 
NTSTATUS RxQueryDirectory (PRX_CONTEXT RxContext)
 
NTSTATUS RxQueryEaInfo (PRX_CONTEXT RxContext, PFILE_EA_INFORMATION EaInfo)
 
NTSTATUS RxQueryInternalInfo (PRX_CONTEXT RxContext, PFILE_INTERNAL_INFORMATION InternalInfo)
 
NTSTATUS RxQueryNameInfo (PRX_CONTEXT RxContext, PFILE_NAME_INFORMATION NameInfo)
 
NTSTATUS RxQueryPipeInfo (PRX_CONTEXT RxContext, PFILE_PIPE_INFORMATION PipeInfo)
 
NTSTATUS RxQueryPositionInfo (PRX_CONTEXT RxContext, PFILE_POSITION_INFORMATION PositionInfo)
 
NTSTATUS RxQueryStandardInfo (PRX_CONTEXT RxContext, PFILE_STANDARD_INFORMATION StandardInfo)
 
VOID NTAPI RxReadRegistryParameters (VOID)
 
VOID NTAPI RxReleaseFileForNtCreateSection (PFILE_OBJECT FileObject)
 
NTSTATUS NTAPI RxReleaseForCcFlush (PFILE_OBJECT FileObject, PDEVICE_OBJECT DeviceObject)
 
PRX_CONTEXT RxRemoveOverflowEntry (PRDBSS_DEVICE_OBJECT DeviceObject, WORK_QUEUE_TYPE Queue)
 
NTSTATUS RxSearchForCollapsibleOpen (PRX_CONTEXT RxContext, ACCESS_MASK DesiredAccess, ULONG ShareAccess)
 
NTSTATUS RxSetAllocationInfo (PRX_CONTEXT RxContext)
 
NTSTATUS RxSetBasicInfo (PRX_CONTEXT RxContext)
 
NTSTATUS RxSetDispositionInfo (PRX_CONTEXT RxContext)
 
NTSTATUS RxSetEndOfFileInfo (PRX_CONTEXT RxContext)
 
NTSTATUS RxSetPipeInfo (PRX_CONTEXT RxContext)
 
NTSTATUS RxSetPositionInfo (PRX_CONTEXT RxContext)
 
NTSTATUS RxSetRenameInfo (PRX_CONTEXT RxContext)
 
NTSTATUS RxSetSimpleInfo (PRX_CONTEXT RxContext)
 
VOID RxSetupNetFileObject (PRX_CONTEXT RxContext)
 
NTSTATUS RxSystemControl (IN PRDBSS_DEVICE_OBJECT RxDeviceObject, IN PIRP Irp)
 
VOID RxUninitializeCacheMap (PRX_CONTEXT RxContext, PFILE_OBJECT FileObject, PLARGE_INTEGER TruncateSize)
 
VOID RxUnstart (PRX_CONTEXT Context, PRDBSS_DEVICE_OBJECT DeviceObject)
 
NTSTATUS RxXXXControlFileCallthru (PRX_CONTEXT Context)
 
PVOID NTAPI _RxAllocatePoolWithTag (_In_ POOL_TYPE PoolType, _In_ SIZE_T NumberOfBytes, _In_ ULONG Tag)
 
VOID NTAPI _RxFreePool (_In_ PVOID Buffer)
 
VOID NTAPI _RxFreePoolWithTag (_In_ PVOID Buffer, _In_ ULONG Tag)
 
 DECLARE_CONST_UNICODE_STRING (unknownId, L"???")
 
VOID CheckForLoudOperations (PRX_CONTEXT RxContext)
 
VOID __RxInitializeTopLevelIrpContext (IN OUT PRX_TOPLEVELIRP_CONTEXT TopLevelContext, IN PIRP Irp, IN PRDBSS_DEVICE_OBJECT RxDeviceObject, IN ULONG Flags)
 
VOID __RxWriteReleaseResources (PRX_CONTEXT RxContext, BOOLEAN ResourceOwnerSet, ULONG LineNumber, PCSTR FileName, ULONG SerialNumber)
 
VOID NTAPI RxAddToWorkque (IN PRX_CONTEXT RxContext, IN PIRP Irp)
 
VOID RxAdjustFileTimesAndSize (PRX_CONTEXT RxContext)
 
NTSTATUS RxAllocateCanonicalNameBuffer (PRX_CONTEXT RxContext, PUNICODE_STRING CanonicalName, USHORT CanonicalLength)
 
VOID RxCancelNotifyChangeDirectoryRequestsForFobx (PFOBX Fobx)
 
NTSTATUS RxCancelNotifyChangeDirectoryRequestsForVNetRoot (PV_NET_ROOT VNetRoot, BOOLEAN ForceFilesClosed)
 
BOOLEAN RxCancelOperationInOverflowQueue (PRX_CONTEXT RxContext)
 
VOID NTAPI RxCancelRoutine (PDEVICE_OBJECT DeviceObject, PIRP Irp)
 
NTSTATUS RxCanonicalizeFileNameByServerSpecs (PRX_CONTEXT RxContext, PUNICODE_STRING NetRootName)
 
NTSTATUS RxCanonicalizeNameAndObtainNetRoot (PRX_CONTEXT RxContext, PUNICODE_STRING FileName, PUNICODE_STRING NetRootName)
 
VOID NTAPI RxCheckFcbStructuresForAlignment (VOID)
 
NTSTATUS RxCheckShareAccessPerSrvOpens (IN PFCB Fcb, IN ACCESS_MASK DesiredAccess, IN ULONG DesiredShareAccess)
 
VOID RxCleanupPipeQueues (PRX_CONTEXT Context)
 
NTSTATUS RxCloseAssociatedSrvOpen (IN PFOBX Fobx, IN PRX_CONTEXT RxContext OPTIONAL)
 
NTSTATUS RxCollapseOrCreateSrvOpen (PRX_CONTEXT RxContext)
 
NTSTATUS NTAPI RxCompleteMdl (IN PRX_CONTEXT RxContext)
 
VOID RxConjureOriginalName (PFCB Fcb, PFOBX Fobx, PULONG ActualNameLength, PWCHAR OriginalName, PLONG LengthRemaining, RX_NAME_CONJURING_METHODS NameConjuringMethod)
 
VOID NTAPI RxDebugControlCommand (_In_ PSTR ControlString)
 
NTSTATUS NTAPI RxDriverEntry (IN PDRIVER_OBJECT DriverObject, IN PUNICODE_STRING RegistryPath)
 
NTSTATUS RxFsdCommonDispatch (PRX_FSD_DISPATCH_VECTOR DispatchVector, UCHAR MajorFunction, PIO_STACK_LOCATION Stack, PFILE_OBJECT FileObject, PIRP Irp, PRDBSS_DEVICE_OBJECT RxDeviceObject)
 
NTSTATUS NTAPI RxFsdDispatch (IN PRDBSS_DEVICE_OBJECT RxDeviceObject, IN PIRP Irp)
 
NTSTATUS RxFsdPostRequest (IN PRX_CONTEXT RxContext)
 
ULONG RxGetNetworkProviderPriority (PUNICODE_STRING DeviceName)
 
ULONG RxGetSessionId (IN PIO_STACK_LOCATION IrpSp)
 
PRDBSS_DEVICE_OBJECT RxGetTopDeviceObjectIfRdbssIrp (VOID)
 
PIRP RxGetTopIrpIfRdbssIrp (VOID)
 
LUID RxGetUid (IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext)
 
VOID NTAPI RxIndicateChangeOfBufferingStateForSrvOpen (PMRX_SRV_CALL SrvCall, PMRX_SRV_OPEN SrvOpen, PVOID SrvOpenKey, PVOID Context)
 
NTSTATUS NTAPI RxInitializeLog (VOID)
 
VOID RxInitializeMinirdrDispatchTable (IN PDRIVER_OBJECT DriverObject)
 
BOOLEAN RxIsMemberOfTopLevelIrpAllocatedContextsList (PRX_TOPLEVELIRP_CONTEXT TopLevelContext)
 
BOOLEAN RxIsOkToPurgeFcb (PFCB Fcb)
 
BOOLEAN RxIsThisTheTopLevelIrp (IN PIRP Irp)
 
NTSTATUS NTAPI RxLockOperationCompletion (IN PVOID Context, IN PIRP Irp)
 
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 NTAPI RxLowIoCompletion (PRX_CONTEXT RxContext)
 
NTSTATUS RxLowIoLockControlShell (IN PRX_CONTEXT RxContext)
 
NTSTATUS NTAPI RxLowIoNotifyChangeDirectoryCompletion (PRX_CONTEXT RxContext)
 
NTSTATUS RxPostStackOverflowRead (IN PRX_CONTEXT RxContext)
 
VOID RxpPrepareCreateContextForReuse (PRX_CONTEXT RxContext)
 
NTSTATUS RxPrefixClaim (IN PRX_CONTEXT RxContext)
 
NTSTATUS NTAPI RxPrepareToReparseSymbolicLink (PRX_CONTEXT RxContext, BOOLEAN SymbolicLinkEmbeddedInOldPath, PUNICODE_STRING NewPath, BOOLEAN NewPathIsAbsolute, PBOOLEAN ReparseRequired)
 
VOID RxPrePostIrp (IN PVOID Context, IN PIRP Irp)
 
NTSTATUS RxpSetInfoMiniRdr (PRX_CONTEXT RxContext, FILE_INFORMATION_CLASS Class)
 
VOID NTAPI RxpUnregisterMinirdr (IN PRDBSS_DEVICE_OBJECT RxDeviceObject)
 
NTSTATUS NTAPI RxRegisterMinirdr (OUT PRDBSS_DEVICE_OBJECT *DeviceObject, IN OUT PDRIVER_OBJECT DriverObject, IN PMINIRDR_DISPATCH MrdrDispatch, IN ULONG Controls, IN PUNICODE_STRING DeviceName, IN ULONG DeviceExtensionSize, IN DEVICE_TYPE DeviceType, IN ULONG DeviceCharacteristics)
 
VOID RxRemoveFromTopLevelIrpAllocatedContextsList (PRX_TOPLEVELIRP_CONTEXT TopLevelContext)
 
VOID RxRemoveShareAccessPerSrvOpens (IN OUT PSRV_OPEN SrvOpen)
 
NTSTATUS NTAPI RxStartMinirdr (IN PRX_CONTEXT RxContext, OUT PBOOLEAN PostToFsp)
 
NTSTATUS NTAPI RxStopMinirdr (IN PRX_CONTEXT RxContext, OUT PBOOLEAN PostToFsp)
 
BOOLEAN RxTryToBecomeTheTopLevelIrp (IN OUT PRX_TOPLEVELIRP_CONTEXT TopLevelContext, IN PIRP Irp, IN PRDBSS_DEVICE_OBJECT RxDeviceObject, IN BOOLEAN ForceTopLevel)
 
VOID NTAPI RxUnload (IN PDRIVER_OBJECT DriverObject)
 
VOID NTAPI RxUnlockOperation (IN PVOID Context, IN PFILE_LOCK_INFO LockInfo)
 
VOID RxUnwindTopLevelIrp (IN OUT PRX_TOPLEVELIRP_CONTEXT TopLevelContext)
 
VOID RxUpdateShareAccessPerSrvOpens (IN PSRV_OPEN SrvOpen)
 

Variables

WCHAR RxStarForTemplate = '*'
 
WCHAR Rx8QMdot3QM [] = L">>>>>>>>.>>>*"
 
BOOLEAN DisableByteRangeLockingOnReadOnlyFiles = FALSE
 
BOOLEAN DisableFlushOnCleanup = FALSE
 
ULONG ReadAheadGranularity = 1 << PAGE_SHIFT
 
LIST_ENTRY RxActiveContexts
 
NPAGED_LOOKASIDE_LIST RxContextLookasideList
 
RDBSS_DATA RxData
 
FCB RxDeviceFCB
 
BOOLEAN RxLoudLowIoOpsEnabled = FALSE
 
RX_FSD_DISPATCH_VECTOR RxDeviceFCBVector [IRP_MJ_MAXIMUM_FUNCTION+1]
 
RDBSS_EXPORTS RxExports
 
FAST_IO_DISPATCH RxFastIoDispatch
 
PRDBSS_DEVICE_OBJECT RxFileSystemDeviceObject
 
RX_FSD_DISPATCH_VECTOR RxFsdDispatchVector [IRP_MJ_MAXIMUM_FUNCTION+1]
 
ULONG RxFsdEntryCount
 
LIST_ENTRY RxIrpsList
 
KSPIN_LOCK RxIrpsListSpinLock
 
KMUTEX RxScavengerMutex
 
KMUTEX RxSerializationMutex
 
UCHAR RxSpaceForTheWrappersDeviceObject [sizeof(*RxFileSystemDeviceObject)]
 
KSPIN_LOCK TopLevelIrpSpinLock
 
LIST_ENTRY TopLevelIrpAllocatedContextsList
 
BOOLEAN RxForceQFIPassThrough = FALSE
 
BOOLEAN RxNoAsync = FALSE
 

Macro Definition Documentation

◆ _SEH2_TRY_RETURN [1/2]

#define _SEH2_TRY_RETURN (   S)    S; goto try_exit

◆ _SEH2_TRY_RETURN [2/2]

#define _SEH2_TRY_RETURN (   S)    S; goto try_exit

◆ ALLSCR_LENGTH

#define ALLSCR_LENGTH   (sizeof(L"all.scr") - sizeof(UNICODE_NULL))

◆ BugCheckFileId [1/3]

#define BugCheckFileId   RDBSS_BUG_CHECK_CLEANUP

◆ BugCheckFileId [2/3]

#define BugCheckFileId   RDBSS_BUG_CHECK_CLOSE

◆ BugCheckFileId [3/3]

#define BugCheckFileId   RDBSS_BUG_CHECK_CACHESUP

◆ FILE_ATTRIBUTE_VOLUME

#define FILE_ATTRIBUTE_VOLUME   0x8

◆ NDEBUG

#define NDEBUG

Definition at line 35 of file rdbss.c.

◆ RX_TOPLEVELCTX_FLAG_FROM_POOL

#define RX_TOPLEVELCTX_FLAG_FROM_POOL   1

Definition at line 38 of file rdbss.c.

◆ SET_SIZE_AND_QUERY

#define SET_SIZE_AND_QUERY (   AlreadyConsummed,
  Function 
)
Value:
Context->Info.Length = Stack->Parameters.QueryFile.Length - (AlreadyConsummed); \
Status = Function(Context, Add2Ptr(Buffer, AlreadyConsummed))
#define Add2Ptr(PTR, INC)
static LPOVERLAPPED_COMPLETION_ROUTINE Function
Definition: sync.c:684
Definition: bufpool.h:45

◆ VALID_DIR_ATTRIBUTES

#define VALID_DIR_ATTRIBUTES   (VALID_FILE_ATTRIBUTES | FILE_ATTRIBUTE_DIRECTORY)

◆ VALID_FILE_ATTRIBUTES

#define VALID_FILE_ATTRIBUTES
Value:
( \
FILE_ATTRIBUTE_READONLY | FILE_ATTRIBUTE_HIDDEN | \
FILE_ATTRIBUTE_SYSTEM | FILE_ATTRIBUTE_VOLUME | \
FILE_ATTRIBUTE_ARCHIVE | FILE_ATTRIBUTE_DEVICE | \
FILE_ATTRIBUTE_TEMPORARY | FILE_ATTRIBUTE_SPARSE_FILE | \
FILE_ATTRIBUTE_REPARSE_POINT | FILE_ATTRIBUTE_COMPRESSED | \
FILE_ATTRIBUTE_OFFLINE | FILE_ATTRIBUTE_NOT_CONTENT_INDEXED | \
FILE_ATTRIBUTE_ENCRYPTED | FILE_ATTRIBUTE_INTEGRITY_STREAM)
#define FILE_ATTRIBUTE_SPARSE_FILE
Definition: ntifs_ex.h:380
#define FILE_ATTRIBUTE_VOLUME
#define FILE_ATTRIBUTE_NOT_CONTENT_INDEXED
Definition: ntifs_ex.h:384
#define FILE_ATTRIBUTE_DEVICE
Definition: disk.h:27
#define FILE_ATTRIBUTE_COMPRESSED
Definition: nt_native.h:711
#define FILE_ATTRIBUTE_HIDDEN
Definition: nt_native.h:703
#define FILE_ATTRIBUTE_INTEGRITY_STREAM

Typedef Documentation

◆ PRX_FSD_DISPATCH

typedef NTSTATUS(NTAPI * PRX_FSD_DISPATCH) (PRX_CONTEXT Context)

Definition at line 42 of file rdbss.c.

◆ PRX_FSD_DISPATCH_VECTOR

◆ RX_FSD_DISPATCH_VECTOR

Function Documentation

◆ __RxInitializeTopLevelIrpContext()

VOID __RxInitializeTopLevelIrpContext ( IN OUT PRX_TOPLEVELIRP_CONTEXT  TopLevelContext,
IN PIRP  Irp,
IN PRDBSS_DEVICE_OBJECT  RxDeviceObject,
IN ULONG  Flags 
)

Definition at line 674 of file rdbss.c.

679 {
680  DPRINT("__RxInitializeTopLevelIrpContext(%p, %p, %p, %u)\n", TopLevelContext, Irp, RxDeviceObject, Flags);
681 
682  RtlZeroMemory(TopLevelContext, sizeof(RX_TOPLEVELIRP_CONTEXT));
683  TopLevelContext->Irp = Irp;
684  TopLevelContext->Flags = (Flags ? RX_TOPLEVELCTX_FLAG_FROM_POOL : 0);
685  TopLevelContext->Signature = RX_TOPLEVELIRP_CONTEXT_SIGNATURE;
686  TopLevelContext->RxDeviceObject = RxDeviceObject;
687  TopLevelContext->Previous = IoGetTopLevelIrp();
688  TopLevelContext->Thread = PsGetCurrentThread();
689 
690  /* We cannot add to list something that'd come from stack */
691  if (BooleanFlagOn(TopLevelContext->Flags, RX_TOPLEVELCTX_FLAG_FROM_POOL))
692  {
694  }
695 }
#define PsGetCurrentThread()
Definition: env_spec_w32.h:81
_In_ PIRP Irp
Definition: csq.h:116
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
_Must_inspect_result_ _In_ ULONG Flags
Definition: wsk.h:170
void DPRINT(...)
Definition: polytest.cpp:61
PIRP NTAPI IoGetTopLevelIrp(VOID)
Definition: irp.c:1843
#define RX_TOPLEVELCTX_FLAG_FROM_POOL
Definition: rdbss.c:38
#define RX_TOPLEVELIRP_CONTEXT_SIGNATURE
Definition: rxcontx.h:4
VOID RxAddToTopLevelIrpAllocatedContextsList(PRX_TOPLEVELIRP_CONTEXT TopLevelContext)
Definition: rdbss.c:752
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261

Referenced by RxTryToBecomeTheTopLevelIrp().

◆ __RxWriteReleaseResources()

VOID __RxWriteReleaseResources ( PRX_CONTEXT  RxContext,
BOOLEAN  ResourceOwnerSet,
ULONG  LineNumber,
PCSTR  FileName,
ULONG  SerialNumber 
)

Definition at line 701 of file rdbss.c.

707 {
708  RxCaptureFcb;
709 
710  PAGED_CODE();
711 
712  ASSERT(RxContext != NULL);
713  ASSERT(capFcb != NULL);
714 
715  /* If FCB resource was acquired, release it */
716  if (RxContext->FcbResourceAcquired)
717  {
718  /* Taking care of owner */
719  if (ResourceOwnerSet)
720  {
722  }
723  else
724  {
725  RxReleaseFcb(RxContext, capFcb);
726  }
727 
728  RxContext->FcbResourceAcquired = FALSE;
729  }
730 
731  /* If FCB paging resource was acquired, release it */
732  if (RxContext->FcbPagingIoResourceAcquired)
733  {
734  /* Taking care of owner */
735  if (ResourceOwnerSet)
736  {
738  }
739  else
740  {
741  RxReleasePagingIoResource(RxContext, capFcb);
742  }
743 
744  /* No need to release boolean here, RxReleasePagingIoResource() takes care of it */
745  }
746 }
#define RxReleaseFcbForThread(R, F, T)
Definition: rxprocs.h:205
BOOLEAN FcbPagingIoResourceAcquired
Definition: rxcontx.h:126
#define RxReleasePagingIoResourceForThread(RxContext, Fcb, Thread)
Definition: rxprocs.h:276
#define RxCaptureFcb
Definition: ntrxdef.h:10
#define PAGED_CODE()
Definition: video.h:57
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
smooth NULL
Definition: ftsmooth.c:416
ERESOURCE_THREAD ResourceThreadId
Definition: mrx.h:285
#define RxReleasePagingIoResource(RxContext, Fcb)
Definition: rxprocs.h:268
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define capFcb
Definition: ntrxdef.h:20
LOWIO_CONTEXT LowIoContext
Definition: rxcontx.h:263
BOOLEAN FcbResourceAcquired
Definition: rxcontx.h:125

◆ _RxAllocatePoolWithTag()

PVOID NTAPI _RxAllocatePoolWithTag ( _In_ POOL_TYPE  PoolType,
_In_ SIZE_T  NumberOfBytes,
_In_ ULONG  Tag 
)

Definition at line 8941 of file rxce.c.

8945 {
8947 }
PVOID NTAPI ExAllocatePoolWithTagPriority(IN POOL_TYPE PoolType, IN SIZE_T NumberOfBytes, IN ULONG Tag, IN EX_POOL_PRIORITY Priority)
Definition: expool.c:2907
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
_Must_inspect_result_ typedef _In_ PHYSICAL_ADDRESS _Inout_ PLARGE_INTEGER NumberOfBytes
Definition: iotypes.h:998
_Must_inspect_result_ _In_ FLT_CONTEXT_TYPE _In_ SIZE_T _In_ POOL_TYPE PoolType
Definition: fltkernel.h:1444

◆ _RxFreePool()

VOID NTAPI _RxFreePool ( _In_ PVOID  Buffer)

Definition at line 8954 of file rxce.c.

8956 {
8958 }
Definition: bufpool.h:45
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

◆ _RxFreePoolWithTag()

VOID NTAPI _RxFreePoolWithTag ( _In_ PVOID  Buffer,
_In_ ULONG  Tag 
)

Definition at line 8965 of file rxce.c.

8968 {
8970 }
Definition: bufpool.h:45
IN ULONG IN ULONG Tag
Definition: evtlib.h:159
#define ExFreePoolWithTag(_P, _T)
Definition: module.h:1099

◆ CheckForLoudOperations()

VOID CheckForLoudOperations ( PRX_CONTEXT  RxContext)

Definition at line 647 of file rdbss.c.

649 {
650  RxCaptureFcb;
651 
652  PAGED_CODE();
653 
654 #define ALLSCR_LENGTH (sizeof(L"all.scr") - sizeof(UNICODE_NULL))
655 
656  /* Are loud operations enabled? */
658  {
659  /* If so, the operation will be loud only if filename ends with all.scr */
660  if (RtlCompareMemory(Add2Ptr(capFcb->PrivateAlreadyPrefixedName.Buffer,
661  (capFcb->PrivateAlreadyPrefixedName.Length - ALLSCR_LENGTH)),
662  L"all.scr", ALLSCR_LENGTH) == ALLSCR_LENGTH)
663  {
665  }
666  }
667 #undef ALLSCR_LENGTH
668 }
#define Add2Ptr(PTR, INC)
#define RxCaptureFcb
Definition: ntrxdef.h:10
#define PAGED_CODE()
Definition: video.h:57
#define ALLSCR_LENGTH
static const WCHAR L[]
Definition: oid.c:1250
BOOLEAN RxLoudLowIoOpsEnabled
Definition: rdbss.c:539
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define LOWIO_CONTEXT_FLAG_LOUDOPS
Definition: mrx.h:322
#define capFcb
Definition: ntrxdef.h:20
LOWIO_CONTEXT LowIoContext
Definition: rxcontx.h:263
USHORT Flags
Definition: mrx.h:282
#define RtlCompareMemory(s1, s2, l)
Definition: env_spec_w32.h:465

Referenced by RxCommonRead(), and RxCommonWrite().

◆ DECLARE_CONST_UNICODE_STRING()

DECLARE_CONST_UNICODE_STRING ( unknownId  ,
L"???"   
)

◆ RxAcquireFileForNtCreateSection()

VOID NTAPI RxAcquireFileForNtCreateSection ( PFILE_OBJECT  FileObject)

Definition at line 276 of file rxce.c.

278 {
280 }
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by RxInitializeDispatchVectors().

◆ RxAcquireForCcFlush()

NTSTATUS NTAPI RxAcquireForCcFlush ( PFILE_OBJECT  FileObject,
PDEVICE_OBJECT  DeviceObject 
)

Definition at line 284 of file rxce.c.

287 {
289  return STATUS_NOT_IMPLEMENTED;
290 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by RxInitializeDispatchVectors().

◆ RxAddToTopLevelIrpAllocatedContextsList()

VOID RxAddToTopLevelIrpAllocatedContextsList ( PRX_TOPLEVELIRP_CONTEXT  TopLevelContext)

Definition at line 752 of file rdbss.c.

754 {
755  KIRQL OldIrql;
756 
757  DPRINT("RxAddToTopLevelIrpAllocatedContextsList(%p)\n", TopLevelContext);
758 
761 
765 }
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LIST_ENTRY ListEntry
Definition: rxcontx.h:13
#define InsertTailList(ListHead, Entry)
UCHAR KIRQL
Definition: env_spec_w32.h:591
void DPRINT(...)
Definition: polytest.cpp:61
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
LIST_ENTRY TopLevelIrpAllocatedContextsList
Definition: rdbss.c:612
#define RX_TOPLEVELCTX_FLAG_FROM_POOL
Definition: rdbss.c:38
#define RX_TOPLEVELIRP_CONTEXT_SIGNATURE
Definition: rxcontx.h:4
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
KSPIN_LOCK TopLevelIrpSpinLock
Definition: rdbss.c:611

Referenced by __RxInitializeTopLevelIrpContext().

◆ RxAddToWorkque()

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

Definition at line 772 of file rdbss.c.

775 {
776  ULONG Queued;
777  KIRQL OldIrql;
778  WORK_QUEUE_TYPE Queue;
779 
781 
782  RxContext->PostRequest = FALSE;
783 
784  /* First of all, select the appropriate queue - delayed for prefix claim, critical for the rest */
785  if (RxContext->MajorFunction == IRP_MJ_DEVICE_CONTROL &&
786  capPARAMS->Parameters.DeviceIoControl.IoControlCode == IOCTL_REDIR_QUERY_PATH)
787  {
788  Queue = DelayedWorkQueue;
790  }
791  else
792  {
793  Queue = CriticalWorkQueue;
795  }
796 
797  /* Check for overflow */
798  if (capPARAMS->FileObject != NULL)
799  {
801 
803  /* In case of an overflow, add the new queued call to the overflow list */
804  if (Queued > 1)
805  {
807  InsertTailList(&RxFileSystemDeviceObject->OverflowQueue[Queue], &RxContext->OverflowListEntry);
809 
811  return;
812  }
813 
815  }
816 
817  ExInitializeWorkItem(&RxContext->WorkQueueItem, RxFspDispatch, RxContext);
818  ExQueueWorkItem((PWORK_QUEUE_ITEM)&RxContext->WorkQueueItem, Queue);
819 }
volatile LONG PostedRequestCount[RxMaximumWorkQueue]
Definition: rxstruc.h:119
VOID NTAPI ExQueueWorkItem(IN PWORK_QUEUE_ITEM WorkItem, IN WORK_QUEUE_TYPE QueueType)
Definition: work.c:717
LONG OverflowQueueCount[RxMaximumWorkQueue]
Definition: rxstruc.h:120
#define RxCaptureParamBlock
Definition: ntrxdef.h:17
#define InsertTailList(ListHead, Entry)
#define capPARAMS
Definition: ntrxdef.h:22
UCHAR KIRQL
Definition: env_spec_w32.h:591
RX_SPIN_LOCK OverflowQueueSpinLock
Definition: rxstruc.h:122
smooth NULL
Definition: ftsmooth.c:416
#define ExInitializeWorkItem(Item, Routine, Context)
Definition: exfuncs.h:265
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
VOID NTAPI RxFspDispatch(IN PVOID Context)
Definition: rdbss.c:6571
enum _WORK_QUEUE_TYPE WORK_QUEUE_TYPE
#define InterlockedDecrement
Definition: armddk.h:52
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define IOCTL_REDIR_QUERY_PATH
#define InterlockedIncrement
Definition: armddk.h:53
PRDBSS_DEVICE_OBJECT RxFileSystemDeviceObject
Definition: rdbss.c:573
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
unsigned int ULONG
Definition: retypes.h:1
LIST_ENTRY OverflowQueue[RxMaximumWorkQueue]
Definition: rxstruc.h:121
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

Referenced by RxCommonWrite(), and RxFsdPostRequest().

◆ RxAdjustFileTimesAndSize()

VOID RxAdjustFileTimesAndSize ( PRX_CONTEXT  RxContext)

Definition at line 825 of file rdbss.c.

827 {
829  LARGE_INTEGER CurrentTime;
830  FILE_BASIC_INFORMATION FileBasicInfo;
831  FILE_END_OF_FILE_INFORMATION FileEOFInfo;
832  BOOLEAN FileModified, SetLastChange, SetLastAccess, SetLastWrite, NeedUpdate;
833 
834  RxCaptureFcb;
838 
839  PAGED_CODE();
840 
841  /* If Cc isn't initialized, the file was not read nor written, nothing to do */
842  if (capFileObject->PrivateCacheMap == NULL)
843  {
844  return;
845  }
846 
847  /* Get now */
848  KeQuerySystemTime(&CurrentTime);
849 
850  /* Was the file modified? */
851  FileModified = BooleanFlagOn(capFileObject->Flags, FO_FILE_MODIFIED);
852  /* We'll set last write if it was modified and user didn't update yet */
853  SetLastWrite = FileModified && !BooleanFlagOn(capFobx->Flags, FOBX_FLAG_USER_SET_LAST_WRITE);
854  /* File was accessed if: written or read (fastio), we'll update last access if user didn't */
855  SetLastAccess = SetLastWrite ||
858  /* We'll set last change if it was modified and user didn't update yet */
859  SetLastChange = FileModified && !BooleanFlagOn(capFobx->Flags, FOBX_FLAG_USER_SET_LAST_CHANGE);
860 
861  /* Nothing to update? Job done */
862  if (!FileModified && !SetLastWrite && !SetLastAccess && !SetLastChange)
863  {
864  return;
865  }
866 
867  /* By default, we won't issue any MRxSetFileInfoAtCleanup call */
868  NeedUpdate = FALSE;
869  RtlZeroMemory(&FileBasicInfo, sizeof(FileBasicInfo));
870 
871  /* Update lastwrite time if required */
872  if (SetLastWrite)
873  {
874  NeedUpdate = TRUE;
875  capFcb->LastWriteTime.QuadPart = CurrentTime.QuadPart;
876  FileBasicInfo.LastWriteTime.QuadPart = CurrentTime.QuadPart;
877  }
878 
879  /* Update lastaccess time if required */
880  if (SetLastAccess)
881  {
882  NeedUpdate = TRUE;
883  capFcb->LastAccessTime.QuadPart = CurrentTime.QuadPart;
884  FileBasicInfo.LastAccessTime.QuadPart = CurrentTime.QuadPart;
885  }
886 
887  /* Update lastchange time if required */
888  if (SetLastChange)
889  {
890  NeedUpdate = TRUE;
891  capFcb->LastChangeTime.QuadPart = CurrentTime.QuadPart;
892  FileBasicInfo.ChangeTime.QuadPart = CurrentTime.QuadPart;
893  }
894 
895  /* If one of the date was modified, issue a call to mini-rdr */
896  if (NeedUpdate)
897  {
898  RxContext->Info.FileInformationClass = FileBasicInformation;
899  RxContext->Info.Buffer = &FileBasicInfo;
900  RxContext->Info.Length = sizeof(FileBasicInfo);
901 
902  MINIRDR_CALL(Status, RxContext, capFcb->MRxDispatch, MRxSetFileInfoAtCleanup, (RxContext));
903  (void)Status;
904  }
905 
906  /* If the file was modified, update its EOF */
907  if (FileModified)
908  {
909  FileEOFInfo.EndOfFile.QuadPart = capFcb->Header.FileSize.QuadPart;
910 
911  RxContext->Info.FileInformationClass = FileEndOfFileInformation;
912  RxContext->Info.Buffer = &FileEOFInfo;
913  RxContext->Info.Length = sizeof(FileEOFInfo);
914 
915  MINIRDR_CALL(Status, RxContext, capFcb->MRxDispatch, MRxSetFileInfoAtCleanup, (RxContext));
916  (void)Status;
917  }
918 }
#define KeQuerySystemTime(t)
Definition: env_spec_w32.h:570
#define TRUE
Definition: types.h:120
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
#define RxCaptureParamBlock
Definition: ntrxdef.h:17
LARGE_INTEGER LastAccessTime
Definition: nt_native.h:940
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LONG NTSTATUS
Definition: precomp.h:26
#define RxCaptureFcb
Definition: ntrxdef.h:10
#define PAGED_CODE()
Definition: video.h:57
struct _RX_CONTEXT::@2087::@2095 Info
#define FO_FILE_MODIFIED
Definition: iotypes.h:1745
#define FO_FILE_FAST_IO_READ
Definition: iotypes.h:1752
#define capFobx
Definition: ntrxdef.h:21
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define capFileObject
Definition: ntrxdef.h:23
LARGE_INTEGER LastWriteTime
Definition: nt_native.h:941
#define MINIRDR_CALL(STATUS, CONTEXT, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:389
#define RxCaptureFileObject
Definition: ntrxdef.h:18
LARGE_INTEGER ChangeTime
Definition: nt_native.h:942
Status
Definition: gdiplustypes.h:24
#define FOBX_FLAG_USER_SET_LAST_CHANGE
Definition: fcb.h:294
#define capFcb
Definition: ntrxdef.h:20
#define RxCaptureFobx
Definition: ntrxdef.h:11
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
LONGLONG QuadPart
Definition: typedefs.h:112
#define FOBX_FLAG_USER_SET_LAST_ACCESS
Definition: fcb.h:292
#define FOBX_FLAG_USER_SET_LAST_WRITE
Definition: fcb.h:291

Referenced by RxCommonCleanup().

◆ RxAllocateCanonicalNameBuffer()

NTSTATUS RxAllocateCanonicalNameBuffer ( PRX_CONTEXT  RxContext,
PUNICODE_STRING  CanonicalName,
USHORT  CanonicalLength 
)

Definition at line 924 of file rdbss.c.

928 {
929  PAGED_CODE();
930 
931  DPRINT("RxContext: %p - CanonicalNameBuffer: %p\n", RxContext, RxContext->Create.CanonicalNameBuffer);
932 
933  /* Context must be free of any already allocated name */
934  ASSERT(RxContext->Create.CanonicalNameBuffer == NULL);
935 
936  /* Validate string length */
937  if (CanonicalLength > USHRT_MAX - 1)
938  {
939  CanonicalName->Buffer = NULL;
941  }
942 
943  CanonicalName->Buffer = RxAllocatePoolWithTag(PagedPool | POOL_COLD_ALLOCATION, CanonicalLength, RX_MISC_POOLTAG);
944  if (CanonicalName->Buffer == NULL)
945  {
947  }
948 
949  CanonicalName->Length = 0;
950  CanonicalName->MaximumLength = CanonicalLength;
951 
952  /* Set the two places - they must always be identical */
953  RxContext->Create.CanonicalNameBuffer = CanonicalName->Buffer;
954  RxContext->AlsoCanonicalNameBuffer = CanonicalName->Buffer;
955 
956  return STATUS_SUCCESS;
957 }
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
PWCH AlsoCanonicalNameBuffer
Definition: rxcontx.h:267
struct _RX_CONTEXT::@2089::@2101 Create
USHORT MaximumLength
Definition: env_spec_w32.h:370
#define POOL_COLD_ALLOCATION
#define PAGED_CODE()
Definition: video.h:57
#define USHRT_MAX
Definition: limits.h:38
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define RxAllocatePoolWithTag
Definition: ntrxdef.h:25
#define RX_MISC_POOLTAG
Definition: rxpooltg.h:10
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_OBJECT_PATH_INVALID
Definition: ntstatus.h:279
return STATUS_SUCCESS
Definition: btrfs.c:2938

Referenced by RxFirstCanonicalize().

◆ RxAssert()

VOID RxAssert ( PVOID  Assert,
PVOID  File,
ULONG  Line,
PVOID  Message 
)

Definition at line 645 of file rxce.c.

650 {
651  CHAR Response[2];
653 
654  /* If we're not asked to continue, just stop the system */
656  {
657  KeBugCheckEx(RDBSS_FILE_SYSTEM, RDBSS_BUG_CHECK_ASSERT | Line, 0, 0, 0);
658  }
659 
660  /* Otherwise, capture context to offer the user to dump it */
662 
663  /* Loop until the user hits 'i' */
664  while (TRUE)
665  {
666  /* If no file provided, use empty name */
667  if (File == NULL)
668  {
669  File = "";
670  }
671 
672  /* If no message provided, use empty one */
673  if (Message == NULL)
674  {
675  Message = "";
676  }
677 
678  /* Display the message */
679  DbgPrint("\n*** Assertion failed: %s%s\n*** Source File: %s, line %ld\n\n", Message, Assert, File, Line);
680  /* And ask the user */
681  DbgPrompt("Break, Ignore (bi)? ", Response, sizeof(Response));
682  /* If he asks for ignore, quit
683  * In case of invalid input, ask again
684  */
685  if (Response[0] != 'B' && Response[0] != 'b')
686  {
687  if (Response[0] == 'I' || Response[0] == 'i')
688  {
689  return;
690  }
691 
692  continue;
693  }
694 
695  /* Break: offer the user to dump the context and break */
696  DbgPrint("Execute '!cxr %lx' to dump context\n", &Context);
697  DbgBreakPoint();
698 
699  /* Continue looping, so that after dump, execution can continue (with ignore) */
700  }
701 }
#define TRUE
Definition: types.h:120
#define DbgPrint
Definition: loader.c:25
NTSYSAPI ULONG NTAPI DbgPrompt(_In_z_ PCCH Prompt, _Out_writes_bytes_(MaximumResponseLength) PCH Response, _In_ ULONG MaximumResponseLength)
#define RDBSS_FILE_SYSTEM
Definition: nodetype.h:84
char CHAR
Definition: xmlstorage.h:175
void DbgBreakPoint()
Definition: mach.c:553
NTSYSAPI VOID NTAPI RtlCaptureContext(_Out_ PCONTEXT ContextRecord)
smooth NULL
Definition: ftsmooth.c:416
BOOLEAN RxContinueFromAssert
Definition: rxce.c:137
#define Assert(cond, msg)
Definition: zutil.h:196
Definition: ncftp.h:89
CHAR Message[80]
Definition: alive.c:5
Definition: ncftp.h:79
struct tagContext Context
Definition: acpixf.h:1024
Definition: File.h:15
VOID NTAPI KeBugCheckEx(_In_ ULONG BugCheckCode, _In_ ULONG_PTR BugCheckParameter1, _In_ ULONG_PTR BugCheckParameter2, _In_ ULONG_PTR BugCheckParameter3, _In_ ULONG_PTR BugCheckParameter4)
Definition: rtlcompat.c:107

◆ RxCancelNotifyChangeDirectoryRequestsForFobx()

VOID RxCancelNotifyChangeDirectoryRequestsForFobx ( PFOBX  Fobx)

Definition at line 963 of file rdbss.c.

965 {
966  KIRQL OldIrql;
969  LIST_ENTRY ContextsToCancel;
970 
971  /* Init a list for the contexts to cancel */
972  InitializeListHead(&ContextsToCancel);
973 
974  /* Lock our list lock */
976 
977  /* Now, browse all the active contexts, to find the associated ones */
979  while (Entry != &RxActiveContexts)
980  {
981  Context = CONTAINING_RECORD(Entry, RX_CONTEXT, ContextListEntry);
982  Entry = Entry->Flink;
983 
984  /* Not the IRP we're looking for, ignore */
985  if (Context->MajorFunction != IRP_MJ_DIRECTORY_CONTROL ||
986  Context->MinorFunction != IRP_MN_NOTIFY_CHANGE_DIRECTORY)
987  {
988  continue;
989  }
990 
991  /* Not the FOBX we're looking for, ignore */
992  if ((PFOBX)Context->pFobx != Fobx)
993  {
994  continue;
995  }
996 
997  /* No cancel routine (can't be cancel, then), ignore */
998  if (Context->MRxCancelRoutine == NULL)
999  {
1000  continue;
1001  }
1002 
1003  /* Mark our context as cancelled */
1005 
1006  /* Move it to our list */
1007  RemoveEntryList(&Context->ContextListEntry);
1008  InsertTailList(&ContextsToCancel, &Context->ContextListEntry);
1009 
1010  InterlockedIncrement((volatile long *)&Context->ReferenceCount);
1011  }
1012 
1013  /* Done with the contexts */
1015 
1016  /* Now, handle all our "extracted" contexts */
1017  while (!IsListEmpty(&ContextsToCancel))
1018  {
1019  Entry = RemoveHeadList(&ContextsToCancel);
1020  Context = CONTAINING_RECORD(Entry, RX_CONTEXT, ContextListEntry);
1021 
1022  /* If they had an associated IRP (should be always true) */
1023  if (Context->CurrentIrp != NULL)
1024  {
1025  /* Then, call cancel routine */
1026  ASSERT(Context->MRxCancelRoutine != NULL);
1027  DPRINT1("Canceling %p with %p\n", Context, Context->MRxCancelRoutine);
1028  Context->MRxCancelRoutine(Context);
1029  }
1030 
1031  /* And delete the context */
1033  }
1034 }
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
Definition: rdpdr.c:56
struct _Entry Entry
Definition: kefuncs.h:640
LIST_ENTRY RxActiveContexts
Definition: rdbss.c:535
Definition: fcb.h:304
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
RX_SPIN_LOCK RxStrucSupSpinLock
Definition: rxce.c:123
smooth NULL
Definition: ftsmooth.c:416
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
Definition: typedefs.h:117
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define InterlockedIncrement
Definition: armddk.h:53
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1024
#define RxDereferenceAndDeleteRxContext(RXCONTEXT)
Definition: rxcontx.h:514
base of all file and directory entries
Definition: entries.h:82

Referenced by RxCommonCleanup().

◆ RxCancelNotifyChangeDirectoryRequestsForVNetRoot()

NTSTATUS RxCancelNotifyChangeDirectoryRequestsForVNetRoot ( PV_NET_ROOT  VNetRoot,
BOOLEAN  ForceFilesClosed 
)

Definition at line 1040 of file rdbss.c.

1043 {
1044  KIRQL OldIrql;
1045  NTSTATUS Status;
1048  LIST_ENTRY ContextsToCancel;
1049 
1050  /* Init a list for the contexts to cancel */
1051  InitializeListHead(&ContextsToCancel);
1052 
1053  /* Lock our list lock */
1055 
1056  /* Assume success */
1058 
1059  /* Now, browse all the active contexts, to find the associated ones */
1061  while (Entry != &RxActiveContexts)
1062  {
1063  Context = CONTAINING_RECORD(Entry, RX_CONTEXT, ContextListEntry);
1064  Entry = Entry->Flink;
1065 
1066  /* Not the IRP we're looking for, ignore */
1067  if (Context->MajorFunction != IRP_MJ_DIRECTORY_CONTROL ||
1068  Context->MinorFunction != IRP_MN_NOTIFY_CHANGE_DIRECTORY)
1069  {
1070  continue;
1071  }
1072 
1073  /* Not the VNetRoot we're looking for, ignore */
1074  if (Context->pFcb == NULL ||
1075  (PV_NET_ROOT)Context->NotifyChangeDirectory.pVNetRoot != VNetRoot)
1076  {
1077  continue;
1078  }
1079 
1080  /* No cancel routine (can't be cancel, then), ignore */
1081  if (Context->MRxCancelRoutine == NULL)
1082  {
1083  continue;
1084  }
1085 
1086  /* At that point, we found a matching context
1087  * If we're not asked to force close, then fail - it's still open
1088  */
1089  if (!ForceFilesClosed)
1090  {
1092  break;
1093  }
1094 
1095  /* Mark our context as cancelled */
1097 
1098  /* Move it to our list */
1099  RemoveEntryList(&Context->ContextListEntry);
1100  InsertTailList(&ContextsToCancel, &Context->ContextListEntry);
1101 
1102  InterlockedIncrement((volatile long *)&Context->ReferenceCount);
1103  }
1104 
1105  /* Done with the contexts */
1107 
1108  if (Status != STATUS_SUCCESS)
1109  {
1110  return Status;
1111  }
1112 
1113  /* Now, handle all our "extracted" contexts */
1114  while (!IsListEmpty(&ContextsToCancel))
1115  {
1116  Entry = RemoveHeadList(&ContextsToCancel);
1117  Context = CONTAINING_RECORD(Entry, RX_CONTEXT, ContextListEntry);
1118 
1119  /* If they had an associated IRP (should be always true) */
1120  if (Context->CurrentIrp != NULL)
1121  {
1122  /* Then, call cancel routine */
1123  ASSERT(Context->MRxCancelRoutine != NULL);
1124  DPRINT1("Canceling %p with %p\n", Context, Context->MRxCancelRoutine);
1125  Context->MRxCancelRoutine(Context);
1126  }
1127 
1128  /* And delete the context */
1130  }
1131 
1132  return Status;
1133 }
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
Definition: rdpdr.c:56
struct _Entry Entry
Definition: kefuncs.h:640
LONG NTSTATUS
Definition: precomp.h:26
LIST_ENTRY RxActiveContexts
Definition: rdbss.c:535
#define InsertTailList(ListHead, Entry)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
RX_SPIN_LOCK RxStrucSupSpinLock
Definition: rxce.c:123
smooth NULL
Definition: ftsmooth.c:416
FORCEINLINE PLIST_ENTRY RemoveHeadList(_Inout_ PLIST_ENTRY ListHead)
Definition: rtlfuncs.h:128
#define IRP_MJ_DIRECTORY_CONTROL
Definition: rdpdr.c:51
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
Definition: typedefs.h:117
#define STATUS_FILES_OPEN
Definition: ntstatus.h:485
Status
Definition: gdiplustypes.h:24
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define InterlockedIncrement
Definition: armddk.h:53
#define InitializeListHead(ListHead)
Definition: env_spec_w32.h:944
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
#define DPRINT1
Definition: precomp.h:8
struct tagContext Context
Definition: acpixf.h:1024
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define RxDereferenceAndDeleteRxContext(RXCONTEXT)
Definition: rxcontx.h:514
base of all file and directory entries
Definition: entries.h:82

Referenced by RxFinalizeConnection().

◆ RxCancelOperationInOverflowQueue()

BOOLEAN RxCancelOperationInOverflowQueue ( PRX_CONTEXT  RxContext)

Definition at line 1139 of file rdbss.c.

1141 {
1142  KIRQL OldIrql;
1143  BOOLEAN OperationToCancel;
1144 
1145  /* By default, nothing cancelled */
1146  OperationToCancel = FALSE;
1147 
1148  /* Acquire the overflow spinlock */
1150 
1151  /* Is our context in any queue? */
1153  {
1154  /* Make sure flag is consistent with facts... */
1155  if (RxContext->OverflowListEntry.Flink != NULL)
1156  {
1157  /* Remove it from the list */
1158  RemoveEntryList(&RxContext->OverflowListEntry);
1159  RxContext->OverflowListEntry.Flink = NULL;
1160 
1161  /* Decrement appropriate count */
1163  {
1165  }
1166  else
1167  {
1169  }
1170 
1171  /* Clear the flag */
1173 
1174  /* Time to cancel! */
1175  OperationToCancel = TRUE;
1176  }
1177  }
1178 
1180 
1181  /* We have something to cancel & complete */
1182  if (OperationToCancel)
1183  {
1185  RxCompleteRequest(RxContext, STATUS_CANCELLED);
1186  }
1187 
1188  return OperationToCancel;
1189 }
#define TRUE
Definition: types.h:120
LONG OverflowQueueCount[RxMaximumWorkQueue]
Definition: rxstruc.h:120
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LIST_ENTRY OverflowListEntry
Definition: rxcontx.h:150
FORCEINLINE BOOLEAN RemoveEntryList(_In_ PLIST_ENTRY Entry)
Definition: rtlfuncs.h:105
UCHAR KIRQL
Definition: env_spec_w32.h:591
RX_SPIN_LOCK OverflowQueueSpinLock
Definition: rxstruc.h:122
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
#define STATUS_CANCELLED
Definition: udferr_usr.h:170
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
NTSTATUS RxCompleteRequest(_In_ PRX_CONTEXT pContext, _In_ NTSTATUS Status)
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
ULONG Flags
Definition: rxcontx.h:124
PRDBSS_DEVICE_OBJECT RxFileSystemDeviceObject
Definition: rdbss.c:573
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
VOID RxRemoveOperationFromBlockingQueue(_Inout_ PRX_CONTEXT RxContext)

Referenced by RxpCancelRoutine().

◆ RxCancelRoutine()

VOID NTAPI RxCancelRoutine ( PDEVICE_OBJECT  DeviceObject,
PIRP  Irp 
)

Definition at line 1196 of file rdbss.c.

1199 {
1200  KIRQL OldIrql;
1202  PRX_CONTEXT RxContext;
1203 
1204  /* Lock our contexts list */
1206 
1207  /* Now, find a context that matches the cancelled IRP */
1209  while (Entry != &RxActiveContexts)
1210  {
1211  RxContext = CONTAINING_RECORD(Entry, RX_CONTEXT, ContextListEntry);
1212  Entry = Entry->Flink;
1213 
1214  /* Found! */
1215  if (RxContext->CurrentIrp == Irp)
1216  {
1217  break;
1218  }
1219  }
1220 
1221  /* If we reached the end of the list, we didn't find any context, so zero the buffer
1222  * If the context is already under cancellation, forget about it too
1223  */
1225  {
1226  RxContext = NULL;
1227  }
1228  else
1229  {
1230  /* Otherwise, reference it and mark it cancelled */
1232  InterlockedIncrement((volatile long *)&RxContext->ReferenceCount);
1233  }
1234 
1235  /* Done with the contexts list */
1237 
1238  /* And done with the cancellation, we'll do it now */
1239  IoReleaseCancelSpinLock(Irp->CancelIrql);
1240 
1241  /* If we have a context to cancel */
1242  if (RxContext != NULL)
1243  {
1244  /* We cannot executed at dispatch, so queue a deferred cancel */
1246  {
1248  }
1249  /* Cancel now! */
1250  else
1251  {
1252  RxpCancelRoutine(RxContext);
1253  }
1254  }
1255 }
#define KeGetCurrentIrql()
Definition: env_spec_w32.h:706
struct _Entry Entry
Definition: kefuncs.h:640
VOID NTAPI RxpCancelRoutine(PVOID Context)
Definition: rdbss.c:7616
_In_ PIRP Irp
Definition: csq.h:116
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LIST_ENTRY RxActiveContexts
Definition: rdbss.c:535
PIRP CurrentIrp
Definition: rxcontx.h:110
UCHAR KIRQL
Definition: env_spec_w32.h:591
RX_SPIN_LOCK RxStrucSupSpinLock
Definition: rxce.c:123
smooth NULL
Definition: ftsmooth.c:416
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define KeAcquireSpinLock(sl, irql)
Definition: env_spec_w32.h:609
NTSTATUS NTAPI RxDispatchToWorkerThread(_In_ PRDBSS_DEVICE_OBJECT pMRxDeviceObject, _In_ WORK_QUEUE_TYPE WorkQueueType, _In_ PRX_WORKERTHREAD_ROUTINE Routine, _In_ PVOID pContext)
_Requires_lock_held_ Interrupt _Releases_lock_ Interrupt _In_ _IRQL_restores_ KIRQL OldIrql
Definition: kefuncs.h:803
Definition: typedefs.h:117
VOID NTAPI IoReleaseCancelSpinLock(IN KIRQL Irql)
Definition: util.c:150
ULONG Flags
Definition: rxcontx.h:124
#define DISPATCH_LEVEL
Definition: env_spec_w32.h:696
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define InterlockedIncrement
Definition: armddk.h:53
PRDBSS_DEVICE_OBJECT RxFileSystemDeviceObject
Definition: rdbss.c:573
#define KeReleaseSpinLock(sl, irql)
Definition: env_spec_w32.h:627
volatile ULONG ReferenceCount
Definition: rxcontx.h:103
base of all file and directory entries
Definition: entries.h:82

Referenced by RxFsdCommonDispatch().

◆ RxCanonicalizeFileNameByServerSpecs()

NTSTATUS RxCanonicalizeFileNameByServerSpecs ( PRX_CONTEXT  RxContext,
PUNICODE_STRING  NetRootName 
)

Definition at line 1261 of file rdbss.c.

1264 {
1265  USHORT NextChar, CurChar;
1266  USHORT MaxChars;
1267 
1268  PAGED_CODE();
1269 
1270  /* Validate file name is not empty */
1271  MaxChars = NetRootName->Length / sizeof(WCHAR);
1272  if (MaxChars == 0)
1273  {
1275  }
1276 
1277  /* Validate name is correct */
1278  for (NextChar = 0, CurChar = 0; CurChar + 1 < MaxChars; NextChar = CurChar + 1)
1279  {
1280  USHORT i;
1281 
1282  for (i = NextChar + 1; i < MaxChars; ++i)
1283  {
1284  if (NetRootName->Buffer[i] == '\\' || NetRootName->Buffer[i] == ':')
1285  {
1286  break;
1287  }
1288  }
1289 
1290  CurChar = i - 1;
1291  if (CurChar == NextChar)
1292  {
1293  if (((NetRootName->Buffer[NextChar] != '\\' && NetRootName->Buffer[NextChar] != ':') || NextChar == (MaxChars - 1)) && NetRootName->Buffer[NextChar] != '.')
1294  {
1295  continue;
1296  }
1297 
1298  if (CurChar != 0)
1299  {
1300  if (CurChar >= MaxChars - 1)
1301  {
1302  continue;
1303  }
1304 
1305  if (NetRootName->Buffer[CurChar + 1] != ':')
1306  {
1308  }
1309  }
1310  else
1311  {
1312  if (NetRootName->Buffer[1] != ':')
1313  {
1315  }
1316  }
1317  }
1318  else
1319  {
1320  if ((CurChar - NextChar) == 1)
1321  {
1322  if (NetRootName->Buffer[NextChar + 2] != '.')
1323  {
1324  continue;
1325  }
1326 
1327  if (NetRootName->Buffer[NextChar] == '\\' || NetRootName->Buffer[NextChar] == ':' || NetRootName->Buffer[NextChar] == '.')
1328  {
1330  }
1331  }
1332  else
1333  {
1334  if ((CurChar - NextChar) != 2 || (NetRootName->Buffer[NextChar] != '\\' && NetRootName->Buffer[NextChar] != ':')
1335  || NetRootName->Buffer[NextChar + 1] != '.')
1336  {
1337  continue;
1338  }
1339 
1340  if (NetRootName->Buffer[NextChar + 2] == '.')
1341  {
1343  }
1344  }
1345  }
1346  }
1347 
1349 }
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define PAGED_CODE()
Definition: video.h:57
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
__wchar_t WCHAR
Definition: xmlstorage.h:180
static TCHAR CurChar
Definition: parser.c:52
unsigned short USHORT
Definition: pedump.c:61
#define STATUS_OBJECT_PATH_SYNTAX_BAD
Definition: ntstatus.h:281

Referenced by RxCanonicalizeNameAndObtainNetRoot().

◆ RxCanonicalizeNameAndObtainNetRoot()

NTSTATUS RxCanonicalizeNameAndObtainNetRoot ( PRX_CONTEXT  RxContext,
PUNICODE_STRING  FileName,
PUNICODE_STRING  NetRootName 
)

Definition at line 1352 of file rdbss.c.

1356 {
1357  NTSTATUS Status;
1358  NET_ROOT_TYPE NetRootType;
1359  UNICODE_STRING CanonicalName;
1360 
1363 
1364  PAGED_CODE();
1365 
1366  NetRootType = NET_ROOT_WILD;
1367 
1368  RtlInitEmptyUnicodeString(NetRootName, NULL, 0);
1369  RtlInitEmptyUnicodeString(&CanonicalName, NULL, 0);
1370 
1371  /* if not relative opening, just handle the passed name */
1372  if (capFileObject->RelatedFileObject == NULL)
1373  {
1374  Status = RxFirstCanonicalize(RxContext, FileName, &CanonicalName, &NetRootType);
1375  if (!NT_SUCCESS(Status))
1376  {
1377  return Status;
1378  }
1379  }
1380  else
1381  {
1382  PFCB Fcb;
1383 
1384  /* Make sure we have a valid FCB and a FOBX */
1385  Fcb = capFileObject->RelatedFileObject->FsContext;
1386  if (Fcb == NULL || capFileObject->RelatedFileObject->FsContext2 == NULL)
1387  {
1388  return STATUS_INVALID_PARAMETER;
1389  }
1390 
1391  if (!NodeTypeIsFcb(Fcb))
1392  {
1393  return STATUS_INVALID_PARAMETER;
1394  }
1395 
1396  UNIMPLEMENTED;
1397  }
1398 
1399  /* Get/Create the associated VNetRoot for opening */
1400  Status = RxFindOrConstructVirtualNetRoot(RxContext, &CanonicalName, NetRootType, NetRootName);
1401  if (!NT_SUCCESS(Status) && Status != STATUS_PENDING &&
1403  {
1404  ASSERT(CanonicalName.Buffer == RxContext->Create.CanonicalNameBuffer);
1405 
1406  RxFreeCanonicalNameBuffer(RxContext);
1407  Status = RxFirstCanonicalize(RxContext, FileName, &CanonicalName, &NetRootType);
1408  if (NT_SUCCESS(Status))
1409  {
1410  Status = RxFindOrConstructVirtualNetRoot(RxContext, &CanonicalName, NetRootType, NetRootName);
1411  }
1412  }
1413 
1414  /* Filename cannot contain wildcards */
1415  if (FsRtlDoesNameContainWildCards(NetRootName))
1416  {
1418  }
1419 
1420  /* Make sure file name is correct */
1421  if (NT_SUCCESS(Status))
1422  {
1423  Status = RxCanonicalizeFileNameByServerSpecs(RxContext, NetRootName);
1424  }
1425 
1426  /* Give the mini-redirector a chance to prepare the name */
1428  {
1429  if (RxContext->Create.pNetRoot != NULL)
1430  {
1431  NTSTATUS IgnoredStatus;
1432 
1433  MINIRDR_CALL(IgnoredStatus, RxContext, RxContext->Create.pNetRoot->pSrvCall->RxDeviceObject->Dispatch,
1434  MRxPreparseName, (RxContext, NetRootName));
1435  (void)IgnoredStatus;
1436  }
1437  }
1438 
1439  return Status;
1440 }
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
struct _RX_CONTEXT::@2089::@2101 Create
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
#define RxCaptureParamBlock
Definition: ntrxdef.h:17
Definition: cdstruc.h:908
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
UCHAR NET_ROOT_TYPE
Definition: mrxfcb.h:36
#define NodeTypeIsFcb(FCB)
Definition: nodetype.h:68
LONG NTSTATUS
Definition: precomp.h:26
BOOLEAN NTAPI FsRtlDoesNameContainWildCards(IN PUNICODE_STRING Name)
Definition: name.c:464
#define PAGED_CODE()
Definition: video.h:57
NTSTATUS RxCanonicalizeFileNameByServerSpecs(PRX_CONTEXT RxContext, PUNICODE_STRING NetRootName)
Definition: rdbss.c:1261
smooth NULL
Definition: ftsmooth.c:416
#define capFileObject
Definition: ntrxdef.h:23
NTSTATUS RxFirstCanonicalize(PRX_CONTEXT RxContext, PUNICODE_STRING FileName, PUNICODE_STRING CanonicalName, PNET_ROOT_TYPE NetRootType)
Definition: rdbss.c:6010
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
NTSTATUS RxFindOrConstructVirtualNetRoot(_In_ PRX_CONTEXT RxContext, _In_ PUNICODE_STRING CanonicalName, _In_ NET_ROOT_TYPE NetRootType, _In_ PUNICODE_STRING RemainingName)
#define MINIRDR_CALL(STATUS, CONTEXT, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:389
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RxCaptureFileObject
Definition: ntrxdef.h:18
Status
Definition: gdiplustypes.h:24
ULONG Flags
Definition: rxcontx.h:124
#define STATUS_OBJECT_NAME_INVALID
Definition: udferr_usr.h:148
#define UNIMPLEMENTED
Definition: debug.h:114
#define NET_ROOT_WILD
Definition: mrxfcb.h:33
_In_ PFCB Fcb
Definition: cdprocs.h:151
VOID RxFreeCanonicalNameBuffer(PRX_CONTEXT Context)
Definition: rdbss.c:6159

Referenced by RxCommonCreate().

◆ RxCheckFcbStructuresForAlignment()

VOID NTAPI RxCheckFcbStructuresForAlignment ( VOID  )

Definition at line 1447 of file rdbss.c.

1449 {
1450  PAGED_CODE();
1451 }
#define PAGED_CODE()
Definition: video.h:57

Referenced by RxDriverEntry().

◆ RxCheckShareAccessPerSrvOpens()

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

Definition at line 1477 of file rdbss.c.

1481 {
1484  BOOLEAN DeleteAccess;
1486 
1487  PAGED_CODE();
1488 
1490 
1491  RxDumpWantedAccess("RxCheckShareAccessPerSrvOpens", "", "RxCheckShareAccessPerSrvOpens", DesiredAccess, DesiredShareAccess);
1492  RxDumpCurrentAccess("RxCheckShareAccessPerSrvOpens", "", "RxCheckShareAccessPerSrvOpens", ShareAccess);
1493 
1494  /* Check if any access wanted */
1497  DeleteAccess = (DesiredAccess & DELETE) != 0;
1498 
1499  if (ReadAccess || WriteAccess || DeleteAccess)
1500  {
1501  BOOLEAN SharedRead = (DesiredShareAccess & FILE_SHARE_READ) != 0;
1502  BOOLEAN SharedWrite = (DesiredShareAccess & FILE_SHARE_WRITE) != 0;
1503  BOOLEAN SharedDelete = (DesiredShareAccess & FILE_SHARE_DELETE) != 0;
1504 
1505  /* Check whether there's a violation */
1506  if ((ReadAccess &&
1507  (ShareAccess->SharedRead < ShareAccess->OpenCount)) ||
1508  (WriteAccess &&
1509  (ShareAccess->SharedWrite < ShareAccess->OpenCount)) ||
1510  (DeleteAccess &&
1511  (ShareAccess->SharedDelete < ShareAccess->OpenCount)) ||
1512  ((ShareAccess->Readers != 0) && !SharedRead) ||
1513  ((ShareAccess->Writers != 0) && !SharedWrite) ||
1514  ((ShareAccess->Deleters != 0) && !SharedDelete))
1515  {
1516  return STATUS_SHARING_VIOLATION;
1517  }
1518  }
1519 
1520  return STATUS_SUCCESS;
1521 }
#define FILE_SHARE_WRITE
Definition: nt_native.h:681
#define FILE_APPEND_DATA
Definition: nt_native.h:634
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
Definition: create.c:4157
#define PAGED_CODE()
Definition: video.h:57
#define FILE_SHARE_READ
Definition: compat.h:125
#define STATUS_SHARING_VIOLATION
Definition: udferr_usr.h:154
#define FILE_READ_DATA
Definition: nt_native.h:628
#define RxDumpWantedAccess(w1, w2, wlt, DA, DSA)
Definition: rxprocs.h:526
unsigned char BOOLEAN
#define FILE_WRITE_DATA
Definition: nt_native.h:631
SHARE_ACCESS ShareAccessPerSrvOpens
Definition: fcb.h:155
_In_ ULONG DesiredShareAccess
Definition: iofuncs.h:779
#define FILE_SHARE_DELETE
Definition: nt_native.h:682
#define FILE_EXECUTE
Definition: nt_native.h:642
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define RxDumpCurrentAccess(w1, w2, wlt, SA)
Definition: rxprocs.h:527
#define DELETE
Definition: nt_native.h:57

Referenced by RxSearchForCollapsibleOpen().

◆ RxCleanupPipeQueues()

VOID RxCleanupPipeQueues ( PRX_CONTEXT  Context)

Definition at line 1524 of file rdbss.c.

1526 {
1527  UNIMPLEMENTED;
1528 }
#define UNIMPLEMENTED
Definition: debug.h:114

Referenced by RxCommonCleanup().

◆ RxCloseAssociatedSrvOpen()

NTSTATUS RxCloseAssociatedSrvOpen ( IN PFOBX  Fobx,
IN PRX_CONTEXT RxContext  OPTIONAL 
)

Definition at line 1534 of file rdbss.c.

1537 {
1538  PFCB Fcb;
1539  NTSTATUS Status;
1540  PSRV_OPEN SrvOpen;
1541  BOOLEAN CloseSrvOpen;
1542  PRX_CONTEXT LocalContext;
1543 
1544  PAGED_CODE();
1545 
1546  /* Assume SRV_OPEN is already closed */
1547  CloseSrvOpen = FALSE;
1548  /* If we have a FOBX, we'll have to close it */
1549  if (Fobx != NULL)
1550  {
1551  /* If the FOBX isn't closed yet */
1552  if (!BooleanFlagOn(Fobx->Flags, FOBX_FLAG_SRVOPEN_CLOSED))
1553  {
1554  SrvOpen = Fobx->SrvOpen;
1555  Fcb = (PFCB)SrvOpen->pFcb;
1556  /* Check whether we've to close SRV_OPEN first */
1557  if (!BooleanFlagOn(SrvOpen->Flags, SRVOPEN_FLAG_CLOSED))
1558  {
1559  CloseSrvOpen = TRUE;
1560  }
1561  else
1562  {
1564 
1565  /* Not much to do */
1566  SetFlag(Fobx->Flags, FOBX_FLAG_SRVOPEN_CLOSED);
1567 
1568  if (SrvOpen->OpenCount > 0)
1569  {
1570  --SrvOpen->OpenCount;
1571  }
1572  }
1573  }
1574 
1575  /* No need to close SRV_OPEN, so close FOBX */
1576  if (!CloseSrvOpen)
1577  {
1578  RxMarkFobxOnClose(Fobx);
1579 
1580  return STATUS_SUCCESS;
1581  }
1582  }
1583  else
1584  {
1585  /* No FOBX? No RX_CONTEXT, ok, job done! */
1586  if (RxContext == NULL)
1587  {
1588  return STATUS_SUCCESS;
1589  }
1590 
1591  /* Get the FCB from RX_CONTEXT */
1592  Fcb = (PFCB)RxContext->pFcb;
1593  SrvOpen = NULL;
1594  }
1595 
1596  /* If we don't have RX_CONTEXT, allocte one, we'll need it */
1597  if (RxContext == NULL)
1598  {
1599  ASSERT(Fobx != NULL);
1600 
1602  if (LocalContext == NULL)
1603  {
1605  }
1606 
1607  LocalContext->MajorFunction = 2;
1608  LocalContext->pFcb = RX_GET_MRX_FCB(Fcb);
1609  LocalContext->pFobx = (PMRX_FOBX)Fobx;
1610  LocalContext->pRelevantSrvOpen = (PMRX_SRV_OPEN)Fobx->SrvOpen;
1611  }
1612  else
1613  {
1614  LocalContext = RxContext;
1615  }
1616 
1618 
1619  /* Now, close the FOBX */
1620  if (Fobx != NULL)
1621  {
1622  RxMarkFobxOnClose(Fobx);
1623  }
1624  else
1625  {
1626  InterlockedDecrement((volatile long *)&Fcb->OpenCount);
1627  }
1628 
1629  /* If not a "standard" file, SRV_OPEN can be null */
1630  if (SrvOpen == NULL)
1631  {
1634 
1635  if (LocalContext != RxContext)
1636  {
1637  RxDereferenceAndDeleteRxContext(LocalContext);
1638  }
1639 
1640  return STATUS_SUCCESS;
1641  }
1642 
1643  /* If SRV_OPEN isn't in a good condition, nothing to close */
1644  if (SrvOpen->Condition != Condition_Good)
1645  {
1646  if (LocalContext != RxContext)
1647  {
1648  RxDereferenceAndDeleteRxContext(LocalContext);
1649  }
1650 
1651  return STATUS_SUCCESS;
1652  }
1653 
1654  /* Decrease open count */
1655  if (SrvOpen->OpenCount > 0)
1656  {
1657  --SrvOpen->OpenCount;
1658  }
1659 
1660  /* If we're the only one left, is there a FOBX handled by Scavenger? */
1661  if (SrvOpen->OpenCount == 1)
1662  {
1663  if (!IsListEmpty(&SrvOpen->FobxList))
1664  {
1665  if (!IsListEmpty(&CONTAINING_RECORD(SrvOpen->FobxList.Flink, FOBX, FobxQLinks)->ScavengerFinalizationList))
1666  {
1667  SetFlag(SrvOpen->Flags, SRVOPEN_FLAG_CLOSE_DELAYED);
1668  }
1669  }
1670  }
1671 
1672  /* Nothing left, purge FCB */
1673  if (SrvOpen->OpenCount == 0 && RxContext == NULL)
1674  {
1675  RxPurgeNetFcb(Fcb, LocalContext);
1676  }
1677 
1678  /* Already closed? Job done! */
1679  SrvOpen = Fobx->SrvOpen;
1680  if (SrvOpen == NULL ||
1681  (SrvOpen->OpenCount != 0 && !BooleanFlagOn(SrvOpen->Flags, SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING)) ||
1682  BooleanFlagOn(SrvOpen->Flags, SRVOPEN_FLAG_CLOSED))
1683  {
1684  SetFlag(Fobx->Flags, FOBX_FLAG_SRVOPEN_CLOSED);
1685  if (LocalContext != RxContext)
1686  {
1687  RxDereferenceAndDeleteRxContext(LocalContext);
1688  }
1689 
1690  return STATUS_SUCCESS;
1691  }
1692 
1694 
1695  /* Inform mini-rdr about closing */
1696  MINIRDR_CALL(Status, LocalContext, Fcb->MRxDispatch, MRxCloseSrvOpen, (LocalContext));
1697  DPRINT("MRxCloseSrvOpen returned: %lx, called with RX_CONTEXT %p for FOBX %p (FCB %p, SRV_OPEN %p)\n ",
1698  Status, RxContext, Fobx, Fcb, SrvOpen);
1699 
1700  /* And mark as such */
1701  SetFlag(SrvOpen->Flags, SRVOPEN_FLAG_CLOSED);
1702  SrvOpen->Key = (PVOID)-1;
1703 
1704  /* If we were delayed, we're not! */
1705  if (BooleanFlagOn(SrvOpen->Flags, SRVOPEN_FLAG_CLOSE_DELAYED))
1706  {
1707  InterlockedDecrement(&((PSRV_CALL)Fcb->pNetRoot->pSrvCall)->NumberOfCloseDelayedFiles);
1708  }
1709 
1710  /* Clear access */
1713 
1714  /* Dereference */
1716 
1717  /* Mark the FOBX closed as well */
1718  SetFlag(Fobx->Flags, FOBX_FLAG_SRVOPEN_CLOSED);
1719 
1720  if (LocalContext != RxContext)
1721  {
1722  RxDereferenceAndDeleteRxContext(LocalContext);
1723  }
1724 
1725  return Status;
1726 }
#define RxDereferenceNetFcb(Fcb)
Definition: fcb.h:435
#define TRUE
Definition: types.h:120
#define RDBSS_NTC_OPENTARGETDIR_FCB
Definition: nodetype.h:44
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
#define FOBX_FLAG_SRVOPEN_CLOSED
Definition: fcb.h:296
#define SRVOPEN_FLAG_CLOSED
Definition: mrxfcb.h:132
Definition: cdstruc.h:908
PMRX_FCB pFcb
Definition: rxcontx.h:112
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LONG NTSTATUS
Definition: precomp.h:26
PMRX_FOBX pFobx
Definition: rxcontx.h:113
struct _MRX_FOBX_ * PMRX_FOBX
Definition: fcb.h:304
VOID RxMarkFobxOnClose(_In_ PFOBX Fobx)
_Must_inspect_result_ FORCEINLINE BOOLEAN IsListEmpty(_In_ const LIST_ENTRY *ListHead)
Definition: rtlfuncs.h:57
#define PAGED_CODE()
Definition: video.h:57
VOID RxPurgeChangeBufferingStateRequestsForSrvOpen(_In_ PSRV_OPEN SrvOpen)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define RX_GET_MRX_FCB(F)
Definition: rxprocs.h:157
UCHAR MajorFunction
Definition: rxcontx.h:105
void * PVOID
Definition: retypes.h:9
NodeType
Definition: Node.h:5
RX_BLOCK_CONDITION Condition
Definition: fcb.h:275
PFLT_MESSAGE_WAITER_QUEUE CONTAINING_RECORD(Csq, DEVICE_EXTENSION, IrpQueue)) -> WaiterQ.mLock) _IRQL_raises_(DISPATCH_LEVEL) VOID NTAPI FltpAcquireMessageWaiterLock(_In_ PIO_CSQ Csq, _Out_ PKIRQL Irql)
Definition: Messaging.c:560
VOID RxPurgeNetFcb(PFCB Fcb, PRX_CONTEXT LocalContext)
Definition: rdbss.c:7995
struct _LIST_ENTRY * Flink
Definition: typedefs.h:119
#define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING
Definition: mrxfcb.h:136
Definition: fcb.h:9
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define RDBSS_NTC_IPC_SHARE
Definition: nodetype.h:45
#define RxDereferenceSrvOpen(SrvOpen, LockHoldingState)
Definition: fcb.h:427
FCB * PFCB
Definition: cdstruc.h:1046
#define MINIRDR_CALL(STATUS, CONTEXT, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:389
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define InterlockedDecrement
Definition: armddk.h:52
PMINIRDR_DISPATCH MRxDispatch
Definition: fcb.h:150
struct _MRX_SRV_OPEN_ * PMRX_SRV_OPEN
Definition: fcb.h:260
#define RxIsFcbAcquiredExclusive(Fcb)
Definition: rxprocs.h:229
PRDBSS_DEVICE_OBJECT RxDeviceObject
Definition: fcb.h:149
Status
Definition: gdiplustypes.h:24
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
#define RDBSS_NTC_MAILSLOT
Definition: nodetype.h:46
CLONG OpenCount
Definition: fatstruc.h:880
LIST_ENTRY FobxList
Definition: fcb.h:279
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:2938
#define RxDereferenceAndDeleteRxContext(RXCONTEXT)
Definition: rxcontx.h:514
PRX_CONTEXT NTAPI RxCreateRxContext(_In_ PIRP Irp, _In_ PRDBSS_DEVICE_OBJECT RxDeviceObject, _In_ ULONG InitialContextFlags)
#define SRVOPEN_FLAG_CLOSE_DELAYED
Definition: mrxfcb.h:133
VOID RxRemoveShareAccessPerSrvOpens(IN OUT PSRV_OPEN SrvOpen)
Definition: rdbss.c:8625
PMRX_SRV_OPEN pRelevantSrvOpen
Definition: rxcontx.h:114

Referenced by RxCommonClose().

◆ RxCollapseOrCreateSrvOpen()

NTSTATUS RxCollapseOrCreateSrvOpen ( PRX_CONTEXT  RxContext)

Definition at line 1732 of file rdbss.c.

1734 {
1735  NTSTATUS Status;
1737  PSRV_OPEN SrvOpen;
1740  RX_BLOCK_CONDITION FcbCondition;
1741 
1742  RxCaptureFcb;
1744 
1745  PAGED_CODE();
1746 
1747  DPRINT("RxCollapseOrCreateSrvOpen(%p)\n", RxContext);
1748 
1750  ++capFcb->UncleanCount;
1751 
1752  DesiredAccess = capPARAMS->Parameters.Create.SecurityContext->DesiredAccess & FILE_ALL_ACCESS;
1753  ShareAccess = capPARAMS->Parameters.Create.ShareAccess & FILE_SHARE_VALID_FLAGS;
1754 
1755  Disposition = RxContext->Create.NtCreateParameters.Disposition;
1756 
1757  /* Try to find a reusable SRV_OPEN */
1759  if (Status == STATUS_NOT_FOUND)
1760  {
1761  /* If none found, create one */
1762  SrvOpen = RxCreateSrvOpen((PV_NET_ROOT)RxContext->Create.pVNetRoot, capFcb);
1763  if (SrvOpen == NULL)
1764  {
1766  }
1767  else
1768  {
1769  SrvOpen->DesiredAccess = DesiredAccess;
1770  SrvOpen->ShareAccess = ShareAccess;
1772  }
1773 
1774  RxContext->pRelevantSrvOpen = (PMRX_SRV_OPEN)SrvOpen;
1775 
1776  if (Status != STATUS_SUCCESS)
1777  {
1778  FcbCondition = Condition_Bad;
1779  }
1780  else
1781  {
1783 
1784  /* Cookie to check the mini-rdr doesn't mess with RX_CONTEXT */
1785  RxContext->CurrentIrp->IoStatus.Information = 0xABCDEF;
1786  /* Inform the mini-rdr we're handling a create */
1787  MINIRDR_CALL(Status, RxContext, capFcb->MRxDispatch, MRxCreate, (RxContext));
1788  ASSERT(RxContext->CurrentIrp->IoStatus.Information == 0xABCDEF);
1789 
1790  DPRINT("MRxCreate returned: %x\n", Status);
1791  if (Status == STATUS_SUCCESS)
1792  {
1793  /* In case of overwrite, reset file size */
1795  {
1796  RxAcquirePagingIoResource(RxContext, capFcb);
1797  capFcb->Header.AllocationSize.QuadPart = 0LL;
1798  capFcb->Header.FileSize.QuadPart = 0LL;
1799  capFcb->Header.ValidDataLength.QuadPart = 0LL;
1800  RxContext->CurrentIrpSp->FileObject->SectionObjectPointer = &capFcb->NonPaged->SectionObjectPointers;
1801  CcSetFileSizes(RxContext->CurrentIrpSp->FileObject, (PCC_FILE_SIZES)&capFcb->Header.AllocationSize);
1802  RxReleasePagingIoResource(RxContext, capFcb);
1803  }
1804  else
1805  {
1806  /* Otherwise, adjust sizes */
1807  RxContext->CurrentIrpSp->FileObject->SectionObjectPointer = &capFcb->NonPaged->SectionObjectPointers;
1808  if (CcIsFileCached(RxContext->CurrentIrpSp->FileObject))
1809  {
1811  }
1812  CcSetFileSizes(RxContext->CurrentIrpSp->FileObject, (PCC_FILE_SIZES)&capFcb->Header.AllocationSize);
1813  }
1814  }
1815 
1816  /* Set the IoStatus with information returned by mini-rdr */
1817  RxContext->CurrentIrp->IoStatus.Information = RxContext->Create.ReturnedCreateInformation;
1818 
1819  SrvOpen->OpenStatus = Status;
1820  /* Set SRV_OPEN state - good or bad - depending on whether create succeed */
1822 
1824 
1826 
1827  if (Status == STATUS_SUCCESS)
1828  {
1829  if (BooleanFlagOn(capPARAMS->Parameters.Create.Options, FILE_DELETE_ON_CLOSE))
1830  {
1832  }
1833  SrvOpen->CreateOptions = RxContext->Create.NtCreateParameters.CreateOptions;
1834  FcbCondition = Condition_Good;
1835  }
1836  else
1837  {
1838  FcbCondition = Condition_Bad;
1840  RxContext->pRelevantSrvOpen = NULL;
1841 
1842  if (RxContext->pFobx != NULL)
1843  {
1845  RxContext->pFobx = NULL;
1846  }
1847  }
1848  }
1849 
1850  /* Set FCB state - good or bad - depending on whether create succeed */
1851  DPRINT("Transitioning FCB %p to condition %lx\n", capFcb, capFcb->Condition);
1852  RxTransitionNetFcb(capFcb, FcbCondition);
1853  }
1854  else if (Status == STATUS_SUCCESS)
1855  {
1856  BOOLEAN IsGood, ExtraOpen;
1857 
1858  /* A reusable SRV_OPEN was found */
1859  RxContext->CurrentIrp->IoStatus.Information = FILE_OPENED;
1860  ExtraOpen = FALSE;
1861 
1862  SrvOpen = (PSRV_OPEN)RxContext->pRelevantSrvOpen;
1863 
1864  IsGood = (SrvOpen->Condition == Condition_Good);
1865  /* If the SRV_OPEN isn't in a stable situation, wait for it to become stable */
1866  if (!StableCondition(SrvOpen->Condition))
1867  {
1868  RxReferenceSrvOpen(SrvOpen);
1869  ++SrvOpen->OpenCount;
1870  ExtraOpen = TRUE;
1871 
1872  RxReleaseFcb(RxContext, capFcb);
1873  RxContext->Create.FcbAcquired = FALSE;
1874 
1875  RxWaitForStableSrvOpen(SrvOpen, RxContext);
1876 
1877  if (NT_SUCCESS(RxAcquireExclusiveFcb(RxContext, capFcb)))
1878  {
1879  RxContext->Create.FcbAcquired = TRUE;
1880  }
1881 
1882  IsGood = (SrvOpen->Condition == Condition_Good);
1883  }
1884 
1885  /* Inform the mini-rdr we do an opening with a reused SRV_OPEN */
1886  if (IsGood)
1887  {
1888  MINIRDR_CALL(Status, RxContext, capFcb->MRxDispatch, MRxCollapseOpen, (RxContext));
1889 
1891  }
1892  else
1893  {
1894  Status = SrvOpen->OpenStatus;
1895  }
1896 
1897  if (ExtraOpen)
1898  {
1899  --SrvOpen->OpenCount;
1901  }
1902  }
1903 
1904  --capFcb->UncleanCount;
1905 
1906  DPRINT("Status: %x\n", Status);
1907  return Status;
1908 }
#define RxAcquirePagingIoResource(RxContext, Fcb)
Definition: rxprocs.h:233
#define RxAcquireExclusiveFcb(R, F)
Definition: rxprocs.h:154
#define TRUE
Definition: types.h:120
#define LL
Definition: tui.h:85
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
struct _RX_CONTEXT::@2089::@2101 Create
#define FILE_ALL_ACCESS
Definition: nt_native.h:651
#define RxCaptureParamBlock
Definition: ntrxdef.h:17
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_OPENED
Definition: nt_native.h:769
PMRX_FOBX pFobx
Definition: rxcontx.h:113
#define FILE_OVERWRITE
Definition: from_kernel.h:57
#define RxAdjustAllocationSizeforCC(Fcb)
Definition: ntrxdef.h:35
#define RxReferenceSrvOpen(SrvOpen)
Definition: fcb.h:423
#define RxCaptureFcb
Definition: ntrxdef.h:10
#define RxDereferenceNetFobx(Fobx, LockHoldingState)
Definition: fcb.h:419
PIRP CurrentIrp
Definition: rxcontx.h:110
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK _In_ USHORT ShareAccess
Definition: create.c:4157
_In_ ACCESS_MASK _In_ POBJECT_ATTRIBUTES _Reserved_ ULONG _In_opt_ PUNICODE_STRING _In_ ULONG _Out_opt_ PULONG Disposition
Definition: cmfuncs.h:50
#define PAGED_CODE()
Definition: video.h:57
#define StableCondition(X)
Definition: mrx.h:81
#define capPARAMS
Definition: ntrxdef.h:22
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
#define CcIsFileCached(FO)
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define FILE_OVERWRITE_IF
Definition: from_kernel.h:58
void DPRINT(...)
Definition: polytest.cpp:61
RX_BLOCK_CONDITION Condition
Definition: fcb.h:275
#define RxTransitionSrvOpen(S, C)
Definition: fcb.h:578
#define FILE_DELETE_ON_CLOSE
Definition: constants.h:494
#define STATUS_NOT_FOUND
Definition: shellext.h:72
NTSTATUS RxSearchForCollapsibleOpen(PRX_CONTEXT RxContext, ACCESS_MASK DesiredAccess, ULONG ShareAccess)
Definition: rdbss.c:8669
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define RxDereferenceSrvOpen(SrvOpen, LockHoldingState)
Definition: fcb.h:427
NTSTATUS OpenStatus
Definition: fcb.h:286
#define RxReleasePagingIoResource(RxContext, Fcb)
Definition: rxprocs.h:268
#define MINIRDR_CALL(STATUS, CONTEXT, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:389
PIO_STACK_LOCATION CurrentIrpSp
Definition: rxcontx.h:111
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
struct _MRX_SRV_OPEN_ * PMRX_SRV_OPEN
VOID RxInitiateSrvOpenKeyAssociation(_Inout_ PSRV_OPEN SrvOpen)
PSRV_OPEN RxCreateSrvOpen(_In_ PV_NET_ROOT VNetRoot, _In_ OUT PFCB Fcb)
Definition: fcb.h:260
#define RxIsFcbAcquiredExclusive(Fcb)
Definition: rxprocs.h:229
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
#define FILE_SHARE_VALID_FLAGS
Definition: nt_native.h:683
Status
Definition: gdiplustypes.h:24
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
#define RxTransitionNetFcb(F, C)
Definition: fcb.h:543
#define RxWaitForStableSrvOpen(S, R)
Definition: fcb.h:577
unsigned short USHORT
Definition: pedump.c:61
VOID NTAPI CcSetFileSizes(IN PFILE_OBJECT FileObject, IN PCC_FILE_SIZES FileSizes)
Definition: fssup.c:354
_In_ PIO_STACK_LOCATION _Inout_ PFILE_OBJECT _Inout_ PVCB _Outptr_result_maybenull_ PDCB _In_ PDCB _In_ PDIRENT _In_ ULONG _In_ ULONG _In_ PUNICODE_STRING _In_ PACCESS_MASK DesiredAccess
Definition: create.c:4157
#define capFcb
Definition: ntrxdef.h:20
struct _SRV_OPEN * PSRV_OPEN
VOID RxCompleteSrvOpenKeyAssociation(_Inout_ PSRV_OPEN SrvOpen)
enum _RX_BLOCK_CONDITION RX_BLOCK_CONDITION
unsigned int ULONG
Definition: retypes.h:1
#define FCB_STATE_COLLAPSING_ENABLED
Definition: fcb.h:221
return STATUS_SUCCESS
Definition: btrfs.c:2938
ULONG ACCESS_MASK
Definition: nt_native.h:40
PMRX_SRV_OPEN pRelevantSrvOpen
Definition: rxcontx.h:114

Referenced by RxCreateFromNetRoot().

◆ RxCommonCleanup()

NTSTATUS NTAPI RxCommonCleanup ( PRX_CONTEXT  Context)

Definition at line 1915 of file rdbss.c.

1917 {
1918 #define BugCheckFileId RDBSS_BUG_CHECK_CLEANUP
1919  PFCB Fcb;
1920  PFOBX Fobx;
1921  ULONG OpenCount;
1922  NTSTATUS Status;
1923  PNET_ROOT NetRoot;
1925  LARGE_INTEGER TruncateSize;
1926  PLARGE_INTEGER TruncateSizePtr;
1927  BOOLEAN NeedPurge, FcbTableAcquired, OneLeft, IsFile, FcbAcquired, LeftForDelete;
1928 
1929  PAGED_CODE();
1930 
1931  Fcb = (PFCB)Context->pFcb;
1932  Fobx = (PFOBX)Context->pFobx;
1933  DPRINT("RxCommonCleanup(%p); FOBX: %p, FCB: %p\n", Context, Fobx, Fcb);
1934 
1935  /* File system closing, it's OK */
1936  if (Fobx == NULL)
1937  {
1938  if (Fcb->UncleanCount > 0)
1939  {
1940  InterlockedDecrement((volatile long *)&Fcb->UncleanCount);
1941  }
1942 
1943  return STATUS_SUCCESS;
1944  }
1945 
1946  /* Check we have a correct FCB type */
1951  {
1952  DPRINT1("Invalid Fcb type for %p\n", Fcb);
1953  RxBugCheck(Fcb->Header.NodeTypeCode, 0, 0);
1954  }
1955 
1956  FileObject = Context->CurrentIrpSp->FileObject;
1958 
1959  RxMarkFobxOnCleanup(Fobx, &NeedPurge);
1960 
1962  if (!NT_SUCCESS(Status))
1963  {
1964  return Status;
1965  }
1966 
1967  FcbAcquired = TRUE;
1968 
1969  Fobx->AssociatedFileObject = NULL;
1970 
1971  /* In case it was already orphaned */
1973  {
1974  ASSERT(Fcb->UncleanCount != 0);
1975  InterlockedDecrement((volatile long *)&Fcb->UncleanCount);
1976 
1978  {
1979  --Fcb->UncachedUncleanCount;
1980  }
1981 
1982  /* Inform mini-rdr */
1983  MINIRDR_CALL(Status, Context, Fcb->MRxDispatch, MRxCleanupFobx, (Context));
1984 
1985  ASSERT(Fobx->SrvOpen->UncleanFobxCount != 0);
1986  --Fobx->SrvOpen->UncleanFobxCount;
1987 
1989 
1991 
1992  return STATUS_SUCCESS;
1993  }
1994 
1995  /* Report the fact that file could be set as delete on close */
1996  if (BooleanFlagOn(Fobx->Flags, FOBX_FLAG_DELETE_ON_CLOSE))
1997  {
1999  }
2000 
2001  /* Cancel any pending notification */
2003 
2004  /* Backup open count before we start playing with it */
2006 
2007  NetRoot = (PNET_ROOT)Fcb->pNetRoot;
2008  FcbTableAcquired = FALSE;
2009  LeftForDelete = FALSE;
2010  OneLeft = (Fcb->UncleanCount == 1);
2011 
2012  _SEH2_TRY
2013  {
2014  /* Unclean count and delete on close? Verify whether we're the one */
2016  {
2018  {
2019  FcbTableAcquired = TRUE;
2020  }
2021  else
2022  {
2024 
2026 
2028  if (Status != STATUS_SUCCESS)
2029  {
2030  RxReleaseFcbTableLock(&NetRoot->FcbTable);
2031  return Status;
2032  }
2033 
2034  FcbTableAcquired = TRUE;
2035  }
2036 
2037  /* That means we'll perform the delete on close! */
2038  if (Fcb->UncleanCount == 1)
2039  {
2040  LeftForDelete = TRUE;
2041  }
2042  else
2043  {
2044  RxReleaseFcbTableLock(&NetRoot->FcbTable);
2045  FcbTableAcquired = FALSE;
2046  }
2047  }
2048 
2049  IsFile = FALSE;
2050  TruncateSizePtr = NULL;
2051  /* Handle cleanup for pipes and printers */
2052  if (NetRoot->Type == NET_ROOT_PIPE || NetRoot->Type == NET_ROOT_PRINT)
2053  {
2055  }
2056  /* Handle cleanup for files */
2057  else if (NetRoot->Type == NET_ROOT_DISK || NetRoot->Type == NET_ROOT_WILD)
2058  {
2059  Context->LowIoContext.Flags |= LOWIO_CONTEXT_FLAG_SAVEUNLOCKS;
2061  {
2062  /* First, unlock */
2064 
2065  /* If there are still locks to release, proceed */
2066  if (Context->LowIoContext.ParamsFor.Locks.LockList != NULL)
2067  {
2069  Context->LowIoContext.ParamsFor.Locks.Flags = 0;
2071  }
2072 
2073  /* Fix times and size */
2075 
2076  /* If we're the only one left... */
2077  if (OneLeft)
2078  {
2079  /* And if we're supposed to delete on close */
2080  if (LeftForDelete)
2081  {
2082  /* Update the sizes */
2084  Fcb->Header.FileSize.QuadPart = 0;
2085  Fcb->Header.ValidDataLength.QuadPart = 0;
2087  }
2088  /* Otherwise, call the mini-rdr to adjust sizes */
2089  else
2090  {
2091  /* File got grown up, fill with zeroes */
2093  (Fcb->Header.ValidDataLength.QuadPart < Fcb->Header.FileSize.QuadPart))
2094  {
2095  MINIRDR_CALL(Status, Context, Fcb->MRxDispatch, MRxZeroExtend, (Context));
2096  Fcb->Header.ValidDataLength.QuadPart = Fcb->Header.FileSize.QuadPart;
2097  }
2098 
2099  /* File was truncated, let mini-rdr proceed */
2101  {
2102  MINIRDR_CALL(Status, Context, Fcb->MRxDispatch, MRxTruncate, (Context));
2104 
2105  /* Keep track of file change for Cc uninit */
2106  TruncateSize.QuadPart = Fcb->Header.FileSize.QuadPart;
2107  TruncateSizePtr = &TruncateSize;
2108  }
2109  }
2110  }
2111 
2112  /* If RxMarkFobxOnCleanup() asked for purge, make sure we're the only one left first */
2113  if (NeedPurge)
2114  {
2115  if (!OneLeft)
2116  {
2117  NeedPurge = FALSE;
2118  }
2119  }
2120  /* Otherwise, try to see whether we can purge */
2121  else
2122  {
2123  NeedPurge = (OneLeft && (LeftForDelete || !BooleanFlagOn(Fcb->FcbState, FCB_STATE_COLLAPSING_ENABLED)));
2124  }
2125 
2126  IsFile = TRUE;
2127  }
2128  }
2129 
2130  /* We have to still be there! */
2131  ASSERT(Fcb->UncleanCount != 0);
2132  InterlockedDecrement((volatile long *)&Fcb->UncleanCount);
2133 
2135  {
2136  --Fcb->UncachedUncleanCount;
2137  }
2138 
2139  /* Inform mini-rdr about ongoing cleanup */
2140  MINIRDR_CALL(Status, Context, Fcb->MRxDispatch, MRxCleanupFobx, (Context));
2141 
2142  ASSERT(Fobx->SrvOpen->UncleanFobxCount != 0);
2143  --Fobx->SrvOpen->UncleanFobxCount;
2144 
2145  /* Flush cache */
2147  {
2148  /* Only if we're the last standing */
2150  Fcb->UncleanCount == Fcb->UncachedUncleanCount)
2151  {
2152  DPRINT("Flushing %p due to last cached handle cleanup\n", Context);
2154  }
2155  }
2156  else
2157  {
2158  /* Always */
2160  {
2161  DPRINT("Flushing %p on cleanup\n", Context);
2163  }
2164  }
2165 
2166  /* If only remaining uncached & unclean, then flush and purge */
2168  {
2169  if (Fcb->UncachedUncleanCount != 0)
2170  {
2171  if (Fcb->UncachedUncleanCount == Fcb->UncleanCount &&
2173  {
2174  DPRINT("Flushing FCB in system cache for %p\n", Context);
2176  }
2177  }
2178  }
2179 
2180  /* If purge required, and not about to delete, flush */
2181  if (!LeftForDelete && NeedPurge)
2182  {
2183  DPRINT("Flushing FCB in system cache for %p\n", Context);
2185  }
2186 
2187  /* If it was a file, drop cache */
2188  if (IsFile)
2189  {
2190  DPRINT("Uninit cache map for file\n");
2191  RxUninitializeCacheMap(Context, FileObject, TruncateSizePtr);
2192  }
2193 
2194  /* If that's the one left for deletion, or if it needs purge, flush */
2195  if (LeftForDelete || NeedPurge)
2196  {
2197  RxPurgeFcbInSystemCache(Fcb, NULL, 0, FALSE, !LeftForDelete);
2198  /* If that's for deletion, also remove from FCB table */
2199  if (LeftForDelete)
2200  {
2202  RxReleaseFcbTableLock(&NetRoot->FcbTable);
2203  FcbTableAcquired = FALSE;
2204  }
2205  }
2206 
2207  /* Remove any share access */
2208  if (OpenCount != 0 && NetRoot->Type == NET_ROOT_DISK)
2209  {
2210  RxRemoveShareAccess(FileObject, &Fcb->ShareAccess, "Cleanup the share access", "ClnUpShr");
2211  }
2212 
2213  /* In case there's caching, on a file, and we were asked to drop collapsing, handle it */
2214  if (NodeType(Fcb) == RDBSS_NTC_STORAGE_TYPE_FILE && BooleanFlagOn(Fobx->Flags, FOBX_FLAG_DISABLE_COLLAPSING) &&
2215  RxWriteCacheingAllowed(Fcb, Fobx->pSrvOpen))
2216  {
2217  NTSTATUS InternalStatus;
2218  PRX_CONTEXT InternalContext;
2219 
2220  /* If we can properly set EOF, there's no need to drop collapsing, try to do it */
2221  InternalStatus = STATUS_UNSUCCESSFUL;
2222  InternalContext = RxCreateRxContext(Context->CurrentIrp,
2225  if (InternalContext != NULL)
2226  {
2228 
2229  InternalStatus = STATUS_SUCCESS;
2230 
2231  /* Initialize the context for file information set */
2232  InternalContext->pFcb = RX_GET_MRX_FCB(Fcb);
2233  InternalContext->pFobx = (PMRX_FOBX)Fobx;
2234  InternalContext->pRelevantSrvOpen = Fobx->pSrvOpen;
2235 
2236  /* Get EOF from the FCB */
2237  FileEOF.EndOfFile.QuadPart = Fcb->Header.FileSize.QuadPart;
2238  InternalContext->Info.FileInformationClass = FileEndOfFileInformation;
2239  InternalContext->Info.Buffer = &FileEOF;
2240  InternalContext->Info.Length = sizeof(FileEOF);
2241 
2242  /* Call the mini-rdr */
2243  MINIRDR_CALL_THROUGH(InternalStatus, Fcb->MRxDispatch, MRxSetFileInfo, (InternalContext));
2244 
2245  /* We're done */
2246  RxDereferenceAndDeleteRxContext(InternalContext);
2247  }
2248 
2249  /* We tried, so, clean the FOBX flag */
2250  ClearFlag(Fobx->Flags, FOBX_FLAG_DISABLE_COLLAPSING);
2251  /* If it failed, then, disable collapsing on the FCB */
2252  if (!NT_SUCCESS(InternalStatus))
2253  {
2255  }
2256  }
2257 
2258  /* We're clean! */
2260 
2261  FcbAcquired = FALSE;
2263  }
2265  {
2266  if (FcbAcquired)
2267  {
2269  }
2270 
2271  if (FcbTableAcquired)
2272  {
2273  RxReleaseFcbTableLock(&NetRoot->FcbTable);
2274  }
2275  }
2276  _SEH2_END;
2277 
2278  return Status;
2279 #undef BugCheckFileId
2280 }
#define RxAcquirePagingIoResource(RxContext, Fcb)
Definition: rxprocs.h:233
ULONG OpenCount
Definition: iotypes.h:493
#define RxAcquireExclusiveFcb(R, F)
Definition: rxprocs.h:154
#define TRUE
Definition: types.h:120
#define RxGetRequestorProcess(RxContext)
Definition: ntrxdef.h:33
struct _FCB::@710::@713 Fcb
VOID RxCancelNotifyChangeDirectoryRequestsForFobx(PFOBX Fobx)
Definition: rdbss.c:963
FSRTL_ADVANCED_FCB_HEADER Header
Definition: cdstruc.h:931
#define LOWIO_CONTEXT_FLAG_SAVEUNLOCKS
Definition: mrx.h:321
Definition: cdstruc.h:908
PMRX_FCB pFcb
Definition: rxcontx.h:112
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
RX_FCB_TABLE FcbTable
Definition: fcb.h:54
VOID RxMarkFobxOnCleanup(_In_ PFOBX pFobx, _Out_ PBOOLEAN NeedPurge)
#define RxBugCheck(A, B, C)
Definition: nodetype.h:86
LONG NTSTATUS
Definition: precomp.h:26
#define FOBX_FLAG_DELETE_ON_CLOSE
Definition: fcb.h:295
PMRX_FOBX pFobx
Definition: rxcontx.h:113
#define FCB_STATE_ORPHANED
Definition: fcb.h:208
Definition: fcb.h:33
struct _MRX_FOBX_ * PMRX_FOBX
PSRV_OPEN SrvOpen
Definition: fcb.h:312
SECTION_OBJECT_POINTERS SectionObjectPointers
Definition: fatstruc.h:728
Definition: fcb.h:304
#define FO_NO_INTERMEDIATE_BUFFERING
Definition: iotypes.h:1735
#define PAGED_CODE()
Definition: video.h:57
_SEH2_TRY
Definition: create.c:4250
struct _RX_CONTEXT::@2087::@2095 Info
NTSTATUS RxFlushFcbInSystemCache(_In_ PFCB Fcb, _In_ BOOLEAN SynchronizeWithLazyWriter)
#define RDBSS_NTC_STORAGE_TYPE_UNKNOWN
Definition: nodetype.h:41
#define FCB_STATE_PAGING_FILE
Definition: fatstruc.h:1194
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
PNON_PAGED_FCB NonPaged
Definition: fatstruc.h:810
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define RX_GET_MRX_FCB(F)
Definition: rxprocs.h:157
NodeType
Definition: Node.h:5
#define FCB_STATE_TRUNCATE_ON_CLOSE
Definition: fatstruc.h:1193
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
SHARE_ACCESS ShareAccess
Definition: cdstruc.h:1015
#define FCB_STATE_DELETE_ON_CLOSE
Definition: fatstruc.h:1192
VOID RxRemoveNameNetFcb(_Out_ PFCB ThisFcb)
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define NET_ROOT_PRINT
Definition: mrxfcb.h:32
FCB * PFCB
Definition: cdstruc.h:1046
NTSTATUS RxPurgeFcbInSystemCache(_In_ PFCB Fcb, _In_ PLARGE_INTEGER FileOffset OPTIONAL, _In_ ULONG Length, _In_ BOOLEAN UninitializeCacheMaps, _In_ BOOLEAN FlushFile)
NTSTATUS RxLowIoLockControlShell(IN PRX_CONTEXT RxContext)
Definition: rdbss.c:7212
#define RxReleasePagingIoResource(RxContext, Fcb)
Definition: rxprocs.h:268
#define MINIRDR_CALL(STATUS, CONTEXT, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:389
* PFILE_OBJECT
Definition: iotypes.h:1955
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define STATUS_UNSUCCESSFUL
Definition: udferr_usr.h:132
union _FCB::@710 Specific
#define InterlockedDecrement
Definition: armddk.h:52
PMINIRDR_DISPATCH MRxDispatch
Definition: fcb.h:150
CLONG UncleanCount
Definition: fatstruc.h:872
#define RDBSS_NTC_STORAGE_TYPE_DIRECTORY
Definition: nodetype.h:42
NTSTATUS NTAPI FsRtlFastUnlockAll(IN PFILE_LOCK FileLock, IN PFILE_OBJECT FileObject, IN PEPROCESS Process, IN PVOID Context OPTIONAL)
Definition: filelock.c:1026
VOID RxAdjustFileTimesAndSize(PRX_CONTEXT RxContext)
Definition: rdbss.c:825
struct _NET_ROOT * PNET_ROOT
#define RxReleaseFcbTableLock(T)
Definition: fcbtable.h:56
ClearFlag(Dirent->Flags, DIRENT_FLAG_NOT_PERSISTENT)
PRDBSS_DEVICE_OBJECT RxDeviceObject
Definition: fcb.h:149
Status
Definition: gdiplustypes.h:24
VOID NTAPI RxInitializeLowIoContext(_Out_ PLOWIO_CONTEXT LowIoContext, _In_ ULONG Operation)
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
_SEH2_END
Definition: create.c:4424
#define RDBSS_NTC_STORAGE_TYPE_FILE
Definition: nodetype.h:43
#define FO_CLEANUP_COMPLETE
Definition: iotypes.h:1747
#define NET_ROOT_PIPE
Definition: mrxfcb.h:31
BOOLEAN DisableFlushOnCleanup
Definition: rdbss.c:533
_SEH2_FINALLY
Definition: create.c:4395
DWORD OpenCount
Definition: legacy.c:25
#define DPRINT1
Definition: precomp.h:8
#define RxRemoveShareAccess(a1, a2, a3, a4)
Definition: rxprocs.h:579
#define NET_ROOT_DISK
Definition: mrxfcb.h:30
unsigned int ULONG
Definition: retypes.h:1
#define MINIRDR_CALL_THROUGH(STATUS, DISPATCH, FUNC, ARGLIST)
Definition: rxcontx.h:375
#define NET_ROOT_WILD
Definition: mrxfcb.h:33
#define RDBSS_NTC_SPOOLFILE
Definition: nodetype.h:47
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FCB_STATE_COLLAPSING_ENABLED
Definition: fcb.h:221
return STATUS_SUCCESS
Definition: btrfs.c:2938
VOID RxUninitializeCacheMap(PRX_CONTEXT RxContext, PFILE_OBJECT FileObject, PLARGE_INTEGER TruncateSize)
Definition: rdbss.c:9404
#define RxDereferenceAndDeleteRxContext(RXCONTEXT)
Definition: rxcontx.h:514
ULONG FcbState
Definition: cdstruc.h:977
#define RxAcquireFcbTableLockExclusive(T, W)
Definition: fcbtable.h:55
PRX_CONTEXT NTAPI RxCreateRxContext(_In_ PIRP Irp, _In_ PRDBSS_DEVICE_OBJECT RxDeviceObject, _In_ ULONG InitialContextFlags)
LONGLONG QuadPart
Definition: typedefs.h:112
PMRX_SRV_OPEN pRelevantSrvOpen
Definition: rxcontx.h:114
VOID RxCleanupPipeQueues(PRX_CONTEXT Context)
Definition: rdbss.c:1524

◆ RxCommonClose()

NTSTATUS NTAPI RxCommonClose ( PRX_CONTEXT  Context)

Definition at line 2284 of file rdbss.c.

2286 {
2287 #define BugCheckFileId RDBSS_BUG_CHECK_CLOSE
2288  PFCB Fcb;
2289  PFOBX Fobx;
2290  NTSTATUS Status;
2292  BOOLEAN DereferenceFobx, AcquiredFcb;
2293 
2294  PAGED_CODE();
2295 
2296  Fcb = (PFCB)Context->pFcb;
2297  Fobx = (PFOBX)Context->pFobx;
2298  FileObject = Context->CurrentIrpSp->FileObject;
2299  DPRINT("RxCommonClose(%p); FOBX: %p, FCB: %p, FO: %p\n", Context, Fobx, Fcb, FileObject);
2300 
2302  if (!NT_SUCCESS(Status))
2303  {
2304  return Status;
2305  }
2306 
2307  AcquiredFcb = TRUE;
2308  _SEH2_TRY
2309  {
2310  BOOLEAN Freed;
2311 
2312  /* Check our FCB type is expected */
2316  {
2317  RxBugCheck(NodeType(Fcb), 0, 0);
2318  }
2319 
2321 
2322  DereferenceFobx = FALSE;
2323  /* If we're not closing FS */
2324  if (Fobx != NULL)
2325  {
2326  PSRV_OPEN SrvOpen;
2327  PSRV_CALL SrvCall;
2328 
2329  SrvOpen = (PSRV_OPEN)Fobx->pSrvOpen;
2330  SrvCall = (PSRV_CALL)Fcb->pNetRoot->pSrvCall;
2331  /* Handle delayed close */
2333  {
2335  {
2337  {
2338  DPRINT("Delay close for FOBX: %p, SrvOpen %p\n", Fobx, SrvOpen);
2339 
2340  if (SrvOpen->OpenCount == 1 && !BooleanFlagOn(SrvOpen->Flags, SRVOPEN_FLAG_COLLAPSING_DISABLED))
2341  {
2342  if (InterlockedIncrement(&SrvCall->NumberOfCloseDelayedFiles) >= SrvCall->MaximumNumberOfCloseDelayedFiles)
2343  {
2345  }
2346  else
2347  {
2348  DereferenceFobx = TRUE;
2349  SetFlag(SrvOpen->Flags, SRVOPEN_FLAG_CLOSE_DELAYED);
2350  }
2351  }
2352  }
2353  }
2354  }
2355 
2356  /* If we reach maximum of delayed close/or if there are no delayed close */
2357  if (!DereferenceFobx)
2358  {
2359  PNET_ROOT NetRoot;
2360 
2361  NetRoot = (PNET_ROOT)Fcb->pNetRoot;
2362  if (NetRoot->Type != NET_ROOT_PRINT)
2363  {
2364  /* Delete if asked */
2365  if (BooleanFlagOn(Fobx->Flags, FOBX_FLAG_DELETE_ON_CLOSE))
2366  {
2369 
2371 
2374  RxReleaseFcbTableLock(&NetRoot->FcbTable);
2375 
2378  }
2379  }
2380  }
2381 
2382  RxMarkFobxOnClose(Fobx);
2383  }
2384 
2385  if (DereferenceFobx)
2386  {
2387  ASSERT(Fobx != NULL);
2389  }
2390  else
2391  {
2393  if (Fobx != NULL)
2394  {
2396  }
2397  }
2398 
2400  AcquiredFcb = !Freed;
2401 
2402  FileObject->FsContext = (PVOID)-1;
2403 
2404  if (Freed)
2405  {
2406  RxTrackerUpdateHistory(Context, NULL, TRACKER_FCB_FREE, __LINE__, __FILE__, 0);
2407  }
2408  else
2409  {
2411  AcquiredFcb = FALSE;
2412  }
2413  }
2415  {
2417  {
2418  if (AcquiredFcb)
2419  {
2421  }
2422  }
2423  else
2424  {
2425  ASSERT(!AcquiredFcb);
2426  }
2427  }
2428  _SEH2_END;
2429 
2430  DPRINT("Status: %x\n", Status);
2431  return Status;
2432 #undef BugCheckFileId
2433 }
#define RxReferenceNetFcb(Fcb)
Definition: fcb.h:431
#define SRVOPEN_FLAG_COLLAPSING_DISABLED
Definition: mrxfcb.h:137
#define RxAcquireExclusiveFcb(R, F)
Definition: rxprocs.h:154
#define TRUE
Definition: types.h:120
#define RDBSS_NTC_OPENTARGETDIR_FCB
Definition: nodetype.h:44
Definition: cdstruc.h:908
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
volatile LONG NumberOfCloseDelayedFiles
Definition: fcb.h:23
RX_FCB_TABLE FcbTable
Definition: fcb.h:54
#define RxBugCheck(A, B, C)
Definition: nodetype.h:86
LONG NTSTATUS
Definition: precomp.h:26
#define FOBX_FLAG_DELETE_ON_CLOSE
Definition: fcb.h:295
#define FCB_STATE_ORPHANED
Definition: fcb.h:208
Definition: fcb.h:33
VOID RxOrphanThisFcb(_In_ PFCB Fcb)
Definition: fcb.h:304
VOID RxMarkFobxOnClose(_In_ PFOBX Fobx)
#define RxDereferenceNetFobx(Fobx, LockHoldingState)
Definition: fcb.h:419
#define PAGED_CODE()
Definition: video.h:57
_SEH2_TRY
Definition: create.c:4250
#define RxTrackerUpdateHistory(R, F, O, L, F, S)
Definition: rxprocs.h:218
#define RDBSS_NTC_STORAGE_TYPE_UNKNOWN
Definition: nodetype.h:41
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
#define _SEH2_AbnormalTermination()
Definition: pseh2_64.h:13
void DPRINT(...)
Definition: polytest.cpp:61
void * PVOID
Definition: retypes.h:9
NodeType
Definition: Node.h:5
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
NTSTATUS RxCloseAssociatedSrvOpen(IN PFOBX Fobx, IN PRX_CONTEXT RxContext OPTIONAL)
Definition: rdbss.c:1534
Definition: fcb.h:9
if(!(yy_init))
Definition: macro.lex.yy.c:714
#define FCB_STATE_DELETE_ON_CLOSE
Definition: fatstruc.h:1192
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define NET_ROOT_PRINT
Definition: mrxfcb.h:32
VOID RxSynchronizeWithScavenger(_In_ PRX_CONTEXT RxContext)
FCB * PFCB
Definition: cdstruc.h:1046
* PFILE_OBJECT
Definition: iotypes.h:1955
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
BOOLEAN RxScavengeRelatedFobxs(_In_ PFCB Fcb)
#define InterlockedDecrement
Definition: armddk.h:52
#define RDBSS_NTC_STORAGE_TYPE_DIRECTORY
Definition: nodetype.h:42
#define RxDereferenceAndFinalizeNetFcb(Fcb, RxContext, RecursiveFinalize, ForceFinalize)
Definition: fcb.h:439
struct _NET_ROOT * PNET_ROOT
Definition: fcb.h:260
#define RxReleaseFcbTableLock(T)
Definition: fcbtable.h:56
Status
Definition: gdiplustypes.h:24
#define SetFlag(_F, _SF)
Definition: ext2fs.h:187
_SEH2_END
Definition: create.c:4424
#define InterlockedIncrement
Definition: armddk.h:53
#define RDBSS_NTC_STORAGE_TYPE_FILE
Definition: nodetype.h:43
_SEH2_FINALLY
Definition: create.c:4395
struct _SRV_OPEN * PSRV_OPEN
#define RDBSS_NTC_SPOOLFILE
Definition: nodetype.h:47
_In_ PFCB Fcb
Definition: cdprocs.h:151
#define FCB_STATE_COLLAPSING_ENABLED
Definition: fcb.h:221
ULONG FcbState
Definition: cdstruc.h:977
#define RxAcquireFcbTableLockExclusive(T, W)
Definition: fcbtable.h:55
#define SRVOPEN_FLAG_CLOSE_DELAYED
Definition: mrxfcb.h:133

◆ RxCommonCreate()

NTSTATUS NTAPI RxCommonCreate ( PRX_CONTEXT  Context)

Definition at line 2440 of file rdbss.c.

2442 {
2443  PIRP Irp;
2444  NTSTATUS Status;
2446  PIO_STACK_LOCATION Stack;
2447 
2448  PAGED_CODE();
2449 
2450  DPRINT("RxCommonCreate(%p)\n", Context);
2451 
2452  Irp = Context->CurrentIrp;
2453  Stack = Context->CurrentIrpSp;
2454  FileObject = Stack->FileObject;
2455 
2456  /* Check whether that's a device opening */
2457  if (FileObject->FileName.Length == 0 && FileObject->RelatedFileObject == NULL)
2458  {
2459  FileObject->FsContext = &RxDeviceFCB;
2460  FileObject->FsContext2 = NULL;
2461 
2462  ++RxDeviceFCB.NodeReferenceCount;
2464 
2465  Irp->IoStatus.Information = FILE_OPENED;
2466  DPRINT("Device opening FO: %p, DO: %p, Name: %wZ\n", FileObject, Context->RxDeviceObject, &Context->RxDeviceObject->DeviceName);
2467 
2469  }
2470  else
2471  {
2472  PFCB RelatedFcb = NULL;
2473 
2474  /* Make sure caller is consistent */
2477  {
2478  DPRINT1("Create.Options: %x\n", Stack->Parameters.Create.Options);
2479  return STATUS_INVALID_PARAMETER;
2480  }
2481 
2482  DPRINT("Ctxt: %p, FO: %p, Options: %lx, Flags: %lx, Attr: %lx, ShareAccess: %lx, DesiredAccess: %lx\n",
2483  Context, FileObject, Stack->Parameters.Create.Options, Stack->Flags, Stack->Parameters.Create.FileAttributes,
2484  Stack->Parameters.Create.ShareAccess, Stack->Parameters.Create.SecurityContext->DesiredAccess);
2485  DPRINT("FileName: %wZ\n", &FileObject->FileName);
2486 
2487  if (FileObject->RelatedFileObject != NULL)
2488  {
2489  RelatedFcb = FileObject->RelatedFileObject->FsContext;
2490  DPRINT("Rel FO: %p, path: %wZ\n", FileObject->RelatedFileObject, RelatedFcb->FcbTableEntry.Path);
2491  }
2492 
2493  /* Going to rename? */
2495  {
2496  DPRINT("TargetDir!\n");
2497  }
2498 
2499  /* Copy create parameters to the context */
2501 
2502  /* If the caller wants to establish a connection, go ahead */
2504  {
2506  }
2507  else
2508  {
2509  /* Validate file name */
2510  if (FileObject->FileName.Length > sizeof(WCHAR) &&
2511  FileObject->FileName.Buffer[1] == OBJ_NAME_PATH_SEPARATOR &&
2512  FileObject->FileName.Buffer[0] == OBJ_NAME_PATH_SEPARATOR)
2513  {
2514  FileObject->FileName.Length -= sizeof(WCHAR);
2515  RtlMoveMemory(&FileObject->FileName.Buffer[0], &FileObject->FileName.Buffer[1],
2516  FileObject->FileName.Length);
2517 
2518  if (FileObject->FileName.Length > sizeof(WCHAR) &&
2519  FileObject->FileName.Buffer[1] == OBJ_NAME_PATH_SEPARATOR &&
2520  FileObject->FileName.Buffer[0] == OBJ_NAME_PATH_SEPARATOR)
2521  {
2523  }
2524  }
2525 
2526  /* Attempt to open the file */
2527  do
2528  {
2529  UNICODE_STRING NetRootName;
2530 
2531  /* Strip last \ if required */
2532  if (FileObject->FileName.Length != 0 &&
2533  FileObject->FileName.Buffer[FileObject->FileName.Length / sizeof(WCHAR) - 1] == OBJ_NAME_PATH_SEPARATOR)
2534  {
2536  {
2538  }
2539 
2540  FileObject->FileName.Length -= sizeof(WCHAR);
2542  }
2543 
2545  {
2546  FileObject->Flags |= FO_WRITE_THROUGH;
2547  }
2548 
2549  /* Get the associated net root to opening */
2550  Status = RxCanonicalizeNameAndObtainNetRoot(Context, &FileObject->FileName, &NetRootName);
2552  {
2553  break;
2554  }
2555 
2556  /* And attempt to open */
2557  Status = RxCreateFromNetRoot(Context, &NetRootName);
2559  {
2561 
2562  /* If that happens for file creation, fail for real */
2563  if (Context->Create.NtCreateParameters.Disposition == FILE_CREATE)
2564  {
2566  }
2567  else
2568  {
2569  /* Otherwise, if possible, attempt to scavenger current FOBX
2570  * to check whether a dormant FOBX is the reason for sharing violation
2571  */
2572  if (Context->Create.TryForScavengingOnSharingViolation &&
2573  !Context->Create.ScavengingAlreadyTried)
2574  {
2575  /* Only doable with a VNetRoot */
2576  if (Context->Create.pVNetRoot != NULL)
2577  {
2578  PV_NET_ROOT VNetRoot;
2579  NT_CREATE_PARAMETERS SavedParameters;
2580 
2581  /* Save create parameters */
2582  RtlCopyMemory(&SavedParameters, &Context->Create.NtCreateParameters, sizeof(NT_CREATE_PARAMETERS));
2583 
2584  /* Reference the VNetRoot for the scavenging time */
2585  VNetRoot = (PV_NET_ROOT)Context->Create.pVNetRoot;
2586  RxReferenceVNetRoot(VNetRoot);
2587 
2588  /* Prepare the RX_CONTEXT for reuse */
2591 
2592  /* Copy what we saved */
2593  RtlCopyMemory(&Context->Create.NtCreateParameters, &SavedParameters, sizeof(NT_CREATE_PARAMETERS));
2594 
2595  /* And recopy what can be */
2597 
2598  /* And start purging, then scavenging FOBX */
2599  RxPurgeRelatedFobxs((PNET_ROOT)VNetRoot->pNetRoot, Context,
2601  RxScavengeFobxsForNetRoot((PNET_ROOT)VNetRoot->pNetRoot,
2602  NULL, TRUE);
2603 
2604  /* Ask for a second round */
2606 
2607  /* Keep track we already scavenged */
2608  Context->Create.ScavengingAlreadyTried = TRUE;
2609 
2610  /* Reference our SRV_CALL for CBS handling */
2611  RxReferenceSrvCall(VNetRoot->pNetRoot->pSrvCall);
2612  RxpProcessChangeBufferingStateRequests((PSRV_CALL)VNetRoot->pNetRoot->pSrvCall, FALSE);
2613 
2614  /* Drop our extra reference */
2616  }
2617  }
2618  }
2619  }
2620  else if (Status == STATUS_REPARSE)
2621  {
2622  Context->CurrentIrp->IoStatus.Information = 0;
2623  }
2624  else
2625  {
2627  }
2628  }
2630  }
2631 
2632  if (Status == STATUS_RETRY)
2633  {
2635  }
2637  }
2638 
2639  DPRINT("Status: %lx\n", Status);
2640  return Status;
2641 }
#define STATUS_OBJECT_NAME_COLLISION
Definition: udferr_usr.h:150
#define TRUE
Definition: types.h:120
NTSYSAPI VOID NTAPI RtlCopyMemory(VOID UNALIGNED *Destination, CONST VOID UNALIGNED *Source, ULONG Length)
VOID RxpPrepareCreateContextForReuse(PRX_CONTEXT RxContext)
Definition: rdbss.c:7654
#define STATUS_MORE_PROCESSING_REQUIRED
Definition: shellext.h:68
_In_ PIRP Irp
Definition: csq.h:116
Definition: cdstruc.h:908
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
#define RxReferenceSrvCall(SrvCall)
Definition: fcb.h:391
#define FILE_DIRECTORY_FILE
Definition: constants.h:491
NTSTATUS RxCreateTreeConnect(IN PRX_CONTEXT RxContext)
Definition: rdbss.c:5409
LONG NTSTATUS
Definition: precomp.h:26
#define FILE_CREATE
Definition: from_kernel.h:55
#define FILE_OPENED
Definition: nt_native.h:769
Definition: fcb.h:33
#define FILE_OPEN_REMOTE_INSTANCE
Definition: from_kernel.h:37
#define PAGED_CODE()
Definition: video.h:57
#define RtlMoveMemory(Destination, Source, Length)
Definition: typedefs.h:263
#define STATUS_SHARING_VIOLATION
Definition: udferr_usr.h:154
#define OBJ_NAME_PATH_SEPARATOR
Definition: arcname_tests.c:25
#define RxReferenceVNetRoot(VNetRoot)
Definition: fcb.h:407
NTSTATUS RxCreateFromNetRoot(PRX_CONTEXT Context, PUNICODE_STRING NetRootName)
Definition: rdbss.c:5114
NTSTATUS RxCanonicalizeNameAndObtainNetRoot(PRX_CONTEXT RxContext, PUNICODE_STRING FileName, PUNICODE_STRING NetRootName)
Definition: rdbss.c:1352
smooth NULL
Definition: ftsmooth.c:416
VOID NTAPI RxReinitializeContext(_Inout_ PRX_CONTEXT RxContext)
RX_FCB_TABLE_ENTRY FcbTableEntry
Definition: fcb.h:144
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS RxPurgeRelatedFobxs(PNET_ROOT NetRoot, PRX_CONTEXT RxContext, BOOLEAN AttemptFinalization, PFCB PurgingFcb)
Definition: rxce.c:7133
VOID RxCopyCreateParameters(IN PRX_CONTEXT RxContext)
Definition: rdbss.c:5039
_Inout_ PFILE_OBJECT FileObject
Definition: cdprocs.h:593
struct _V_NET_ROOT * PV_NET_ROOT
#define RxDereferenceVNetRoot(VNetRoot, LockHoldingState)
Definition: fcb.h:411
Definition: fcb.h:9
__wchar_t WCHAR
Definition: xmlstorage.h:180
#define STATUS_PENDING
Definition: ntstatus.h:82
* PFILE_OBJECT
Definition: iotypes.h:1955
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define FILE_NON_DIRECTORY_FILE
Definition: constants.h:492
VOID RxScavengeFobxsForNetRoot(PNET_ROOT NetRoot, PFCB PurgingFcb, BOOLEAN SynchronizeWithScavenger)
Definition: rxce.c:7798
#define FlagOn(_F, _SF)
Definition: ext2fs.h:179
Status
Definition: gdiplustypes.h:24
FCB RxDeviceFCB
Definition: rdbss.c:538
PFILE_OBJECT FileObject
Definition: iotypes.h:2813
#define SL_OPEN_TARGET_DIRECTORY
Definition: iotypes.h:1775
#define STATUS_OBJECT_NAME_INVALID
Definition: udferr_usr.h:148
#define STATUS_REPARSE
Definition: ntstatus.h:83
CLONG OpenCount
Definition: fatstruc.h:880
#define DPRINT1
Definition: precomp.h:8
#define STATUS_RETRY
Definition: udferr_usr.h:182
#define DONT_ATTEMPT_FINALIZE_ON_PURGE
Definition: scavengr.h:45
#define FILE_CREATE_TREE_CONNECTION
Definition: from_kernel.h:33
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
return STATUS_SUCCESS
Definition: btrfs.c:2938
UNICODE_STRING Path
Definition: fcbtable.h:8
HRESULT Create([out]ITransactionReceiver **ppReceiver)
#define FO_WRITE_THROUGH
Definition: iotypes.h:1736
VOID RxpProcessChangeBufferingStateRequests(PSRV_CALL SrvCall, BOOLEAN UpdateHandlerState)
Definition: rxce.c:6417

◆ RxCommonDevFCBCleanup()

NTSTATUS NTAPI RxCommonDevFCBCleanup ( PRX_CONTEXT  Context)

Definition at line 2648 of file rdbss.c.

2650 {
2651  PMRX_FCB Fcb;
2652  NTSTATUS Status;
2653 
2654  PAGED_CODE();
2655 
2656  DPRINT("RxCommonDevFCBCleanup(%p)\n", Context);
2657 
2658  Fcb = Context->pFcb;
2661 
2662  /* Our FOBX if set, has to be a VNetRoot */
2663  if (Context->pFobx != NULL)
2664  {
2665  RxAcquirePrefixTableLockShared(Context->RxDeviceObject->pRxNetNameTable, TRUE);
2666  if (Context->pFobx->NodeTypeCode != RDBSS_NTC_V_NETROOT)
2667  {
2669  }
2670  RxReleasePrefixTableLock(Context->RxDeviceObject->pRxNetNameTable);
2671  }
2672  else
2673  {
2674  --Fcb->UncleanCount;
2675  }
2676 
2677  return Status;
2678 }
#define TRUE
Definition: types.h:120
LONG NTSTATUS
Definition: precomp.h:26
#define RxReleasePrefixTableLock(T)
Definition: prefix.h:84
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
NodeType
Definition: Node.h:5
#define RDBSS_NTC_V_NETROOT
Definition: nodetype.h:50
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RDBSS_NTC_DEVICE_FCB
Definition: nodetype.h:54
#define RxAcquirePrefixTableLockShared(T, W)
Definition: prefix.h:82
CLONG UncleanCount
Definition: fatstruc.h:872
Status
Definition: gdiplustypes.h:24
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ RxCommonDevFCBClose()

NTSTATUS NTAPI RxCommonDevFCBClose ( PRX_CONTEXT  Context)

Definition at line 2685 of file rdbss.c.

2687 {
2688  PMRX_FCB Fcb;
2689  NTSTATUS Status;
2690  PMRX_V_NET_ROOT NetRoot;
2691 
2692  PAGED_CODE();
2693 
2694  DPRINT("RxCommonDevFCBClose(%p)\n", Context);
2695 
2696  Fcb = Context->pFcb;
2697  NetRoot = (PMRX_V_NET_ROOT)Context->pFobx;
2700 
2701  /* Our FOBX if set, has to be a VNetRoot */
2702  if (NetRoot != NULL)
2703  {
2704  RxAcquirePrefixTableLockExclusive(Context->RxDeviceObject->pRxNetNameTable, TRUE);
2705  if (NetRoot->NodeTypeCode == RDBSS_NTC_V_NETROOT)
2706  {
2707  --NetRoot->NumberOfOpens;
2709  }
2710  else
2711  {
2713  }
2714  RxReleasePrefixTableLock(Context->RxDeviceObject->pRxNetNameTable);
2715  }
2716  else
2717  {
2718  --Fcb->OpenCount;
2719  }
2720 
2721  return Status;
2722 }
#define TRUE
Definition: types.h:120
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
LONG NTSTATUS
Definition: precomp.h:26
#define RxReleasePrefixTableLock(T)
Definition: prefix.h:84
struct _MRX_V_NET_ROOT_ * PMRX_V_NET_ROOT
#define PAGED_CODE()
Definition: video.h:57
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
NodeType
Definition: Node.h:5
#define RxDereferenceVNetRoot(VNetRoot, LockHoldingState)
Definition: fcb.h:411
#define RDBSS_NTC_V_NETROOT
Definition: nodetype.h:50
ASSERT((InvokeOnSuccess||InvokeOnError||InvokeOnCancel) ?(CompletionRoutine !=NULL) :TRUE)
#define RDBSS_NTC_DEVICE_FCB
Definition: nodetype.h:54
ULONG NumberOfOpens
Definition: mrxfcb.h:97
Status
Definition: gdiplustypes.h:24
#define RxAcquirePrefixTableLockExclusive(T, W)
Definition: prefix.h:83
CLONG OpenCount
Definition: fatstruc.h:880
_In_ PFCB Fcb
Definition: cdprocs.h:151
return STATUS_SUCCESS
Definition: btrfs.c:2938

◆ RxCommonDevFCBFsCtl()

NTSTATUS NTAPI RxCommonDevFCBFsCtl ( PRX_CONTEXT  Context)

Definition at line 2726 of file rdbss.c.

2728 {
2729  UNIMPLEMENTED;
2730  return STATUS_NOT_IMPLEMENTED;
2731 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RxCommonDevFCBIoCtl()

NTSTATUS NTAPI RxCommonDevFCBIoCtl ( PRX_CONTEXT  Context)

Definition at line 2738 of file rdbss.c.

2740 {
2741  NTSTATUS Status;
2742 
2743  PAGED_CODE();
2744 
2745  DPRINT("RxCommonDevFCBIoCtl(%p)\n", Context);
2746 
2747  if (Context->pFobx != NULL)
2748  {
2749  return STATUS_INVALID_HANDLE;
2750  }
2751 
2752  /* Is that a prefix claim from MUP? */
2753  if (Context->CurrentIrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_REDIR_QUERY_PATH)
2754  {
2755  return RxPrefixClaim(Context);
2756  }
2757 
2758  /* Otherwise, pass through the mini-rdr */
2760  if (Status != STATUS_PENDING)
2761  {
2762  if (Context->PostRequest)
2763  {
2764  Context->ResumeRoutine = RxCommonDevFCBIoCtl;
2766  }
2767  }
2768 
2769  DPRINT("Status: %lx\n", Status);
2770  return Status;
2771 }
NTSTATUS RxFsdPostRequest(IN PRX_CONTEXT RxContext)
Definition: rdbss.c:6548
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_HANDLE
Definition: ntstatus.h:231
#define PAGED_CODE()
Definition: video.h:57
NTSTATUS RxPrefixClaim(IN PRX_CONTEXT RxContext)
Definition: rdbss.c:7714
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
#define STATUS_PENDING
Definition: ntstatus.h:82
NTSTATUS NTAPI RxCommonDevFCBIoCtl(PRX_CONTEXT Context)
Definition: rdbss.c:2738
Status
Definition: gdiplustypes.h:24
#define IOCTL_REDIR_QUERY_PATH
NTSTATUS RxXXXControlFileCallthru(PRX_CONTEXT Context)
Definition: rdbss.c:9551

◆ RxCommonDevFCBQueryVolInfo()

NTSTATUS NTAPI RxCommonDevFCBQueryVolInfo ( PRX_CONTEXT  Context)

Definition at line 2775 of file rdbss.c.

2777 {
2778  UNIMPLEMENTED;
2779  return STATUS_NOT_IMPLEMENTED;
2780 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RxCommonDeviceControl()

NTSTATUS NTAPI RxCommonDeviceControl ( PRX_CONTEXT  Context)

Definition at line 2787 of file rdbss.c.

2789 {
2790  NTSTATUS Status;
2791 
2792  PAGED_CODE();
2793 
2794  /* Prefix claim is only allowed for device, not files */
2795  if (Context->CurrentIrpSp->Parameters.DeviceIoControl.IoControlCode == IOCTL_REDIR_QUERY_PATH)
2796  {
2798  }
2799 
2800  /* Submit to mini-rdr */
2803  if (Status == STATUS_PENDING)
2804  {
2806  }
2807 
2808  return Status;
2809 }
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define PAGED_CODE()
Definition: video.h:57
#define STATUS_PENDING
Definition: ntstatus.h:82
Status
Definition: gdiplustypes.h:24
VOID NTAPI RxInitializeLowIoContext(_Out_ PLOWIO_CONTEXT LowIoContext, _In_ ULONG Operation)
#define IOCTL_REDIR_QUERY_PATH
NTSTATUS NTAPI RxLowIoIoCtlShellCompletion(PRX_CONTEXT RxContext)
Definition: rdbss.c:7187
VOID NTAPI RxDereferenceAndDeleteRxContext_Real(_In_ PRX_CONTEXT RxContext)
NTSTATUS NTAPI RxLowIoSubmit(_In_ PRX_CONTEXT RxContext, _In_ PLOWIO_COMPLETION_ROUTINE CompletionRoutine)

◆ RxCommonDirectoryControl()

NTSTATUS NTAPI RxCommonDirectoryControl ( PRX_CONTEXT  Context)

Definition at line 2816 of file rdbss.c.

2818 {
2819  PFCB Fcb;
2820  PFOBX Fobx;
2821  NTSTATUS Status;
2822  PIO_STACK_LOCATION Stack;
2823 
2824  PAGED_CODE();
2825 
2826  Fcb = (PFCB)Context->pFcb;
2827  Fobx = (PFOBX)Context->pFobx;
2828  Stack = Context->CurrentIrpSp;
2829  DPRINT("RxCommonDirectoryControl(%p) FOBX: %p, FCB: %p, Minor: %d\n", Context, Fobx, Fcb, Stack->MinorFunction);
2830 
2831  /* Call the appropriate helper */
2832  if (Stack->MinorFunction == IRP_MN_QUERY_DIRECTORY)
2833  {
2835  }
2836  else if (Stack->MinorFunction == IRP_MN_NOTIFY_CHANGE_DIRECTORY)
2837  {
2839  if (Status == STATUS_PENDING)
2840  {
2842  }
2843  }
2844  else
2845  {
2847  }
2848 
2849  return Status;
2850 }
#define IRP_MN_NOTIFY_CHANGE_DIRECTORY
Definition: rdpdr.c:56
Definition: cdstruc.h:908
LONG NTSTATUS
Definition: precomp.h:26
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define IRP_MN_QUERY_DIRECTORY
Definition: rdpdr.c:55
Definition: fcb.h:304
NTSTATUS RxQueryDirectory(PRX_CONTEXT RxContext)
Definition: rdbss.c:8052
#define PAGED_CODE()
Definition: video.h:57
NTSTATUS RxNotifyChangeDirectory(PRX_CONTEXT RxContext)
Definition: rdbss.c:7556
void DPRINT(...)
Definition: polytest.cpp:61
#define STATUS_PENDING
Definition: ntstatus.h:82
FCB * PFCB
Definition: cdstruc.h:1046
Status
Definition: gdiplustypes.h:24
VOID NTAPI RxDereferenceAndDeleteRxContext_Real(_In_ PRX_CONTEXT RxContext)
_In_ PFCB Fcb
Definition: cdprocs.h:151

◆ RxCommonDispatchProblem()

NTSTATUS NTAPI RxCommonDispatchProblem ( PRX_CONTEXT  Context)

Definition at line 2854 of file rdbss.c.

2856 {
2857  UNIMPLEMENTED;
2858  return STATUS_NOT_IMPLEMENTED;
2859 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RxCommonFileSystemControl()

NTSTATUS NTAPI RxCommonFileSystemControl ( PRX_CONTEXT  Context)

Definition at line 2863 of file rdbss.c.

2865 {
2866  PIRP Irp;
2868  PIO_STACK_LOCATION Stack;
2869 
2870  PAGED_CODE();
2871 
2872  Irp = Context->CurrentIrp;
2873  Stack = Context->CurrentIrpSp;
2874  ControlCode = Stack->Parameters.FileSystemControl.FsControlCode;
2875 
2876  DPRINT1("RxCommonFileSystemControl: %p, %p, %d, %lx\n", Context, Irp, Stack->MinorFunction, ControlCode);
2877 
2878  UNIMPLEMENTED;
2879  return STATUS_NOT_IMPLEMENTED;
2880 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
_In_ PIRP Irp
Definition: csq.h:116
#define PAGED_CODE()
Definition: video.h:57
_IRQL_requires_same_ typedef _In_ ULONG ControlCode
Definition: wmitypes.h:55
#define DPRINT1
Definition: precomp.h:8
unsigned int ULONG
Definition: retypes.h:1
#define UNIMPLEMENTED
Definition: debug.h:114
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772

◆ RxCommonFlushBuffers()

NTSTATUS NTAPI RxCommonFlushBuffers ( PRX_CONTEXT  Context)

Definition at line 2884 of file rdbss.c.

2886 {
2887  UNIMPLEMENTED;
2888  return STATUS_NOT_IMPLEMENTED;
2889 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RxCommonLockControl()

NTSTATUS NTAPI RxCommonLockControl ( PRX_CONTEXT  Context)

Definition at line 2893 of file rdbss.c.

2895 {
2896  UNIMPLEMENTED;
2897  return STATUS_NOT_IMPLEMENTED;
2898 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RxCommonQueryEa()

NTSTATUS NTAPI RxCommonQueryEa ( PRX_CONTEXT  Context)

Definition at line 2902 of file rdbss.c.

2904 {
2905  UNIMPLEMENTED;
2906  return STATUS_NOT_IMPLEMENTED;
2907 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RxCommonQueryInformation()

NTSTATUS NTAPI RxCommonQueryInformation ( PRX_CONTEXT  Context)

Definition at line 2914 of file rdbss.c.

2916 {
2917 #define SET_SIZE_AND_QUERY(AlreadyConsummed, Function) \
2918  Context->Info.Length = Stack->Parameters.QueryFile.Length - (AlreadyConsummed); \
2919  Status = Function(Context, Add2Ptr(Buffer, AlreadyConsummed))
2920 
2921  PFCB Fcb;
2922  PIRP Irp;
2923  PFOBX Fobx;
2924  BOOLEAN Locked;
2925  NTSTATUS Status;
2926  PIO_STACK_LOCATION Stack;
2927  FILE_INFORMATION_CLASS FileInfoClass;
2928 
2929  PAGED_CODE();
2930 
2931  Fcb = (PFCB)Context->pFcb;
2932  Fobx = (PFOBX)Context->pFobx;
2933  DPRINT("RxCommonQueryInformation(%p) FCB: %p, FOBX: %p\n", Context, Fcb, Fobx);
2934 
2935  Irp = Context->CurrentIrp;
2936  Stack = Context->CurrentIrpSp;
2937  DPRINT("Buffer: %p, Length: %lx, Class: %ld\n", Irp->AssociatedIrp.SystemBuffer,
2938  Stack->Parameters.QueryFile.Length, Stack->Parameters.QueryFile.FileInformationClass);
2939 
2940  Context->Info.Length = Stack->Parameters.QueryFile.Length;
2941  FileInfoClass = Stack->Parameters.QueryFile.FileInformationClass;
2942 
2943  Locked = FALSE;
2944  _SEH2_TRY
2945  {
2946  PVOID Buffer;
2947 
2948  /* Get a writable buffer */
2950  if (Buffer == NULL)
2951  {
2953  _SEH2_LEAVE;
2954  }
2955  /* Zero it */
2956  RtlZeroMemory(Buffer, Context->Info.Length);
2957 
2958  /* Validate file type */
2960  {
2962  {
2964  _SEH2_LEAVE;
2965  }
2967  {
2969  {
2971  }
2972  else
2973  {
2975  }
2976 
2977  _SEH2_LEAVE;
2978  }
2979  }
2980 
2981  /* Acquire the right lock */
2983  FileInfoClass != FileNameInformation)
2984  {
2985  if (FileInfoClass == FileCompressionInformation)
2986  {
2988  }
2989  else
2990  {
2992  }
2993 
2995  {
2997  _SEH2_LEAVE;
2998  }
2999  else if (!NT_SUCCESS(Status))
3000  {
3001  _SEH2_LEAVE;
3002  }
3003 
3004  Locked = TRUE;
3005  }
3006 
3007  /* Dispatch to the right helper */
3008  switch (FileInfoClass)
3009  {
3010  case FileBasicInformation:
3012  break;
3013 
3016  break;
3017 
3020  break;
3021 
3022  case FileEaInformation:
3024  break;
3025 
3026  case FileNameInformation:
3028  break;
3029 
3030  case FileAllInformation:
3032  if (!NT_SUCCESS(Status))
3033  {
3034  break;
3035  }
3036 
3038  if (!NT_SUCCESS(Status))
3039  {
3040  break;
3041  }
3042 
3045  if (!NT_SUCCESS(Status))
3046  {
3047  break;
3048  }
3049 
3051  sizeof(FILE_STANDARD_INFORMATION) +
3053  if (!NT_SUCCESS(Status))
3054  {
3055  break;
3056  }
3057 
3059  sizeof(FILE_STANDARD_INFORMATION) +
3060  sizeof(FILE_INTERNAL_INFORMATION) +
3062  if (!NT_SUCCESS(Status))
3063  {
3064  break;
3065  }
3066 
3068  sizeof(FILE_STANDARD_INFORMATION) +
3069  sizeof(FILE_INTERNAL_INFORMATION) +
3070  sizeof(FILE_EA_INFORMATION) +
3072  break;
3073 
3076  break;
3077 
3078  case FilePipeInformation:
3082  break;
3083 
3086  break;
3087 
3088  default:
3089  Context->IoStatusBlock.Status = RxpQueryInfoMiniRdr(Context, FileInfoClass, Buffer);
3090  Status = Context->IoStatusBlock.Status;
3091  break;
3092  }
3093 
3094  if (Context->Info.Length < 0)
3095  {
3097  Context->Info.Length = Stack->Parameters.QueryFile.Length;
3098  }
3099 
3100  Irp->IoStatus.Information = Stack->Parameters.QueryFile.Length - Context->Info.Length;
3101  }
3103  {
3104  if (Locked)
3105  {
3107  }
3108  }
3109  _SEH2_END;
3110 
3111  DPRINT("Status: %x\n", Status);
3112  return Status;
3113 
3114 #undef SET_SIZE_AND_QUERY
3115 }
#define RxAcquireExclusiveFcb(R, F)
Definition: rxprocs.h:154
#define TRUE
Definition: types.h:120
#define STATUS_INSUFFICIENT_RESOURCES
Definition: udferr_usr.h:158
NTSTATUS RxQueryPositionInfo(PRX_CONTEXT RxContext, PFILE_POSITION_INFORMATION PositionInfo)
Definition: rdbss.c:8336
NTSTATUS RxQueryEaInfo(PRX_CONTEXT RxContext, PFILE_EA_INFORMATION EaInfo)
Definition: rdbss.c:8265
NTSTATUS RxpQueryInfoMiniRdr(PRX_CONTEXT RxContext, FILE_INFORMATION_CLASS FileInfoClass, PVOID Buffer)
Definition: rdbss.c:7690
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
_In_ PIRP Irp
Definition: csq.h:116
Definition: cdstruc.h:908
#define STATUS_INVALID_PARAMETER
Definition: udferr_usr.h:135
#define BooleanFlagOn(F, SF)
Definition: ext2fs.h:183
LONG NTSTATUS
Definition: precomp.h:26
Definition: fcb.h:304
#define PAGED_CODE()
Definition: video.h:57
_SEH2_TRY
Definition: create.c:4250
NTSTATUS RxQueryBasicInfo(PRX_CONTEXT RxContext, PFILE_BASIC_INFORMATION BasicInfo)
Definition: rdbss.c:8026
NTSTATUS RxQueryInternalInfo(PRX_CONTEXT RxContext, PFILE_INTERNAL_INFORMATION InternalInfo)
Definition: rdbss.c:8274
#define RDBSS_NTC_STORAGE_TYPE_UNKNOWN
Definition: nodetype.h:41
#define FCB_STATE_PAGING_FILE
Definition: fatstruc.h:1194
#define RxReleaseFcb(R, F)
Definition: rxprocs.h:186
_In_ PMEMORY_AREA _In_ PVOID _In_ BOOLEAN Locked
Definition: newmm.h:260
unsigned char BOOLEAN
smooth NULL
Definition: ftsmooth.c:416
void DPRINT(...)
Definition: polytest.cpp:61
Definition: bufpool.h:45
NodeType
Definition: Node.h:5
PVOID RxMapSystemBuffer(_In_ PRX_CONTEXT RxContext)
#define STATUS_LOCK_NOT_GRANTED
Definition: ntstatus.h:307
enum _FILE_INFORMATION_CLASS FILE_INFORMATION_CLASS
Definition: directory.c:44
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define STATUS_PENDING
Definition: ntstatus.h:82
FCB * PFCB
Definition: cdstruc.h:1046
#define SET_SIZE_AND_QUERY(AlreadyConsummed, Function)
#define RDBSS_NTC_STORAGE_TYPE_DIRECTORY
Definition: nodetype.h:42
NTSTATUS RxQueryPipeInfo(PRX_CONTEXT RxContext, PFILE_PIPE_INFORMATION PipeInfo)
Definition: rdbss.c:8327
Status
Definition: gdiplustypes.h:24
NTSTATUS RxQueryAlternateNameInfo(PRX_CONTEXT RxContext, PFILE_NAME_INFORMATION AltNameInfo)
Definition: rdbss.c:8014
_SEH2_END
Definition: create.c:4424
#define RDBSS_NTC_STORAGE_TYPE_FILE
Definition: nodetype.h:43
#define STATUS_BUFFER_OVERFLOW
Definition: shellext.h:66
#define RxAcquireSharedFcb(R, F)
Definition: rxprocs.h:162
#define RDBSS_NTC_MAILSLOT
Definition: nodetype.h:46
_SEH2_FINALLY
Definition: create.c:4395
#define FileStandardInformation
Definition: propsheet.cpp:61
NTSTATUS RxQueryNameInfo(PRX_CONTEXT RxContext, PFILE_NAME_INFORMATION NameInfo)
Definition: rdbss.c:8286
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:261
NTSTATUS RxQueryCompressedInfo(PRX_CONTEXT RxContext, PFILE_COMPRESSION_INFORMATION CompressionInfo)
Definition: rdbss.c:8040
#define _SEH2_LEAVE
Definition: filesup.c:20
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:2772
_In_ PFCB Fcb
Definition: cdprocs.h:151
IN BOOLEAN OUT PSTR Buffer
Definition: progress.h:34
ULONG FcbState
Definition: cdstruc.h:977
NTSTATUS RxQueryStandardInfo(PRX_CONTEXT RxContext, PFILE_STANDARD_INFORMATION StandardInfo)
Definition: rdbss.c:8348

◆ RxCommonQueryQuotaInformation()

NTSTATUS NTAPI RxCommonQueryQuotaInformation ( PRX_CONTEXT  Context)

Definition at line 3119 of file rdbss.c.

3121 {
3122  UNIMPLEMENTED;
3123  return STATUS_NOT_IMPLEMENTED;
3124 }
#define STATUS_NOT_IMPLEMENTED
Definition: ntstatus.h:225
#define UNIMPLEMENTED
Definition: debug.h:114

◆ RxCommonQuerySecurity()

NTSTATUS NTAPI RxCommonQuerySecurity ( PRX_CONTEXT  Context)

Definition at line 3128 of file rdbss.c.

3130 {
3131  UNIMPLEMENTED;
3132  return STATUS_NOT_IMPLEMENTED;
3133 }