1*c2c66affSColin Finck #ifndef __MRXFCB_H__ 2*c2c66affSColin Finck #define __MRXFCB_H__ 3*c2c66affSColin Finck 4*c2c66affSColin Finck typedef struct _MRX_NORMAL_NODE_HEADER 5*c2c66affSColin Finck { 6*c2c66affSColin Finck NODE_TYPE_CODE NodeTypeCode; 7*c2c66affSColin Finck NODE_BYTE_SIZE NodeByteSize; 8*c2c66affSColin Finck volatile ULONG NodeReferenceCount; 9*c2c66affSColin Finck } MRX_NORMAL_NODE_HEADER; 10*c2c66affSColin Finck 11*c2c66affSColin Finck #define SRVCALL_FLAG_CASE_INSENSITIVE_NETROOTS 0x4 12*c2c66affSColin Finck #define SRVCALL_FLAG_CASE_INSENSITIVE_FILENAMES 0x8 13*c2c66affSColin Finck #define SRVCALL_FLAG_DFS_AWARE_SERVER 0x10 14*c2c66affSColin Finck #define SRVCALL_FLAG_FORCE_FINALIZED 0x20 15*c2c66affSColin Finck 16*c2c66affSColin Finck typedef struct _MRX_SRV_CALL_ 17*c2c66affSColin Finck { 18*c2c66affSColin Finck MRX_NORMAL_NODE_HEADER; 19*c2c66affSColin Finck PVOID Context; 20*c2c66affSColin Finck PVOID Context2; 21*c2c66affSColin Finck PRDBSS_DEVICE_OBJECT RxDeviceObject; 22*c2c66affSColin Finck PUNICODE_STRING pSrvCallName; 23*c2c66affSColin Finck PUNICODE_STRING pPrincipalName; 24*c2c66affSColin Finck PUNICODE_STRING pDomainName; 25*c2c66affSColin Finck ULONG Flags; 26*c2c66affSColin Finck LONG MaximumNumberOfCloseDelayedFiles; 27*c2c66affSColin Finck NTSTATUS Status; 28*c2c66affSColin Finck } MRX_SRV_CALL, *PMRX_SRV_CALL; 29*c2c66affSColin Finck 30*c2c66affSColin Finck #define NET_ROOT_DISK ((UCHAR)0) 31*c2c66affSColin Finck #define NET_ROOT_PIPE ((UCHAR)1) 32*c2c66affSColin Finck #define NET_ROOT_PRINT ((UCHAR)3) 33*c2c66affSColin Finck #define NET_ROOT_WILD ((UCHAR)4) 34*c2c66affSColin Finck #define NET_ROOT_MAILSLOT ((UCHAR)5) 35*c2c66affSColin Finck 36*c2c66affSColin Finck typedef UCHAR NET_ROOT_TYPE, *PNET_ROOT_TYPE; 37*c2c66affSColin Finck 38*c2c66affSColin Finck #define MRX_NET_ROOT_STATE_GOOD ((UCHAR)0) 39*c2c66affSColin Finck 40*c2c66affSColin Finck typedef UCHAR MRX_NET_ROOT_STATE, *PMRX_NET_ROOT_STATE; 41*c2c66affSColin Finck typedef UCHAR MRX_PURGE_RELATIONSHIP, *PMRX_PURGE_RELATIONSHIP; 42*c2c66affSColin Finck typedef UCHAR MRX_PURGE_SYNCLOCATION, *PMRX_PURGE_SYNCLOCATION; 43*c2c66affSColin Finck 44*c2c66affSColin Finck #define NETROOT_FLAG_SUPPORTS_SYMBOLIC_LINKS 0x1 45*c2c66affSColin Finck #define NETROOT_FLAG_DFS_AWARE_NETROOT 0x2 46*c2c66affSColin Finck 47*c2c66affSColin Finck typedef struct _NETROOT_THROTTLING_PARAMETERS 48*c2c66affSColin Finck { 49*c2c66affSColin Finck ULONG Increment; 50*c2c66affSColin Finck ULONG MaximumDelay; 51*c2c66affSColin Finck } NETROOT_THROTTLING_PARAMETERS, *PNETROOT_THROTTLING_PARAMETERS; 52*c2c66affSColin Finck 53*c2c66affSColin Finck typedef struct _MRX_NET_ROOT_ 54*c2c66affSColin Finck { 55*c2c66affSColin Finck MRX_NORMAL_NODE_HEADER; 56*c2c66affSColin Finck PMRX_SRV_CALL pSrvCall; 57*c2c66affSColin Finck PVOID Context; 58*c2c66affSColin Finck PVOID Context2; 59*c2c66affSColin Finck ULONG Flags; 60*c2c66affSColin Finck volatile ULONG NumberOfFcbs; 61*c2c66affSColin Finck volatile ULONG NumberOfSrvOpens; 62*c2c66affSColin Finck MRX_NET_ROOT_STATE MRxNetRootState; 63*c2c66affSColin Finck NET_ROOT_TYPE Type; 64*c2c66affSColin Finck MRX_PURGE_RELATIONSHIP PurgeRelationship; 65*c2c66affSColin Finck MRX_PURGE_SYNCLOCATION PurgeSyncLocation; 66*c2c66affSColin Finck DEVICE_TYPE DeviceType; 67*c2c66affSColin Finck PUNICODE_STRING pNetRootName; 68*c2c66affSColin Finck UNICODE_STRING InnerNamePrefix; 69*c2c66affSColin Finck ULONG ParameterValidationStamp; 70*c2c66affSColin Finck union 71*c2c66affSColin Finck { 72*c2c66affSColin Finck struct 73*c2c66affSColin Finck { 74*c2c66affSColin Finck ULONG DataCollectionSize; 75*c2c66affSColin Finck NETROOT_THROTTLING_PARAMETERS PipeReadThrottlingParameters; 76*c2c66affSColin Finck } NamedPipeParameters; 77*c2c66affSColin Finck struct 78*c2c66affSColin Finck { 79*c2c66affSColin Finck ULONG ClusterSize; 80*c2c66affSColin Finck ULONG ReadAheadGranularity; 81*c2c66affSColin Finck NETROOT_THROTTLING_PARAMETERS LockThrottlingParameters; 82*c2c66affSColin Finck ULONG RenameInfoOverallocationSize; 83*c2c66affSColin Finck GUID VolumeId; 84*c2c66affSColin Finck } DiskParameters; 85*c2c66affSColin Finck }; 86*c2c66affSColin Finck } MRX_NET_ROOT, *PMRX_NET_ROOT; 87*c2c66affSColin Finck 88*c2c66affSColin Finck #define VNETROOT_FLAG_CSCAGENT_INSTANCE 0x00000001 89*c2c66affSColin Finck 90*c2c66affSColin Finck typedef struct _MRX_V_NET_ROOT_ 91*c2c66affSColin Finck { 92*c2c66affSColin Finck MRX_NORMAL_NODE_HEADER; 93*c2c66affSColin Finck PMRX_NET_ROOT pNetRoot; 94*c2c66affSColin Finck PVOID Context; 95*c2c66affSColin Finck PVOID Context2; 96*c2c66affSColin Finck ULONG Flags; 97*c2c66affSColin Finck ULONG NumberOfOpens; 98*c2c66affSColin Finck volatile ULONG NumberOfFobxs; 99*c2c66affSColin Finck LUID LogonId; 100*c2c66affSColin Finck PUNICODE_STRING pUserDomainName; 101*c2c66affSColin Finck PUNICODE_STRING pUserName; 102*c2c66affSColin Finck PUNICODE_STRING pPassword; 103*c2c66affSColin Finck ULONG SessionId; 104*c2c66affSColin Finck NTSTATUS ConstructionStatus; 105*c2c66affSColin Finck BOOLEAN IsExplicitConnection; 106*c2c66affSColin Finck } MRX_V_NET_ROOT, *PMRX_V_NET_ROOT; 107*c2c66affSColin Finck 108*c2c66affSColin Finck typedef struct _MRX_FCB_ 109*c2c66affSColin Finck { 110*c2c66affSColin Finck FSRTL_ADVANCED_FCB_HEADER Header; 111*c2c66affSColin Finck PMRX_NET_ROOT pNetRoot; 112*c2c66affSColin Finck PVOID Context; 113*c2c66affSColin Finck PVOID Context2; 114*c2c66affSColin Finck volatile ULONG NodeReferenceCount; 115*c2c66affSColin Finck ULONG FcbState; 116*c2c66affSColin Finck volatile CLONG UncleanCount; 117*c2c66affSColin Finck CLONG UncachedUncleanCount; 118*c2c66affSColin Finck volatile CLONG OpenCount; 119*c2c66affSColin Finck volatile ULONG OutstandingLockOperationsCount; 120*c2c66affSColin Finck ULONGLONG ActualAllocationLength; 121*c2c66affSColin Finck ULONG Attributes; 122*c2c66affSColin Finck BOOLEAN IsFileWritten; 123*c2c66affSColin Finck BOOLEAN fShouldBeOrphaned; 124*c2c66affSColin Finck BOOLEAN fMiniInited; 125*c2c66affSColin Finck UCHAR CachedNetRootType; 126*c2c66affSColin Finck LIST_ENTRY SrvOpenList; 127*c2c66affSColin Finck ULONG SrvOpenListVersion; 128*c2c66affSColin Finck } MRX_FCB, *PMRX_FCB; 129*c2c66affSColin Finck 130*c2c66affSColin Finck #define SRVOPEN_FLAG_DONTUSE_READ_CACHING 0x1 131*c2c66affSColin Finck #define SRVOPEN_FLAG_DONTUSE_WRITE_CACHING 0x2 132*c2c66affSColin Finck #define SRVOPEN_FLAG_CLOSED 0x4 133*c2c66affSColin Finck #define SRVOPEN_FLAG_CLOSE_DELAYED 0x8 134*c2c66affSColin Finck #define SRVOPEN_FLAG_FILE_RENAMED 0x10 135*c2c66affSColin Finck #define SRVOPEN_FLAG_FILE_DELETED 0x20 136*c2c66affSColin Finck #define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_PENDING 0x40 137*c2c66affSColin Finck #define SRVOPEN_FLAG_COLLAPSING_DISABLED 0x80 138*c2c66affSColin Finck #define SRVOPEN_FLAG_BUFFERING_STATE_CHANGE_REQUESTS_PURGED 0x100 139*c2c66affSColin Finck #define SRVOPEN_FLAG_NO_BUFFERING_STATE_CHANGE 0x200 140*c2c66affSColin Finck #define SRVOPEN_FLAG_ORPHANED 0x400 141*c2c66affSColin Finck 142*c2c66affSColin Finck typedef 143*c2c66affSColin Finck NTSTATUS 144*c2c66affSColin Finck (NTAPI *PMRX_SHADOW_CALLDOWN) ( 145*c2c66affSColin Finck IN OUT PRX_CONTEXT RxContext 146*c2c66affSColin Finck ); 147*c2c66affSColin Finck 148*c2c66affSColin Finck typedef struct 149*c2c66affSColin Finck { 150*c2c66affSColin Finck PFILE_OBJECT UnderlyingFileObject; 151*c2c66affSColin Finck PDEVICE_OBJECT UnderlyingDeviceObject; 152*c2c66affSColin Finck ULONG LockKey; 153*c2c66affSColin Finck PFAST_IO_READ FastIoRead; 154*c2c66affSColin Finck PFAST_IO_WRITE FastIoWrite; 155*c2c66affSColin Finck PMRX_SHADOW_CALLDOWN DispatchRoutine; 156*c2c66affSColin Finck } MRXSHADOW_SRV_OPEN, *PMRXSHADOW_SRV_OPEN; 157*c2c66affSColin Finck 158*c2c66affSColin Finck typedef struct _MRX_SRV_OPEN_ 159*c2c66affSColin Finck { 160*c2c66affSColin Finck MRX_NORMAL_NODE_HEADER; 161*c2c66affSColin Finck PMRX_FCB pFcb; 162*c2c66affSColin Finck PMRX_V_NET_ROOT pVNetRoot; 163*c2c66affSColin Finck PVOID Context; 164*c2c66affSColin Finck PVOID Context2; 165*c2c66affSColin Finck #if (_WIN32_WINNT >= 0x0600) 166*c2c66affSColin Finck PMRXSHADOW_SRV_OPEN ShadowContext; 167*c2c66affSColin Finck #endif 168*c2c66affSColin Finck ULONG Flags; 169*c2c66affSColin Finck PUNICODE_STRING pAlreadyPrefixedName; 170*c2c66affSColin Finck CLONG UncleanFobxCount; 171*c2c66affSColin Finck CLONG OpenCount; 172*c2c66affSColin Finck PVOID Key; 173*c2c66affSColin Finck ACCESS_MASK DesiredAccess; 174*c2c66affSColin Finck ULONG ShareAccess; 175*c2c66affSColin Finck ULONG CreateOptions; 176*c2c66affSColin Finck ULONG BufferingFlags; 177*c2c66affSColin Finck ULONG ulFileSizeVersion; 178*c2c66affSColin Finck LIST_ENTRY SrvOpenQLinks; 179*c2c66affSColin Finck } MRX_SRV_OPEN, *PMRX_SRV_OPEN; 180*c2c66affSColin Finck 181*c2c66affSColin Finck #define FOBX_FLAG_DFS_OPEN 0x0001 182*c2c66affSColin Finck #define FOBX_FLAG_BAD_HANDLE 0x0002 183*c2c66affSColin Finck #define FOBX_FLAG_BACKUP_INTENT 0x0004 184*c2c66affSColin Finck 185*c2c66affSColin Finck typedef struct _MRX_PIPE_HANDLE_INFORMATION 186*c2c66affSColin Finck { 187*c2c66affSColin Finck ULONG TypeOfPipe; 188*c2c66affSColin Finck ULONG ReadMode; 189*c2c66affSColin Finck ULONG CompletionMode; 190*c2c66affSColin Finck } MRX_PIPE_HANDLE_INFORMATION, *PMRX_PIPE_HANDLE_INFORMATION; 191*c2c66affSColin Finck 192*c2c66affSColin Finck typedef struct _MRX_FOBX_ 193*c2c66affSColin Finck { 194*c2c66affSColin Finck MRX_NORMAL_NODE_HEADER; 195*c2c66affSColin Finck PMRX_SRV_OPEN pSrvOpen; 196*c2c66affSColin Finck PFILE_OBJECT AssociatedFileObject; 197*c2c66affSColin Finck PVOID Context; 198*c2c66affSColin Finck PVOID Context2; 199*c2c66affSColin Finck ULONG Flags; 200*c2c66affSColin Finck union 201*c2c66affSColin Finck { 202*c2c66affSColin Finck struct 203*c2c66affSColin Finck { 204*c2c66affSColin Finck UNICODE_STRING UnicodeQueryTemplate; 205*c2c66affSColin Finck }; 206*c2c66affSColin Finck PMRX_PIPE_HANDLE_INFORMATION PipeHandleInformation; 207*c2c66affSColin Finck }; 208*c2c66affSColin Finck ULONG OffsetOfNextEaToReturn; 209*c2c66affSColin Finck } MRX_FOBX, *PMRX_FOBX; 210*c2c66affSColin Finck 211*c2c66affSColin Finck NTSTATUS 212*c2c66affSColin Finck NTAPI 213*c2c66affSColin Finck RxAcquireExclusiveFcbResourceInMRx( 214*c2c66affSColin Finck _Inout_ PMRX_FCB Fcb); 215*c2c66affSColin Finck 216*c2c66affSColin Finck #endif 217