Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1562 lines
34 KiB

  1. /*++
  2. Copyright (c) 1989 Microsoft Corporation
  3. Module Name:
  4. RxProcs.h
  5. Abstract:
  6. This module defines all of the globally used procedures in the RDBSS
  7. file system.
  8. Author:
  9. Joe Linn [JoeLinn]
  10. Revision History:
  11. --*/
  12. #ifndef _RDBSSPROCS_
  13. #define _RDBSSPROCS_
  14. #include "rx.h"
  15. #include "backpack.h"
  16. #include "RxTypes.h"
  17. #include "RxLog.h"
  18. #include "RxTrace.h"
  19. #include "RxTimer.h"
  20. #include "RxStruc.h"
  21. extern PVOID RxNull;
  22. //
  23. // The following macro is for all people who compile with the DBG switch
  24. // set, not just rdbss dbg users
  25. //
  26. #if DBG
  27. #define DbgDoit(X) {X;}
  28. #define DebugDoit(X) {X;}
  29. #define DEBUG_ONLY_DECL(X) X
  30. #else
  31. #define DbgDoit(X) {NOTHING;}
  32. #define DebugDoit(X) {NOTHING;}
  33. #define DEBUG_ONLY_DECL(X)
  34. #endif // DBG
  35. //
  36. // utilities
  37. //
  38. //
  39. // Routines for writing error log entries.
  40. //
  41. /*++
  42. RxLogFailure, RxLogFailureWithBuffer can be used to record an event in
  43. the log. The RxLogFailure, RxLogFailureWithBuffer captures the line
  44. number alongwith the supplied information and writes it to the log. This
  45. is useful in debugging. RxLogFailureDirect, RxLogBufferDirect do not
  46. capture the line number
  47. RxlogEvent is useful for writing events into the log.
  48. --*/
  49. #define RxLogFailure( _DeviceObject, _OriginatorId, _EventId, _Status ) \
  50. RxLogEventDirect( _DeviceObject, _OriginatorId, _EventId, _Status, __LINE__ )
  51. #define RxLogFailureWithBuffer( _DeviceObject, _OriginatorId, _EventId, _Status, _Buffer, _Length ) \
  52. RxLogEventWithBufferDirect( _DeviceObject, _OriginatorId, _EventId, _Status, _Buffer, _Length, __LINE__ )
  53. #define RxLogEvent( _DeviceObject, _OriginatorId, _EventId, _Status) \
  54. RxLogEventDirect(_DeviceObject, _OriginatorId, _EventId, _Status, __LINE__)
  55. VOID
  56. RxLogEventDirect (
  57. IN PRDBSS_DEVICE_OBJECT DeviceObject,
  58. IN PUNICODE_STRING OriginatorId,
  59. IN ULONG EventId,
  60. IN NTSTATUS Status,
  61. IN ULONG Line
  62. );
  63. VOID
  64. RxLogEventWithBufferDirect (
  65. IN PVOID DeviceOrDriverObject,
  66. IN PUNICODE_STRING OriginatorId,
  67. IN ULONG EventId,
  68. IN NTSTATUS Status,
  69. IN PVOID DataBuffer,
  70. IN USHORT DataBufferLength,
  71. IN ULONG LineNumber
  72. );
  73. VOID
  74. RxLogEventWithAnnotation (
  75. IN PRDBSS_DEVICE_OBJECT DeviceObject,
  76. IN ULONG EventId,
  77. IN NTSTATUS Status,
  78. IN PVOID DataBuffer,
  79. IN USHORT DataBufferLength,
  80. IN PUNICODE_STRING Annotation,
  81. IN ULONG AnnotationCount
  82. );
  83. BOOLEAN
  84. RxCcLogError (
  85. IN PDEVICE_OBJECT DeviceObject,
  86. IN PUNICODE_STRING FileName,
  87. IN NTSTATUS Error,
  88. IN NTSTATUS DeviceError,
  89. IN UCHAR IrpMajorCode,
  90. IN PVOID Context
  91. );
  92. //
  93. // in create.c
  94. //
  95. NTSTATUS
  96. RxPrefixClaim (
  97. IN PRX_CONTEXT RxContext
  98. );
  99. VOID
  100. RxpPrepareCreateContextForReuse (
  101. PRX_CONTEXT RxContext
  102. );
  103. //
  104. // in devfcb.c
  105. //
  106. LUID
  107. RxGetUid (
  108. IN PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext
  109. );
  110. ULONG
  111. RxGetSessionId (
  112. IN PIO_STACK_LOCATION IrpSp
  113. );
  114. NTSTATUS
  115. RxFindOrCreateConnections (
  116. IN PRX_CONTEXT RxContext,
  117. IN PIRP Irp,
  118. IN PUNICODE_STRING CanonicalName,
  119. IN NET_ROOT_TYPE NetRootType,
  120. IN BOOLEAN TreeConnect,
  121. OUT PUNICODE_STRING LocalNetRootName,
  122. OUT PUNICODE_STRING FilePathName,
  123. IN OUT PLOCK_HOLDING_STATE LockHoldingState,
  124. IN PRX_CONNECTION_ID RxConnectionId
  125. );
  126. NTSTATUS
  127. RxFindOrCreateVNetRoot (
  128. PRX_CONTEXT RxContext,
  129. PUNICODE_STRING CanonicalName,
  130. NET_ROOT_TYPE NetRootType,
  131. PV_NET_ROOT *VirtualNetRootPointer,
  132. PLOCK_HOLDING_STATE *LockHoldingState
  133. );
  134. //
  135. // in fileinfo.c
  136. //
  137. typedef enum _RX_NAME_CONJURING_METHODS {
  138. VNetRoot_As_Prefix,
  139. VNetRoot_As_UNC_Name,
  140. VNetRoot_As_DriveLetter
  141. } RX_NAME_CONJURING_METHODS;
  142. VOID
  143. RxConjureOriginalName (
  144. IN PFCB Fcb,
  145. IN PFOBX Fobx,
  146. OUT PLONG ActualNameLength,
  147. PWCHAR OriginalName,
  148. IN OUT PLONG LengthRemaining,
  149. IN RX_NAME_CONJURING_METHODS NameConjuringMethod
  150. );
  151. //
  152. // A function that returns finished denotes if it was able to complete the
  153. // operation (TRUE) or could not complete the operation (FALSE) because the
  154. // wait value stored in the irp context was false and we would have had
  155. // to block for a resource or I/O
  156. //
  157. //
  158. // Buffer control routines for data caching, implemented in CacheSup.c
  159. //
  160. BOOLEAN
  161. RxZeroData (
  162. IN PRX_CONTEXT RxContext,
  163. IN PVCB Vcb,
  164. IN PFILE_OBJECT FileObject,
  165. IN ULONG StartingZero,
  166. IN ULONG ByteCount
  167. );
  168. NTSTATUS
  169. RxCompleteMdl (
  170. IN PRX_CONTEXT RxContext,
  171. IN PIRP Irp
  172. );
  173. VOID
  174. RxSyncUninitializeCacheMap (
  175. IN PRX_CONTEXT RxContext,
  176. IN PFILE_OBJECT FileObject
  177. );
  178. VOID
  179. RxLockUserBuffer (
  180. IN PRX_CONTEXT RxContext,
  181. IN PIRP Irp,
  182. IN LOCK_OPERATION Operation,
  183. IN ULONG BufferLength
  184. );
  185. PVOID
  186. RxMapSystemBuffer (
  187. IN PRX_CONTEXT RxContext,
  188. IN PIRP Irp
  189. );
  190. PVOID
  191. RxMapUserBuffer (
  192. IN PRX_CONTEXT RxContext,
  193. IN PIRP Irp
  194. );
  195. #define RxUpcaseEaName(RXCONTEXT,NAME,UPCASEDNAME) \
  196. RtlUpperString( UPCASEDNAME, NAME )
  197. #ifdef RDBSS_TRACKER
  198. #define RX_FCBTRACKER_PARAMS ,ULONG LineNumber,PSZ FileName,ULONG SerialNumber
  199. #else
  200. #define RX_FCBTRACKER_PARAMS
  201. #endif
  202. #define FCB_MODE_EXCLUSIVE (1)
  203. #define FCB_MODE_SHARED (2)
  204. #define FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE (3)
  205. #define FCB_MODE_SHARED_STARVE_EXCLUSIVE (4)
  206. #define CHANGE_BUFFERING_STATE_CONTEXT ((PRX_CONTEXT)IntToPtr(0xffffffff))
  207. #define CHANGE_BUFFERING_STATE_CONTEXT_WAIT ((PRX_CONTEXT)IntToPtr(0xfffffffe))
  208. //
  209. // NOTE: even though the following routine pass a serial number, this parameter is not used
  210. //
  211. #ifdef RDBSS_TRACKER
  212. NTSTATUS
  213. __RxAcquireFcb(
  214. IN OUT PFCB Fcb,
  215. IN OUT PRX_CONTEXT RxContext,
  216. IN ULONG Mode,
  217. ULONG LineNumber,
  218. PSZ FileName,
  219. ULONG SerialNumber
  220. );
  221. #else
  222. NTSTATUS
  223. __RxAcquireFcb(
  224. IN OUT PFCB Fcb,
  225. IN OUT PRX_CONTEXT RxContext,
  226. IN ULONG Mode
  227. );
  228. #endif
  229. #ifdef RDBSS_TRACKER
  230. #define RxAcquireExclusiveFcb(RXCONTEXT,FCB) \
  231. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_EXCLUSIVE,__LINE__,__FILE__,0)
  232. #else
  233. #define RxAcquireExclusiveFcb(RXCONTEXT,FCB) \
  234. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_EXCLUSIVE)
  235. #endif
  236. #define RX_GET_MRX_FCB(FCB) ((PMRX_FCB)((FCB)))
  237. #ifdef RDBSS_TRACKER
  238. #define RxAcquireSharedFcb(RXCONTEXT,FCB) \
  239. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED,__LINE__,__FILE__,0)
  240. #else
  241. #define RxAcquireSharedFcb(RXCONTEXT,FCB) \
  242. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED)
  243. #endif
  244. #ifdef RDBSS_TRACKER
  245. #define RxAcquireSharedFcbWaitForEx(RXCONTEXT,FCB) \
  246. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE,__LINE__,__FILE__,0)
  247. #else
  248. #define RxAcquireSharedFcbWaitForEx(RXCONTEXT,FCB) \
  249. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE)
  250. #endif
  251. #ifdef RDBSS_TRACKER
  252. #define RxAcquireSharedFcbStarveEx(RXCONTEXT,FCB) \
  253. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_STARVE_EXCLUSIVE,__LINE__,__FILE__,0)
  254. #else
  255. #define RxAcquireSharedFcbStarveEx(RXCONTEXT,FCB) \
  256. __RxAcquireFcb((FCB),(RXCONTEXT),FCB_MODE_SHARED_STARVE_EXCLUSIVE)
  257. #endif
  258. #ifdef RDBSS_TRACKER
  259. VOID
  260. __RxReleaseFcb(
  261. IN PRX_CONTEXT RxContext,
  262. IN PMRX_FCB Fcb,
  263. ULONG LineNumber,
  264. PSZ FileName,
  265. ULONG SerialNumber
  266. );
  267. #else
  268. VOID
  269. __RxReleaseFcb(
  270. IN PRX_CONTEXT pRxContext,
  271. IN PMRX_FCB pFcb
  272. );
  273. #endif
  274. #ifdef RDBSS_TRACKER
  275. #define RxReleaseFcb(RXCONTEXT,FCB) \
  276. __RxReleaseFcb((RXCONTEXT),RX_GET_MRX_FCB(FCB),__LINE__,__FILE__,0)
  277. #else
  278. #define RxReleaseFcb(RXCONTEXT,FCB) \
  279. __RxReleaseFcb((RXCONTEXT),RX_GET_MRX_FCB(FCB))
  280. #endif
  281. #ifdef RDBSS_TRACKER
  282. VOID
  283. __RxReleaseFcbForThread(
  284. IN PRX_CONTEXT RxContext,
  285. IN PMRX_FCB Fcb,
  286. IN ERESOURCE_THREAD ResourceThreadId,
  287. ULONG LineNumber,
  288. PSZ FileName,
  289. ULONG SerialNumber
  290. );
  291. #else
  292. VOID
  293. __RxReleaseFcbForThread(
  294. IN PRX_CONTEXT RxContext,
  295. IN PMRX_FCB Fcb,
  296. IN ERESOURCE_THREAD ResourceThreadId
  297. );
  298. #endif
  299. #ifdef RDBSS_TRACKER
  300. #define RxReleaseFcbForThread(RXCONTEXT,FCB,THREAD) \
  301. __RxReleaseFcbForThread((RXCONTEXT),RX_GET_MRX_FCB(FCB),(THREAD),__LINE__,__FILE__,0)
  302. #else
  303. #define RxReleaseFcbForThread(RXCONTEXT,FCB,THREAD) \
  304. __RxReleaseFcbForThread((RXCONTEXT),RX_GET_MRX_FCB(FCB),(THREAD))
  305. #endif
  306. #ifdef RDBSS_TRACKER
  307. VOID RxTrackerUpdateHistory(
  308. PRX_CONTEXT pRxContext,
  309. PMRX_FCB pFcb,
  310. ULONG Operation,
  311. ULONG LineNumber,
  312. PSZ FileName,
  313. ULONG SerialNumber
  314. );
  315. #else
  316. #define RxTrackerUpdateHistory(xRXCONTEXT,xFCB,xOPERATION,xLINENUM,xFILENAME,xSERIALNUMBER) {NOTHING;}
  317. #endif
  318. VOID RxTrackPagingIoResource(
  319. PVOID Instance,
  320. ULONG Type,
  321. ULONG Line,
  322. PCHAR File
  323. );
  324. //
  325. // this definition is old......i don't like the format
  326. //
  327. #define RxFcbAcquiredShared( RXCONTEXT, FCB ) ( \
  328. ExIsResourceAcquiredSharedLite( (FCB)->Header.Resource ) \
  329. )
  330. #define RxIsFcbAcquiredShared( FCB ) ( \
  331. ExIsResourceAcquiredSharedLite( (FCB)->Header.Resource ) \
  332. )
  333. #define RxIsFcbAcquiredExclusive( FCB ) ( \
  334. ExIsResourceAcquiredExclusiveLite( (FCB)->Header.Resource ) \
  335. )
  336. #define RxIsFcbAcquired( FCB) ( \
  337. ExIsResourceAcquiredSharedLite( (FCB)->Header.Resource ) | \
  338. ExIsResourceAcquiredExclusiveLite( (FCB)->Header.Resource ) \
  339. )
  340. #define RxAcquirePagingIoResource( RXCONTEXT, FCB ) \
  341. ExAcquireResourceExclusiveLite( (FCB)->Header.PagingIoResource, TRUE ); \
  342. if (RXCONTEXT) { \
  343. ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = TRUE; \
  344. } \
  345. RxTrackPagingIoResource( FCB, 1, __LINE__, __FILE__ ) \
  346. #define RxAcquirePagingIoResourceShared( RXCONTEXT, FCB, FLAG ) \
  347. ExAcquireResourceSharedLite( (FCB)->Header.PagingIoResource, FLAG ); \
  348. if (AcquiredFile) { \
  349. if (RXCONTEXT) { \
  350. ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = TRUE; \
  351. } \
  352. RxTrackPagingIoResource( FCB, 2, __LINE__, __FILE__ ); \
  353. }
  354. #define RxReleasePagingIoResource( RXCONTEXT, FCB ) \
  355. RxTrackPagingIoResource( FCB, 3, __LINE__, __FILE__ ); \
  356. if (RXCONTEXT) { \
  357. ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = FALSE; \
  358. } \
  359. ExReleaseResourceLite( (FCB)->Header.PagingIoResource )
  360. #define RxReleasePagingIoResourceForThread( RXCONTEXT, FCB, THREAD ) \
  361. RxTrackPagingIoResource( FCB, 3, __LINE__, __FILE__ ); \
  362. if (RXCONTEXT) { \
  363. ((PRX_CONTEXT)RXCONTEXT)->FcbPagingIoResourceAcquired = FALSE; \
  364. } \
  365. ExReleaseResourceForThreadLite( (FCB)->Header.PagingIoResource, (THREAD) )
  366. // The following are cache manager call backs
  367. BOOLEAN
  368. RxAcquireFcbForLazyWrite (
  369. IN PVOID Null,
  370. IN BOOLEAN Wait
  371. );
  372. VOID
  373. RxReleaseFcbFromLazyWrite (
  374. IN PVOID Null
  375. );
  376. BOOLEAN
  377. RxAcquireFcbForReadAhead (
  378. IN PVOID Null,
  379. IN BOOLEAN Wait
  380. );
  381. VOID
  382. RxReleaseFcbFromReadAhead (
  383. IN PVOID Null
  384. );
  385. BOOLEAN
  386. RxNoOpAcquire (
  387. IN PVOID Fcb,
  388. IN BOOLEAN Wait
  389. );
  390. VOID
  391. RxNoOpRelease (
  392. IN PVOID Fcb
  393. );
  394. NTSTATUS
  395. RxAcquireForCcFlush (
  396. IN PFILE_OBJECT FileObject,
  397. IN PDEVICE_OBJECT DeviceObject
  398. );
  399. NTSTATUS
  400. RxReleaseForCcFlush (
  401. IN PFILE_OBJECT FileObject,
  402. IN PDEVICE_OBJECT DeviceObject
  403. );
  404. //
  405. // VOID
  406. // RxConvertToSharedFcb (
  407. // IN PRX_CONTEXT RxContext,
  408. // IN PFCB Fcb
  409. // );
  410. //
  411. #define RxConvertToSharedFcb(RXCONTEXT,FCB) { \
  412. ExConvertExclusiveToSharedLite( RX_GET_MRX_FCB(FCB)->Header.Resource ); \
  413. }
  414. VOID
  415. RxVerifyOperationIsLegal (
  416. IN PRX_CONTEXT RxContext
  417. );
  418. //
  419. // Work queue routines for posting and retrieving an Irp, implemented in
  420. // workque.c
  421. //
  422. VOID
  423. RxPrePostIrp (
  424. IN PVOID Context,
  425. IN PIRP Irp
  426. );
  427. VOID
  428. RxAddToWorkque (
  429. IN PRX_CONTEXT RxContext,
  430. IN PIRP Irp
  431. );
  432. NTSTATUS
  433. RxFsdPostRequest (
  434. IN PRX_CONTEXT RxContext
  435. );
  436. #define RxFsdPostRequestWithResume(RXCONTEXT,RESUMEROUTINE) \
  437. (((RXCONTEXT)->ResumeRoutine = (RESUMEROUTINE)), \
  438. RxFsdPostRequest( (RXCONTEXT) ) \
  439. )
  440. VOID
  441. RxInitializeMRxCalldownContext (
  442. PMRX_CALLDOWN_CONTEXT Context,
  443. PRDBSS_DEVICE_OBJECT MRxDeviceObject,
  444. PMRX_CALLDOWN_ROUTINE Routine,
  445. PVOID Parameter
  446. );
  447. NTSTATUS
  448. RxCalldownMiniRedirectors (
  449. LONG NumberOfMiniRdrs,
  450. PMRX_CALLDOWN_CONTEXT CalldownContext,
  451. BOOLEAN PostCalldowns
  452. );
  453. //
  454. // This macro takes a ulong and returns its rounded up word value
  455. //
  456. #define WordAlign(Val) ( \
  457. ALIGN_UP( Val, WORD ) \
  458. )
  459. //
  460. // This macro takes a pointer and returns a ULONG_PTR representation of
  461. // its rounded up word value
  462. //
  463. #define WordAlignPtr(Ptr) ( \
  464. ALIGN_UP_POINTER( Ptr, WORD ) \
  465. )
  466. //
  467. // This macro takes a ulong and returns its rounded up longword value
  468. //
  469. #define LongAlign(Val) ( \
  470. ALIGN_UP( Val, LONG ) \
  471. )
  472. //
  473. // This macro takes a pointer and returns a ULONG_PTR representation of
  474. // its rounded up word value
  475. //
  476. #define LongAlignPtr(Ptr) ( \
  477. ALIGN_UP_POINTER( Ptr, LONG ) \
  478. )
  479. //
  480. // This macro takes a ulong and returns its rounded up quadword
  481. // value
  482. //
  483. #define QuadAlign(Val) ( \
  484. ALIGN_UP( Val, ULONGLONG ) \
  485. )
  486. //
  487. // This macro takes a pointer and returns a ULONG_PTR representation of
  488. // its rounded up quadword value
  489. //
  490. #define QuadAlignPtr(Ptr) ( \
  491. ALIGN_UP_POINTER( Ptr, ULONGLONG ) \
  492. )
  493. //
  494. // This macro takes a pointer and returns whether it's quadword-aligned
  495. //
  496. #define IsPtrQuadAligned(Ptr) ( \
  497. QuadAlignPtr(Ptr) == (PVOID)(Ptr) \
  498. )
  499. //
  500. // The following types and macros are used to help unpack the packed and
  501. // misaligned fields found in the Bios parameter block
  502. //
  503. typedef union _UCHAR1 {
  504. UCHAR Uchar[1];
  505. UCHAR ForceAlignment;
  506. } UCHAR1, *PUCHAR1;
  507. typedef union _UCHAR2 {
  508. UCHAR Uchar[2];
  509. USHORT ForceAlignment;
  510. } UCHAR2, *PUCHAR2;
  511. typedef union _UCHAR4 {
  512. UCHAR Uchar[4];
  513. ULONG ForceAlignment;
  514. } UCHAR4, *PUCHAR4;
  515. //
  516. // This macro copies an unaligned src byte to an aligned dst byte
  517. //
  518. #define CopyUchar1(Dst,Src) { \
  519. *((UCHAR1 *)(Dst)) = *((UNALIGNED UCHAR1 *)(Src)); \
  520. }
  521. //
  522. // This macro copies an unaligned src word to an aligned dst word
  523. //
  524. #define CopyUchar2(Dst,Src) { \
  525. *((UCHAR2 *)(Dst)) = *((UNALIGNED UCHAR2 *)(Src)); \
  526. }
  527. //
  528. // This macro copies an unaligned src longword to an aligned dsr longword
  529. //
  530. #define CopyUchar4(Dst,Src) { \
  531. *((UCHAR4 *)(Dst)) = *((UNALIGNED UCHAR4 *)(Src)); \
  532. }
  533. #define CopyU4char(Dst,Src) { \
  534. *((UNALIGNED UCHAR4 *)(Dst)) = *((UCHAR4 *)(Src)); \
  535. }
  536. //
  537. // the wrapper doesn't yet implement notify and oplock. rather than remove the code
  538. // we define the calls in such a way as to Noop the effects so that we'll have a head
  539. // start on putting it back later...
  540. //
  541. /* this is a macro definition we'll reenable when we implement oplocks and notifies
  542. //
  543. // VOID
  544. // RxNotifyReportChange (
  545. // IN PRX_CONTEXT RxContext,
  546. // IN PVCB Vcb,
  547. // IN PFCB Fcb,
  548. // IN ULONG Filter,
  549. // IN ULONG Action
  550. // );
  551. //
  552. #define RxNotifyReportChange(I,V,F,FL,A) { \
  553. if ((F)->FullFileName.Buffer == NULL) { \
  554. RxSetFullFileNameInFcb((I),(F)); \
  555. } \
  556. FsRtlNotifyFullReportChange( (V)->NotifySync, \
  557. &(V)->DirNotifyList, \
  558. (PSTRING)&(F)->FullFileName, \
  559. (USHORT) ((F)->FullFileName.Length - \
  560. (F)->FinalNameLength), \
  561. (PSTRING)NULL, \
  562. (PSTRING)NULL, \
  563. (ULONG)FL, \
  564. (ULONG)A, \
  565. (PVOID)NULL ); \
  566. }
  567. */
  568. #define RxNotifyReportChange(I,V,F,FL,A) \
  569. RxDbgTrace(0, Dbg, ("RxNotifyReportChange PRETENDING Fcb %08lx %wZ Filter/Action = %08lx/%08lx\n", \
  570. (F),&((F)->FcbTableEntry.Path),(FL),(A)))
  571. #if 0
  572. #define FsRtlNotifyFullChangeDirectory(A1,A2,A3,A4,A5,A6,A7,A8,A9,A10) \
  573. RxDbgTrace(0, Dbg, ("FsRtlNotifyFullReportChange PRETENDING ............\n",0))
  574. #endif
  575. #define FsRtlCheckOplock(A1,A2,A3,A4,A5) \
  576. (STATUS_SUCCESS)
  577. #define FsRtlOplockIsFastIoPossible(__a) (TRUE)
  578. //
  579. // The following procedure is used by the FSP and FSD routines to complete
  580. // an IRP.
  581. //
  582. // Note that this macro allows either the Irp or the RxContext to be
  583. // null, however the only legal order to do this in is:
  584. //
  585. // RxCompleteRequest_OLD( NULL, Irp, Status ); // completes Irp & preserves context
  586. // ...
  587. // RxCompleteRequest_OLD( RxContext, NULL, DontCare ); // deallocates context
  588. //
  589. // This would typically be done in order to pass a "naked" RxContext off to
  590. // the Fsp for post processing, such as read ahead.
  591. //
  592. // The new way is to pass just the RxContext..........
  593. //
  594. VOID
  595. RxCompleteRequest_Real (
  596. IN PRX_CONTEXT RxContext,
  597. IN PIRP Irp,
  598. IN NTSTATUS Status
  599. );
  600. #if DBG
  601. #define RxCompleteRequest_OLD(RXCONTEXT,IRP,STATUS) { \
  602. RxCompleteRequest_Real( RXCONTEXT, IRP, STATUS); \
  603. (IRP) = NULL; \
  604. (RXCONTEXT) = NULL; \
  605. }
  606. #else
  607. #define RxCompleteRequest_OLD(RXCONTEXT,IRP,STATUS ) { \
  608. RxCompleteRequest_Real( RXCONTEXT, IRP, STATUS ); \
  609. }
  610. #endif
  611. NTSTATUS
  612. RxCompleteRequest(
  613. PRX_CONTEXT pContext,
  614. NTSTATUS Status);
  615. #define RxCompleteAsynchronousRequest(RXCONTEXT,STATUS) \
  616. RxCompleteRequest(RXCONTEXT,STATUS)
  617. #define RxCompleteContextAndReturn(STATUS) { \
  618. NTSTATUS __sss = (STATUS); \
  619. RxCompleteRequest(RxContext,__sss); \
  620. return(__sss);}
  621. #define RxCompleteContext(STATUS) { \
  622. NTSTATUS __sss = (STATUS); \
  623. RxCompleteRequest(RxContext,__sss);} \
  624. //
  625. // The Following routine makes a popup
  626. //
  627. VOID
  628. RxPopUpFileCorrupt (
  629. IN PRX_CONTEXT RxContext,
  630. IN PFCB Fcb
  631. );
  632. NTSTATUS
  633. RxConstructSrvCall (
  634. IN PRX_CONTEXT RxContext,
  635. IN PIRP Irp,
  636. IN PSRV_CALL SrvCall,
  637. OUT PLOCK_HOLDING_STATE LockHoldingState
  638. );
  639. NTSTATUS
  640. RxSetSrvCallDomainName (
  641. IN PMRX_SRV_CALL SrvCall,
  642. IN PUNICODE_STRING DomainName
  643. );
  644. NTSTATUS
  645. RxConstructNetRoot (
  646. IN PRX_CONTEXT RxContext,
  647. IN PSRV_CALL SrvCall,
  648. IN PNET_ROOT NetRoot,
  649. IN PV_NET_ROOT VirtualNetRoot,
  650. OUT PLOCK_HOLDING_STATE LockHoldingState
  651. );
  652. NTSTATUS
  653. RxConstructVirtualNetRoot (
  654. IN PRX_CONTEXT RxContext,
  655. IN PIRP Irp,
  656. IN PUNICODE_STRING CanonicalName,
  657. IN NET_ROOT_TYPE NetRootType,
  658. IN BOOLEAN TreeConnect,
  659. OUT PV_NET_ROOT *VirtualNetRootPointer,
  660. OUT PLOCK_HOLDING_STATE LockHoldingState,
  661. OUT PRX_CONNECTION_ID RxConnectionId
  662. );
  663. NTSTATUS
  664. RxFindOrConstructVirtualNetRoot (
  665. IN PRX_CONTEXT RxContext,
  666. IN PIRP Irp,
  667. IN PUNICODE_STRING CanonicalName,
  668. IN NET_ROOT_TYPE NetRootType,
  669. IN PUNICODE_STRING RemainingName
  670. );
  671. NTSTATUS
  672. RxLowIoFsCtlShell (
  673. IN PRX_CONTEXT RxContext,
  674. IN PIRP Irp,
  675. IN PFCB Fcb,
  676. IN PFOBX Fobx
  677. );
  678. NTSTATUS
  679. RxLowIoFsCtlShellCompletion (
  680. IN PRX_CONTEXT RxContext
  681. );
  682. NTSTATUS
  683. RxLowIoLockControlShell (
  684. IN PRX_CONTEXT RxContext,
  685. IN PIRP Irp,
  686. IN PFCB Fcb
  687. );
  688. NTSTATUS
  689. RxShadowLowIo (
  690. IN PRX_CONTEXT RxContext,
  691. IN PIRP Irp,
  692. IN PFCB Fcb
  693. );
  694. NTSTATUS
  695. RxShadowFastLowIo (
  696. IN PRX_CONTEXT RxContext,
  697. IN PIRP Irp
  698. );
  699. NTSTATUS
  700. RxChangeBufferingState (
  701. PSRV_OPEN SrvOpen,
  702. PVOID Context,
  703. BOOLEAN ComputeNewState
  704. );
  705. VOID
  706. RxAssociateSrvOpenKey (
  707. PMRX_SRV_OPEN MRxSrvOpen,
  708. PVOID SrvOpenKey
  709. );
  710. VOID
  711. RxIndicateChangeOfBufferingState (
  712. PMRX_SRV_CALL SrvCall,
  713. PVOID SrvOpenKey,
  714. PVOID Context
  715. );
  716. VOID
  717. RxIndicateChangeOfBufferingStateForSrvOpen (
  718. PMRX_SRV_CALL SrvCall,
  719. PMRX_SRV_OPEN SrvOpen,
  720. PVOID SrvOpenKey,
  721. PVOID Context
  722. );
  723. NTSTATUS
  724. RxPrepareToReparseSymbolicLink (
  725. PRX_CONTEXT RxContext,
  726. BOOLEAN SymbolicLinkEmbeddedInOldPath,
  727. PUNICODE_STRING NewPath,
  728. BOOLEAN NewPathIsAbsolute,
  729. PBOOLEAN ReparseRequired
  730. );
  731. BOOLEAN
  732. RxLockEnumerator (
  733. IN OUT PMRX_SRV_OPEN SrvOpen,
  734. IN OUT PVOID *ContinuationHandle,
  735. OUT PLARGE_INTEGER FileOffset,
  736. OUT PLARGE_INTEGER LockRange,
  737. OUT PBOOLEAN IsLockExclusive
  738. );
  739. //
  740. // Routines for transitioning data structures to stable states.
  741. //
  742. VOID
  743. RxReference (
  744. IN OUT PVOID Instance
  745. );
  746. VOID
  747. RxDereference (
  748. IN OUT PVOID Instance,
  749. IN LOCK_HOLDING_STATE LockHoldingState
  750. );
  751. VOID
  752. RxWaitForStableCondition (
  753. IN PRX_BLOCK_CONDITION Condition,
  754. IN OUT PLIST_ENTRY TransitionWaitList,
  755. IN OUT PRX_CONTEXT RxContext,
  756. OUT NTSTATUS *AsyncStatus OPTIONAL
  757. );
  758. VOID
  759. RxUpdateCondition (
  760. IN RX_BLOCK_CONDITION NewConditionValue,
  761. OUT PRX_BLOCK_CONDITION Condition,
  762. IN OUT PLIST_ENTRY TransitionWaitList
  763. );
  764. VOID
  765. RxFinalizeNetTable (
  766. IN PRDBSS_DEVICE_OBJECT RxDeviceObject,
  767. IN BOOLEAN ForceFinalization
  768. );
  769. #define RxForceNetTableFinalization(RxDeviceObject) RxFinalizeNetTable( RxDeviceObject, TRUE )
  770. NTSTATUS
  771. RxCloseAssociatedSrvOpen (
  772. IN PRX_CONTEXT RxContext OPTIONAL,
  773. IN PFOBX Fobx
  774. );
  775. NTSTATUS
  776. RxFinalizeConnection (
  777. IN OUT PNET_ROOT NetRoot,
  778. IN OUT PV_NET_ROOT VNetRoot OPTIONAL,
  779. IN LOGICAL ForceFilesClosed
  780. );
  781. //
  782. // routines for manipulating the user's view and the server's view of SHARE_ACCESS.
  783. // the user's view is supported by routines exported by Io...the wrappers just allow
  784. // us to get a msg. the server's view is supported by routines that are essential just
  785. // copies of the Io routines EXCEPT that the Io routines work directly on fileobjects and
  786. // as such cannot be used directly. the routines mentioned are implemented in create.c
  787. //
  788. #if DBG
  789. VOID
  790. RxDumpWantedAccess (
  791. PSZ where1,
  792. PSZ where2,
  793. PSZ wherelogtag,
  794. IN ACCESS_MASK DesiredAccess,
  795. IN ULONG DesiredShareAccess
  796. );
  797. VOID
  798. RxDumpCurrentAccess (
  799. PSZ where1,
  800. PSZ where2,
  801. PSZ wherelogtag,
  802. PSHARE_ACCESS ShareAccess
  803. );
  804. #else
  805. #define RxDumpWantedAccess(w1,w2,wlt,DA,DSA) {NOTHING;}
  806. #define RxDumpCurrentAccess(w1,w2,wlt,SA) {NOTHING;}
  807. #endif
  808. NTSTATUS
  809. RxCheckShareAccessPerSrvOpens (
  810. IN PFCB Fcb,
  811. IN ACCESS_MASK DesiredAccess,
  812. IN ULONG DesiredShareAccess
  813. );
  814. VOID
  815. RxUpdateShareAccessPerSrvOpens (
  816. IN PSRV_OPEN SrvOpen
  817. );
  818. VOID
  819. RxRemoveShareAccessPerSrvOpens (
  820. IN OUT PSRV_OPEN SrvOpen
  821. );
  822. VOID
  823. RxRemoveShareAccessPerSrvOpens (
  824. IN OUT PSRV_OPEN SrvOpen
  825. );
  826. #if DBG
  827. NTSTATUS
  828. RxCheckShareAccess (
  829. IN ACCESS_MASK DesiredAccess,
  830. IN ULONG DesiredShareAccess,
  831. IN OUT PFILE_OBJECT FileObject,
  832. IN OUT PSHARE_ACCESS ShareAccess,
  833. IN BOOLEAN Update,
  834. IN PSZ where,
  835. IN PSZ wherelogtag
  836. );
  837. VOID
  838. RxRemoveShareAccess (
  839. IN PFILE_OBJECT FileObject,
  840. IN OUT PSHARE_ACCESS ShareAccess,
  841. IN PSZ where,
  842. IN PSZ wherelogtag
  843. );
  844. VOID
  845. RxSetShareAccess (
  846. IN ACCESS_MASK DesiredAccess,
  847. IN ULONG DesiredShareAccess,
  848. IN OUT PFILE_OBJECT FileObject,
  849. OUT PSHARE_ACCESS ShareAccess,
  850. IN PSZ where,
  851. IN PSZ wherelogtag
  852. );
  853. VOID
  854. RxUpdateShareAccess (
  855. IN PFILE_OBJECT FileObject,
  856. IN OUT PSHARE_ACCESS ShareAccess,
  857. IN PSZ where,
  858. IN PSZ wherelogtag
  859. );
  860. #else
  861. #define RxCheckShareAccess(a1,a2,a3,a4,a5,a6,a7) \
  862. IoCheckShareAccess(a1,a2,a3,a4,a5)
  863. #define RxRemoveShareAccess(a1,a2,a3,a4) \
  864. IoRemoveShareAccess(a1,a2)
  865. #define RxSetShareAccess(a1,a2,a3,a4,a5,a6) \
  866. IoSetShareAccess(a1,a2,a3,a4)
  867. #define RxUpdateShareAccess(a1,a2,a3,a4) \
  868. IoUpdateShareAccess(a1,a2)
  869. #endif
  870. //
  871. // LoadUnload
  872. //
  873. NTSTATUS
  874. RxDriverEntry (
  875. IN PDRIVER_OBJECT DriverObject,
  876. IN PUNICODE_STRING RegistryPath
  877. );
  878. VOID
  879. RxUnload (
  880. IN PDRIVER_OBJECT DriverObject
  881. );
  882. //
  883. // minirdr support
  884. //
  885. VOID
  886. RxInitializeMinirdrDispatchTable (
  887. IN PDRIVER_OBJECT DriverObject
  888. );
  889. ULONG
  890. RxGetNetworkProviderPriority(
  891. PUNICODE_STRING DeviceName
  892. );
  893. VOID
  894. RxExtractServerName(
  895. IN PUNICODE_STRING FilePathName,
  896. OUT PUNICODE_STRING SrvCallName,
  897. OUT PUNICODE_STRING RestOfName
  898. );
  899. VOID
  900. RxCreateNetRootCallBack (
  901. IN PMRX_CREATENETROOT_CONTEXT CreateNetRootContext
  902. );
  903. NTSTATUS
  904. DuplicateTransportAddress (
  905. PTRANSPORT_ADDRESS *Copy,
  906. PTRANSPORT_ADDRESS Original,
  907. POOL_TYPE PoolType);
  908. NTSTATUS
  909. RxCepInitializeVC (
  910. PRXCE_VC Vc,
  911. PRXCE_CONNECTION Connection
  912. );
  913. NTSTATUS
  914. DuplicateConnectionInformation (
  915. PRXCE_CONNECTION_INFORMATION *Copy,
  916. PRXCE_CONNECTION_INFORMATION Original,
  917. POOL_TYPE PoolType
  918. );
  919. NTSTATUS
  920. RxCepInitializeConnection (
  921. IN OUT PRXCE_CONNECTION Connection,
  922. IN PRXCE_ADDRESS Address,
  923. IN PRXCE_CONNECTION_INFORMATION ConnectionInformation,
  924. IN PRXCE_CONNECTION_EVENT_HANDLER Handler,
  925. IN PVOID EventContext
  926. );
  927. typedef struct _RX_CALLOUT_PARAMETERS_BLOCK_ * PRX_CALLOUT_PARAMETERS_BLOCK;
  928. typedef struct _RX_CREATE_CONNECTION_CALLOUT_CONTEXT_ *PRX_CREATE_CONNECTION_CALLOUT_CONTEXT;
  929. NTSTATUS
  930. RxCeInitiateConnectRequest (
  931. IN PRX_CALLOUT_PARAMETERS_BLOCK ParameterBlock
  932. );
  933. VOID
  934. RxCeCleanupConnectCallOutContext (
  935. PRX_CREATE_CONNECTION_CALLOUT_CONTEXT CreateConnectionContext
  936. );
  937. PVOID
  938. RxAllocateObject (
  939. NODE_TYPE_CODE NodeType,
  940. PMINIRDR_DISPATCH MRxDispatch,
  941. ULONG NameLength
  942. );
  943. VOID
  944. RxFreeObject (
  945. PVOID pObject
  946. );
  947. NTSTATUS
  948. RxInitializeSrvCallParameters (
  949. IN PRX_CONTEXT RxContext,
  950. IN OUT PSRV_CALL SrvCall
  951. );
  952. VOID
  953. RxAddVirtualNetRootToNetRoot (
  954. PNET_ROOT NetRoot,
  955. PV_NET_ROOT VNetRoot
  956. );
  957. VOID
  958. RxRemoveVirtualNetRootFromNetRoot (
  959. PNET_ROOT NetRoot,
  960. PV_NET_ROOT VNetRoot
  961. );
  962. VOID
  963. RxOrphanFcbsFromThisVNetRoot (
  964. IN PV_NET_ROOT ThisVNetRoot
  965. );
  966. PVOID
  967. RxAllocateFcbObject (
  968. PRDBSS_DEVICE_OBJECT RxDeviceObject,
  969. NODE_TYPE_CODE NodeType,
  970. POOL_TYPE PoolType,
  971. ULONG NameSize,
  972. PVOID AlreadyAllocatedObject
  973. );
  974. VOID
  975. RxFreeFcbObject (
  976. PVOID Object
  977. );
  978. VOID
  979. RxPurgeFcb (
  980. IN PFCB Fcb
  981. );
  982. BOOLEAN
  983. RxFinalizeNetFcb (
  984. OUT PFCB ThisFcb,
  985. IN BOOLEAN RecursiveFinalize,
  986. IN BOOLEAN ForceFinalize,
  987. IN LONG ReferenceCount
  988. );
  989. BOOLEAN
  990. RxIsThisACscAgentOpen (
  991. IN PRX_CONTEXT RxContext
  992. );
  993. VOID
  994. RxCheckFcbStructuresForAlignment (
  995. VOID
  996. );
  997. VOID
  998. RxpPrepareCreateContextForReuse (
  999. PRX_CONTEXT RxContext
  1000. );
  1001. NTSTATUS
  1002. RxLowIoSubmitRETRY (
  1003. IN PRX_CONTEXT RxContext,
  1004. IN PIRP Irp
  1005. );
  1006. NTSTATUS
  1007. RxLowIoCompletionTail (
  1008. IN PRX_CONTEXT RxContext
  1009. );
  1010. VOID
  1011. RxRecurrentTimerWorkItemDispatcher (
  1012. IN PVOID Context
  1013. );
  1014. NTSTATUS
  1015. RxInitializeWorkQueueDispatcher (
  1016. PRX_WORK_QUEUE_DISPATCHER Dispatcher
  1017. );
  1018. VOID
  1019. RxInitializeWorkQueue (
  1020. PRX_WORK_QUEUE WorkQueue,
  1021. WORK_QUEUE_TYPE WorkQueueType,
  1022. ULONG MaximumNumberOfWorkerThreads,
  1023. ULONG MinimumNumberOfWorkerThreads
  1024. );
  1025. VOID
  1026. RxTearDownWorkQueueDispatcher (
  1027. PRX_WORK_QUEUE_DISPATCHER Dispatcher
  1028. );
  1029. VOID
  1030. RxTearDownWorkQueue (
  1031. PRX_WORK_QUEUE WorkQueue
  1032. );
  1033. NTSTATUS
  1034. RxSpinUpWorkerThread (
  1035. PRX_WORK_QUEUE WorkQueue,
  1036. PRX_WORKERTHREAD_ROUTINE Routine,
  1037. PVOID Parameter
  1038. );
  1039. VOID
  1040. RxSpinUpWorkerThreads (
  1041. PRX_WORK_QUEUE WorkQueue
  1042. );
  1043. VOID
  1044. RxSpinUpRequestsDispatcher (
  1045. PRX_DISPATCHER Dispatcher
  1046. );
  1047. VOID
  1048. RxpSpinUpWorkerThreads (
  1049. PRX_WORK_QUEUE WorkQueue
  1050. );
  1051. VOID
  1052. RxpWorkerThreadDispatcher (
  1053. IN PRX_WORK_QUEUE WorkQueue,
  1054. IN PLARGE_INTEGER WaitInterval
  1055. );
  1056. VOID
  1057. RxBootstrapWorkerThreadDispatcher (
  1058. IN PRX_WORK_QUEUE WorkQueue
  1059. );
  1060. VOID
  1061. RxWorkerThreadDispatcher (
  1062. IN PRX_WORK_QUEUE WorkQueue
  1063. );
  1064. VOID
  1065. RxWorkItemDispatcher (
  1066. PVOID Context
  1067. );
  1068. BOOLEAN
  1069. RxIsPrefixTableEmpty (
  1070. IN PRX_PREFIX_TABLE ThisTable
  1071. );
  1072. PRX_PREFIX_ENTRY
  1073. RxTableLookupName_ExactLengthMatch (
  1074. IN PRX_PREFIX_TABLE ThisTable,
  1075. IN PUNICODE_STRING Name,
  1076. IN ULONG HashValue,
  1077. IN PRX_CONNECTION_ID OPTIONAL RxConnectionId
  1078. );
  1079. PVOID
  1080. RxTableLookupName (
  1081. IN PRX_PREFIX_TABLE ThisTable,
  1082. IN PUNICODE_STRING Name,
  1083. OUT PUNICODE_STRING RemainingName,
  1084. IN PRX_CONNECTION_ID OPTIONAL RxConnectionId
  1085. );
  1086. VOID
  1087. RxAcquireFileForNtCreateSection (
  1088. IN PFILE_OBJECT FileObject
  1089. );
  1090. VOID
  1091. RxReleaseFileForNtCreateSection (
  1092. IN PFILE_OBJECT FileObject
  1093. );
  1094. NTSTATUS
  1095. RxPrepareRequestForHandling (
  1096. PCHANGE_BUFFERING_STATE_REQUEST Request
  1097. );
  1098. VOID
  1099. RxPrepareRequestForReuse (
  1100. PCHANGE_BUFFERING_STATE_REQUEST Request
  1101. );
  1102. VOID
  1103. RxpDiscardChangeBufferingStateRequests (
  1104. IN OUT PLIST_ENTRY DiscardedRequests
  1105. );
  1106. VOID
  1107. RxGatherRequestsForSrvOpen (
  1108. IN OUT PSRV_CALL SrvCall,
  1109. IN PSRV_OPEN SrvOpen,
  1110. IN OUT PLIST_ENTRY RequestsListHead
  1111. );
  1112. NTSTATUS
  1113. RxpLookupSrvOpenForRequestLite (
  1114. IN PSRV_CALL SrvCall,
  1115. IN OUT PCHANGE_BUFFERING_STATE_REQUEST Request
  1116. );
  1117. BOOLEAN
  1118. RxContextCheckToFailThisAttempt (
  1119. IN PIRP Irp,
  1120. IN OUT PULONG InitialContextFlags
  1121. );
  1122. ULONG
  1123. RxAssignMustSucceedContext (
  1124. IN PIRP Irp,
  1125. IN ULONG InitialContextFlags
  1126. );
  1127. PRX_CONTEXT
  1128. RxAllocateMustSucceedContext (
  1129. PIRP Irp,
  1130. IN PRDBSS_DEVICE_OBJECT RxDeviceObject,
  1131. IN ULONG InitialContextFlags,
  1132. OUT PUCHAR MustSucceedDescriptorNumber
  1133. );
  1134. VOID
  1135. RxFreeMustSucceedContext (
  1136. PRX_CONTEXT RxContext
  1137. );
  1138. PRX_LOG_ENTRY_HEADER
  1139. RxGetNextLogEntry (
  1140. VOID
  1141. );
  1142. VOID
  1143. RxPrintLog (
  1144. IN ULONG EntriesToPrint OPTIONAL
  1145. );
  1146. VOID
  1147. RxProcessChangeBufferingStateRequestsForSrvOpen (
  1148. PSRV_OPEN SrvOpen
  1149. );
  1150. NTSTATUS
  1151. RxPurgeFobxFromCache (
  1152. PFOBX FobxToBePurged
  1153. );
  1154. BOOLEAN
  1155. RxPurgeFobx (
  1156. PFOBX pFobx
  1157. );
  1158. VOID
  1159. RxPurgeAllFobxs (
  1160. PRDBSS_DEVICE_OBJECT RxDeviceObject
  1161. );
  1162. VOID
  1163. RxUndoScavengerFinalizationMarking (
  1164. PVOID Instance
  1165. );
  1166. VOID
  1167. RxScavengeAllFobxs (
  1168. PRDBSS_DEVICE_OBJECT RxDeviceObject
  1169. );
  1170. ULONG
  1171. RxTableComputePathHashValue (
  1172. IN PUNICODE_STRING Name
  1173. );
  1174. VOID
  1175. RxExtractServerName (
  1176. IN PUNICODE_STRING FilePathName,
  1177. OUT PUNICODE_STRING SrvCallName,
  1178. OUT PUNICODE_STRING RestOfName
  1179. );
  1180. VOID
  1181. RxCreateNetRootCallBack (
  1182. IN PMRX_CREATENETROOT_CONTEXT CreateNetRootContext
  1183. );
  1184. VOID
  1185. RxSpinDownOutstandingAsynchronousRequests (
  1186. IN PRDBSS_DEVICE_OBJECT RxDeviceObject
  1187. );
  1188. NTSTATUS
  1189. RxRegisterAsynchronousRequest (
  1190. IN PRDBSS_DEVICE_OBJECT RxDeviceObject
  1191. );
  1192. VOID
  1193. RxDeregisterAsynchronousRequest (
  1194. IN PRDBSS_DEVICE_OBJECT RxDeviceObject
  1195. );
  1196. BOOLEAN
  1197. RxCancelOperationInOverflowQueue (
  1198. IN PRX_CONTEXT RxContext
  1199. );
  1200. VOID
  1201. RxOrphanSrvOpens (
  1202. IN PV_NET_ROOT ThisVNetRoot
  1203. );
  1204. VOID
  1205. RxOrphanThisFcb (
  1206. PFCB Fcb
  1207. );
  1208. VOID
  1209. RxOrphanSrvOpensForThisFcb (
  1210. IN PFCB Fcb,
  1211. IN PV_NET_ROOT ThisVNetRoot,
  1212. IN BOOLEAN OrphanAll
  1213. );
  1214. VOID
  1215. RxForceFinalizeAllVNetRoots (
  1216. PNET_ROOT NetRoot
  1217. );
  1218. #define RxEqualConnectionId( P1, P2 ) RtlEqualMemory( P1, P2, sizeof( RX_CONNECTION_ID ) )
  1219. //
  1220. // FsRtl lock package callbacks referenced in fcbstruc.c
  1221. //
  1222. NTSTATUS
  1223. RxLockOperationCompletion (
  1224. IN PVOID Context,
  1225. IN PIRP Irp
  1226. );
  1227. VOID
  1228. RxUnlockOperation (
  1229. IN PVOID Context,
  1230. IN PFILE_LOCK_INFO LockInfo
  1231. );
  1232. //
  1233. // some read routines that need headers
  1234. //
  1235. VOID
  1236. RxStackOverflowRead (
  1237. IN PVOID Context,
  1238. IN PKEVENT Event
  1239. );
  1240. NTSTATUS
  1241. RxPostStackOverflowRead (
  1242. IN PRX_CONTEXT RxContext,
  1243. IN PFCB Fcb
  1244. );
  1245. //
  1246. // the cancel routine
  1247. //
  1248. VOID
  1249. RxCancelRoutine (
  1250. PDEVICE_OBJECT DeviceObject,
  1251. PIRP Irp
  1252. );
  1253. INLINE
  1254. TYPE_OF_OPEN
  1255. RxDecodeFileObject (
  1256. IN PFILE_OBJECT FileObject,
  1257. OUT PFCB *Fcb,
  1258. OUT PFOBX *Fobx
  1259. ) {
  1260. if (FileObject) {
  1261. *Fcb = (PFCB)FileObject->FsContext;
  1262. *Fobx = (PFOBX)FileObject->FsContext2;
  1263. return NodeType( *Fcb );
  1264. } else {
  1265. *Fcb = NULL;
  1266. *Fobx = NULL;
  1267. return RDBSS_NTC_STORAGE_TYPE_UNKNOWN;
  1268. }
  1269. }
  1270. #endif // _RDBSSPROCS_