[RDBSS]
[reactos.git] / reactos / sdk / include / ddk / rxprocs.h
1 #ifndef _RDBSSPROCS_
2 #define _RDBSSPROCS_
3
4 #include "backpack.h"
5 #include "rxlog.h"
6 #include "rxtimer.h"
7 #include "rxstruc.h"
8
9 extern PVOID RxNull;
10
11 #define RxLogFailure(DO, Originator, Event, Status) \
12 RxLogEventDirect(DO, Originator, Event, Status, __LINE__)
13
14 VOID
15 NTAPI
16 RxLogEventDirect(
17 _In_ PRDBSS_DEVICE_OBJECT DeviceObject,
18 _In_ PUNICODE_STRING OriginatorId,
19 _In_ ULONG EventId,
20 _In_ NTSTATUS Status,
21 _In_ ULONG Line);
22
23 VOID
24 NTAPI
25 RxLogEventWithAnnotation(
26 _In_ PRDBSS_DEVICE_OBJECT DeviceObject,
27 _In_ ULONG EventId,
28 _In_ NTSTATUS Status,
29 _In_ PVOID DataBuffer,
30 _In_ USHORT DataBufferLength,
31 _In_ PUNICODE_STRING Annotation,
32 _In_ ULONG AnnotationCount);
33
34 NTSTATUS
35 RxPrefixClaim(
36 _In_ PRX_CONTEXT RxContext);
37
38 VOID
39 RxpPrepareCreateContextForReuse(
40 _In_ PRX_CONTEXT RxContext);
41
42 NTSTATUS
43 RxLowIoCompletionTail(
44 _In_ PRX_CONTEXT RxContext);
45
46 LUID
47 RxGetUid(
48 _In_ PSECURITY_SUBJECT_CONTEXT SubjectSecurityContext);
49
50 ULONG
51 RxGetSessionId(
52 _In_ PIO_STACK_LOCATION IrpSp);
53
54 #if (_WIN32_WINNT >= 0x0600)
55 NTSTATUS
56 RxFindOrCreateConnections(
57 _In_ PRX_CONTEXT RxContext,
58 _In_ PIRP Irp,
59 _In_ PUNICODE_STRING CanonicalName,
60 _In_ NET_ROOT_TYPE NetRootType,
61 _In_ BOOLEAN TreeConnect,
62 _Out_ PUNICODE_STRING LocalNetRootName,
63 _Out_ PUNICODE_STRING FilePathName,
64 _Inout_ PLOCK_HOLDING_STATE LockState,
65 _In_ PRX_CONNECTION_ID RxConnectionId);
66 #else
67 NTSTATUS
68 RxFindOrCreateConnections(
69 _In_ PRX_CONTEXT RxContext,
70 _In_ PUNICODE_STRING CanonicalName,
71 _In_ NET_ROOT_TYPE NetRootType,
72 _Out_ PUNICODE_STRING LocalNetRootName,
73 _Out_ PUNICODE_STRING FilePathName,
74 _Inout_ PLOCK_HOLDING_STATE LockState,
75 _In_ PRX_CONNECTION_ID RxConnectionId);
76 #endif
77
78 #if (_WIN32_WINNT >= 0x0600)
79 NTSTATUS
80 RxCompleteMdl(
81 _In_ PRX_CONTEXT RxContext,
82 _In_ PIRP Irp);
83 #else
84 NTSTATUS
85 NTAPI
86 RxCompleteMdl(
87 _In_ PRX_CONTEXT RxContext);
88 #endif
89
90 #if (_WIN32_WINNT >= 0x0600)
91 VOID
92 RxLockUserBuffer(
93 _In_ PRX_CONTEXT RxContext,
94 _In_ PIRP Irp,
95 _In_ LOCK_OPERATION Operation,
96 _In_ ULONG BufferLength);
97
98 PVOID
99 RxMapSystemBuffer(
100 _In_ PRX_CONTEXT RxContext,
101 _In_ PIRP Irp);
102 #else
103 VOID
104 RxLockUserBuffer(
105 _In_ PRX_CONTEXT RxContext,
106 _In_ LOCK_OPERATION Operation,
107 _In_ ULONG BufferLength);
108
109 PVOID
110 RxMapSystemBuffer(
111 _In_ PRX_CONTEXT RxContext);
112 #endif
113
114 #define FCB_MODE_EXCLUSIVE 1
115 #define FCB_MODE_SHARED 2
116 #define FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE 3
117 #define FCB_MODE_SHARED_STARVE_EXCLUSIVE 4
118
119 #define CHANGE_BUFFERING_STATE_CONTEXT ((PRX_CONTEXT)IntToPtr(0xffffffff))
120 #define CHANGE_BUFFERING_STATE_CONTEXT_WAIT ((PRX_CONTEXT)IntToPtr(0xfffffffe))
121
122 NTSTATUS
123 __RxAcquireFcb(
124 _Inout_ PFCB Fcb,
125 _Inout_opt_ PRX_CONTEXT RxContext,
126 _In_ ULONG Mode
127 #ifdef RDBSS_TRACKER
128 ,
129 _In_ ULONG LineNumber,
130 _In_ PCSTR FileName,
131 _In_ ULONG SerialNumber
132 #endif
133 );
134
135 #ifdef RDBSS_TRACKER
136 #define RxAcquireExclusiveFcb(R, F) __RxAcquireFcb((F), (R), FCB_MODE_EXCLUSIVE, __LINE__, __FILE__, 0)
137 #else
138 #define RxAcquireExclusiveFcb(R, F) __RxAcquireFcb((F), (R), FCB_MODE_EXCLUSIVE)
139 #endif
140
141 #define RX_GET_MRX_FCB(F) ((PMRX_FCB)((F)))
142
143 #ifdef RDBSS_TRACKER
144 #define RxAcquireSharedFcb(R, F) __RxAcquireFcb((F), (R), FCB_MODE_SHARED, __LINE__, __FILE__, 0)
145 #else
146 #define RxAcquireSharedFcb(R, F) __RxAcquireFcb((F), (R), FCB_MODE_SHARED)
147 #endif
148
149 #ifdef RDBSS_TRACKER
150 #define RxAcquireSharedFcbWaitForEx(R, F) __RxAcquireFcb((F),(R), FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE, __LINE__, __FILE__,0)
151 #else
152 #define RxAcquireSharedFcbWaitForEx(R, F) __RxAcquireFcb((F), (R), FCB_MODE_SHARED_WAIT_FOR_EXCLUSIVE)
153 #endif
154
155 VOID
156 __RxReleaseFcb(
157 _Inout_opt_ PRX_CONTEXT RxContext,
158 _Inout_ PMRX_FCB MrxFcb
159 #ifdef RDBSS_TRACKER
160 ,
161 _In_ ULONG LineNumber,
162 _In_ PCSTR FileName,
163 _In_ ULONG SerialNumber
164 #endif
165 );
166
167 #ifdef RDBSS_TRACKER
168 #define RxReleaseFcb(R, F) __RxReleaseFcb((R), RX_GET_MRX_FCB(F), __LINE__, __FILE__, 0)
169 #else
170 #define RxReleaseFcb(R, F) __RxReleaseFcb((R), RX_GET_MRX_FCB(F))
171 #endif
172
173 VOID
174 __RxReleaseFcbForThread(
175 _Inout_opt_ PRX_CONTEXT RxContext,
176 _Inout_ PMRX_FCB MrxFcb,
177 _In_ ERESOURCE_THREAD ResourceThreadId
178 #ifdef RDBSS_TRACKER
179 ,
180 _In_ ULONG LineNumber,
181 _In_ PCSTR FileName,
182 _In_ ULONG SerialNumber
183 #endif
184 );
185
186 #ifdef RDBSS_TRACKER
187 #define RxReleaseFcbForThread(R, F, T) __RxReleaseFcbForThread((R), RX_GET_MRX_FCB(F), (T), __LINE__, __FILE__, 0)
188 #else
189 #define RxReleaseFcbForThread(R, F, T) __RxReleaseFcbForThread((R), RX_GET_MRX_FCB(F), (T))
190 #endif
191
192 #ifdef RDBSS_TRACKER
193 VOID
194 RxTrackerUpdateHistory(
195 _Inout_opt_ PRX_CONTEXT RxContext,
196 _Inout_ PMRX_FCB MrxFcb,
197 _In_ ULONG Operation,
198 _In_ ULONG LineNumber,
199 _In_ PCSTR FileName,
200 _In_ ULONG SerialNumber);
201 #else
202 #define RxTrackerUpdateHistory(R, F, O, L, F, S) { NOTHING; }
203 #endif
204
205 VOID
206 RxTrackPagingIoResource(
207 _Inout_ PVOID Instance,
208 _In_ ULONG Type,
209 _In_ ULONG Line,
210 _In_ PCSTR File);
211
212 #define RxIsFcbAcquiredShared(Fcb) ExIsResourceAcquiredSharedLite((Fcb)->Header.Resource)
213 #define RxIsFcbAcquiredExclusive(Fcb) ExIsResourceAcquiredExclusiveLite((Fcb)->Header.Resource)
214 #define RxIsFcbAcquired(Fcb) (ExIsResourceAcquiredSharedLite((Fcb)->Header.Resource) || \
215 ExIsResourceAcquiredExclusiveLite((Fcb)->Header.Resource))
216
217 #define RxAcquirePagingIoResource(RxContext, Fcb) \
218 ExAcquireResourceExclusiveLite((Fcb)->Header.PagingIoResource, TRUE); \
219 if (RxContext != NULL) \
220 { \
221 (RxContext)->FcbPagingIoResourceAcquired = TRUE; \
222 } \
223 RxTrackPagingIoResource(Fcb, 1, __LINE__, __FILE__)
224
225 #ifndef __REACTOS__
226 #define RxAcquirePagingIoResourceShared(RxContext, Fcb, Flag) \
227 ExAcquireResourceSharedLite((Fcb)->Header.PagingIoResource, Flag); \
228 if (AcquiredFile) \
229 { \
230 if (RxContext != NULL) \
231 { \
232 ((PRX_CONTEXT)RxContext)->FcbPagingIoResourceAcquired = TRUE; \
233 } \
234 RxTrackPagingIoResource(Fcb, 2, __LINE__, __FILE__); \
235 }
236 #else
237 #define RxAcquirePagingIoResourceShared(RxContext, Fcb, Flag) \
238 { \
239 BOOLEAN AcquiredFile; \
240 AcquiredFile = ExAcquireResourceSharedLite((Fcb)->Header.PagingIoResource, Flag); \
241 if (AcquiredFile) \
242 { \
243 if (RxContext != NULL) \
244 { \
245 ((PRX_CONTEXT)RxContext)->FcbPagingIoResourceAcquired = TRUE; \
246 } \
247 RxTrackPagingIoResource(Fcb, 2, __LINE__, __FILE__); \
248 } \
249 }
250 #endif
251
252 #define RxReleasePagingIoResource(RxContext, Fcb) \
253 RxTrackPagingIoResource(Fcb, 3, __LINE__, __FILE__); \
254 if (RxContext != NULL) \
255 { \
256 (RxContext)->FcbPagingIoResourceAcquired = FALSE; \
257 } \
258 ExReleaseResourceLite((Fcb)->Header.PagingIoResource)
259
260 #define RxReleasePagingIoResourceForThread(RxContext, Fcb, Thread) \
261 RxTrackPagingIoResource(Fcb, 3, __LINE__, __FILE__); \
262 if (RxContext != NULL) \
263 { \
264 (RxContext)->FcbPagingIoResourceAcquired = FALSE; \
265 } \
266 ExReleaseResourceForThreadLite((Fcb)->Header.PagingIoResource, (Thread))
267
268 #ifdef __REACTOS__
269 VOID
270 __RxWriteReleaseResources(
271 PRX_CONTEXT RxContext,
272 BOOLEAN ResourceOwnerSet
273 #ifdef RDBSS_TRACKER
274 ,
275 ULONG LineNumber,
276 PCSTR FileName,
277 ULONG SerialNumber
278 #endif
279 );
280
281 #ifdef RDBSS_TRACKER
282 #define RxWriteReleaseResources(R, B) __RxWriteReleaseResources((R), (B), __LINE__, __FILE__, 0)
283 #else
284 #define RxWriteReleaseResources(R, B) __RxWriteReleaseResources((R), (B))
285 #endif
286 #endif
287
288 BOOLEAN
289 NTAPI
290 RxAcquireFcbForLazyWrite(
291 _In_ PVOID Null,
292 _In_ BOOLEAN Wait);
293
294 VOID
295 NTAPI
296 RxReleaseFcbFromLazyWrite(
297 _In_ PVOID Null);
298
299 BOOLEAN
300 NTAPI
301 RxAcquireFcbForReadAhead(
302 _In_ PVOID Null,
303 _In_ BOOLEAN Wait);
304
305 VOID
306 NTAPI
307 RxReleaseFcbFromReadAhead(
308 _In_ PVOID Null);
309
310 BOOLEAN
311 NTAPI
312 RxNoOpAcquire(
313 _In_ PVOID Fcb,
314 _In_ BOOLEAN Wait);
315
316 VOID
317 NTAPI
318 RxNoOpRelease(
319 _In_ PVOID Fcb);
320
321 #define RxConvertToSharedFcb(R, F) ExConvertExclusiveToSharedLite(RX_GET_MRX_FCB(F)->Header.Resource)
322
323 VOID
324 RxVerifyOperationIsLegal(
325 _In_ PRX_CONTEXT RxContext);
326
327 VOID
328 RxPrePostIrp(
329 _In_ PVOID Context,
330 _In_ PIRP Irp);
331
332 VOID
333 NTAPI
334 RxAddToWorkque(
335 _In_ PRX_CONTEXT RxContext,
336 _In_ PIRP Irp);
337
338 NTSTATUS
339 RxFsdPostRequest(
340 _In_ PRX_CONTEXT RxContext);
341
342 #define QuadAlign(V) (ALIGN_UP(V, ULONGLONG))
343
344 VOID
345 RxCompleteRequest_Real(
346 _In_ PRX_CONTEXT RxContext,
347 _In_ PIRP Irp,
348 _In_ NTSTATUS Status);
349
350 NTSTATUS
351 RxCompleteRequest(
352 _In_ PRX_CONTEXT pContext,
353 _In_ NTSTATUS Status);
354
355 #if (_WIN32_WINNT >= 0x600)
356 NTSTATUS
357 RxConstructSrvCall(
358 _In_ PRX_CONTEXT RxContext,
359 _In_ PIRP Irp,
360 _In_ PSRV_CALL SrvCall,
361 _Out_ PLOCK_HOLDING_STATE LockHoldingState);
362 #else
363 NTSTATUS
364 RxConstructSrvCall(
365 _In_ PRX_CONTEXT RxContext,
366 _In_ PSRV_CALL SrvCall,
367 _Out_ PLOCK_HOLDING_STATE LockHoldingState);
368 #endif
369
370 #define RxCompleteAsynchronousRequest(C, S) RxCompleteRequest(C, S)
371
372 NTSTATUS
373 RxConstructNetRoot(
374 _In_ PRX_CONTEXT RxContext,
375 _In_ PSRV_CALL SrvCall,
376 _In_ PNET_ROOT NetRoot,
377 _In_ PV_NET_ROOT VirtualNetRoot,
378 _Out_ PLOCK_HOLDING_STATE LockHoldingState);
379
380 #if (_WIN32_WINNT >= 0x0600)
381 NTSTATUS
382 RxConstructVirtualNetRoot(
383 _In_ PRX_CONTEXT RxContext,
384 _In_ PIRP Irp,
385 _In_ PUNICODE_STRING CanonicalName,
386 _In_ NET_ROOT_TYPE NetRootType,
387 _In_ BOOLEAN TreeConnect,
388 _Out_ PV_NET_ROOT *VirtualNetRootPointer,
389 _Out_ PLOCK_HOLDING_STATE LockHoldingState,
390 _Out_ PRX_CONNECTION_ID RxConnectionId);
391
392 NTSTATUS
393 RxFindOrConstructVirtualNetRoot(
394 _In_ PRX_CONTEXT RxContext,
395 _In_ PIRP Irp,
396 _In_ PUNICODE_STRING CanonicalName,
397 _In_ NET_ROOT_TYPE NetRootType,
398 _In_ PUNICODE_STRING RemainingName);
399 #else
400 NTSTATUS
401 RxConstructVirtualNetRoot(
402 _In_ PRX_CONTEXT RxContext,
403 _In_ PUNICODE_STRING CanonicalName,
404 _In_ NET_ROOT_TYPE NetRootType,
405 _Out_ PV_NET_ROOT *VirtualNetRootPointer,
406 _Out_ PLOCK_HOLDING_STATE LockHoldingState,
407 _Out_ PRX_CONNECTION_ID RxConnectionId);
408
409 NTSTATUS
410 RxFindOrConstructVirtualNetRoot(
411 _In_ PRX_CONTEXT RxContext,
412 _In_ PUNICODE_STRING CanonicalName,
413 _In_ NET_ROOT_TYPE NetRootType,
414 _In_ PUNICODE_STRING RemainingName);
415 #endif
416
417 #if (_WIN32_WINNT >= 0x0600)
418 NTSTATUS
419 RxLowIoLockControlShell(
420 _In_ PRX_CONTEXT RxContext,
421 _In_ PIRP Irp,
422 _In_ PFCB Fcb);
423 #else
424 NTSTATUS
425 RxLowIoLockControlShell(
426 _In_ PRX_CONTEXT RxContext);
427 #endif
428
429 NTSTATUS
430 NTAPI
431 RxChangeBufferingState(
432 PSRV_OPEN SrvOpen,
433 PVOID Context,
434 BOOLEAN ComputeNewState);
435
436 VOID
437 NTAPI
438 RxIndicateChangeOfBufferingStateForSrvOpen(
439 PMRX_SRV_CALL SrvCall,
440 PMRX_SRV_OPEN SrvOpen,
441 PVOID SrvOpenKey,
442 PVOID Context);
443
444 NTSTATUS
445 NTAPI
446 RxPrepareToReparseSymbolicLink(
447 PRX_CONTEXT RxContext,
448 BOOLEAN SymbolicLinkEmbeddedInOldPath,
449 PUNICODE_STRING NewPath,
450 BOOLEAN NewPathIsAbsolute,
451 PBOOLEAN ReparseRequired);
452
453 VOID
454 RxReference(
455 _Inout_ PVOID Instance);
456
457 VOID
458 RxDereference(
459 _Inout_ PVOID Instance,
460 _In_ LOCK_HOLDING_STATE LockHoldingState);
461
462 VOID
463 RxWaitForStableCondition(
464 _In_ PRX_BLOCK_CONDITION Condition,
465 _Inout_ PLIST_ENTRY TransitionWaitList,
466 _Inout_ PRX_CONTEXT RxContext,
467 _Out_opt_ NTSTATUS *AsyncStatus);
468
469 VOID
470 RxUpdateCondition(
471 _In_ RX_BLOCK_CONDITION NewConditionValue,
472 _Out_ PRX_BLOCK_CONDITION Condition,
473 _In_ OUT PLIST_ENTRY TransitionWaitList);
474
475 #if (_WIN32_WINNT >= 0x0600)
476 NTSTATUS
477 RxCloseAssociatedSrvOpen(
478 _In_opt_ PRX_CONTEXT RxContext,
479 _In_ PFOBX Fobx);
480 #else
481 NTSTATUS
482 RxCloseAssociatedSrvOpen(
483 _In_ PFOBX Fobx,
484 _In_opt_ PRX_CONTEXT RxContext);
485 #endif
486
487 NTSTATUS
488 NTAPI
489 RxFinalizeConnection(
490 _Inout_ PNET_ROOT NetRoot,
491 _Inout_opt_ PV_NET_ROOT VNetRoot,
492 _In_ LOGICAL ForceFilesClosed);
493
494 #if DBG
495 VOID
496 RxDumpWantedAccess(
497 _In_ PSZ where1,
498 _In_ PSZ where2,
499 _In_ PSZ wherelogtag,
500 _In_ ACCESS_MASK DesiredAccess,
501 _In_ ULONG DesiredShareAccess);
502
503 VOID
504 RxDumpCurrentAccess(
505 _In_ PSZ where1,
506 _In_ PSZ where2,
507 _In_ PSZ wherelogtag,
508 _In_ PSHARE_ACCESS ShareAccess);
509 #else
510 #define RxDumpWantedAccess(w1,w2,wlt,DA,DSA) {NOTHING;}
511 #define RxDumpCurrentAccess(w1,w2,wlt,SA) {NOTHING;}
512 #endif
513
514 NTSTATUS
515 RxCheckShareAccessPerSrvOpens(
516 _In_ PFCB Fcb,
517 _In_ ACCESS_MASK DesiredAccess,
518 _In_ ULONG DesiredShareAccess);
519
520 VOID
521 RxUpdateShareAccessPerSrvOpens(
522 _In_ PSRV_OPEN SrvOpen);
523
524 VOID
525 RxRemoveShareAccessPerSrvOpens(
526 _Inout_ PSRV_OPEN SrvOpen);
527
528 #if DBG
529 NTSTATUS
530 RxCheckShareAccess(
531 _In_ ACCESS_MASK DesiredAccess,
532 _In_ ULONG DesiredShareAccess,
533 _Inout_ PFILE_OBJECT FileObject,
534 _Inout_ PSHARE_ACCESS ShareAccess,
535 _In_ BOOLEAN Update,
536 _In_ PSZ where,
537 _In_ PSZ wherelogtag);
538
539 VOID
540 RxRemoveShareAccess(
541 _Inout_ PFILE_OBJECT FileObject,
542 _Inout_ PSHARE_ACCESS ShareAccess,
543 _In_ PSZ where,
544 _In_ PSZ wherelogtag);
545
546 VOID
547 RxSetShareAccess(
548 _In_ ACCESS_MASK DesiredAccess,
549 _In_ ULONG DesiredShareAccess,
550 _Inout_ PFILE_OBJECT FileObject,
551 _Out_ PSHARE_ACCESS ShareAccess,
552 _In_ PSZ where,
553 _In_ PSZ wherelogtag);
554
555 VOID
556 RxUpdateShareAccess(
557 _Inout_ PFILE_OBJECT FileObject,
558 _Inout_ PSHARE_ACCESS ShareAccess,
559 _In_ PSZ where,
560 _In_ PSZ wherelogtag);
561 #else
562 #define RxCheckShareAccess(a1, a2, a3, a4, a5, a6, a7) IoCheckShareAccess(a1, a2, a3, a4, a5)
563 #define RxRemoveShareAccess(a1, a2, a3, a4) IoRemoveShareAccess(a1, a2)
564 #define RxSetShareAccess(a1, a2, a3, a4, a5, a6) IoSetShareAccess(a1, a2, a3, a4)
565 #define RxUpdateShareAccess(a1, a2, a3, a4) IoUpdateShareAccess(a1, a2)
566 #endif
567
568 NTSTATUS
569 NTAPI
570 RxDriverEntry(
571 _In_ PDRIVER_OBJECT DriverObject,
572 _In_ PUNICODE_STRING RegistryPath);
573
574 VOID
575 NTAPI
576 RxUnload(
577 _In_ PDRIVER_OBJECT DriverObject);
578
579 VOID
580 RxInitializeMinirdrDispatchTable(
581 _In_ PDRIVER_OBJECT DriverObject);
582
583 ULONG
584 RxGetNetworkProviderPriority(
585 _In_ PUNICODE_STRING DeviceName);
586
587 VOID
588 RxPrepareRequestForReuse(
589 PCHANGE_BUFFERING_STATE_REQUEST Request);
590
591 VOID
592 RxpDiscardChangeBufferingStateRequests(
593 _Inout_ PLIST_ENTRY DiscardedRequests);
594
595 VOID
596 RxGatherRequestsForSrvOpen(
597 _Inout_ PSRV_CALL SrvCall,
598 _In_ PSRV_OPEN SrvOpen,
599 _Inout_ PLIST_ENTRY RequestsListHead);
600
601 NTSTATUS
602 RxpLookupSrvOpenForRequestLite(
603 _In_ PSRV_CALL SrvCall,
604 _Inout_ PCHANGE_BUFFERING_STATE_REQUEST Request);
605
606 VOID
607 RxProcessChangeBufferingStateRequestsForSrvOpen(
608 PSRV_OPEN SrvOpen);
609
610 NTSTATUS
611 RxPurgeFobxFromCache(
612 PFOBX FobxToBePurged);
613
614 BOOLEAN
615 RxPurgeFobx(
616 PFOBX pFobx);
617
618 VOID
619 RxUndoScavengerFinalizationMarking(
620 PVOID Instance);
621
622 ULONG
623 RxTableComputePathHashValue(
624 _In_ PUNICODE_STRING Name);
625
626 VOID
627 RxExtractServerName(
628 _In_ PUNICODE_STRING FilePathName,
629 _Out_ PUNICODE_STRING SrvCallName,
630 _Out_ PUNICODE_STRING RestOfName);
631
632 VOID
633 NTAPI
634 RxCreateNetRootCallBack(
635 _In_ PMRX_CREATENETROOT_CONTEXT CreateNetRootContext);
636
637 PVOID
638 RxAllocateObject(
639 _In_ NODE_TYPE_CODE NodeType,
640 _In_opt_ PMINIRDR_DISPATCH MRxDispatch,
641 _In_ ULONG NameLength);
642
643 VOID
644 RxFreeObject(
645 _In_ PVOID pObject);
646
647 NTSTATUS
648 RxInitializeSrvCallParameters(
649 _In_ PRX_CONTEXT RxContext,
650 _Inout_ PSRV_CALL SrvCall);
651
652 VOID
653 RxAddVirtualNetRootToNetRoot(
654 _In_ PNET_ROOT NetRoot,
655 _In_ PV_NET_ROOT VNetRoot);
656
657 VOID
658 RxRemoveVirtualNetRootFromNetRoot(
659 _In_ PNET_ROOT NetRoot,
660 _In_ PV_NET_ROOT VNetRoot);
661
662 PVOID
663 RxAllocateFcbObject(
664 _In_ PRDBSS_DEVICE_OBJECT RxDeviceObject,
665 _In_ NODE_TYPE_CODE NodeType,
666 _In_ POOL_TYPE PoolType,
667 _In_ ULONG NameSize,
668 _In_opt_ PVOID AlreadyAllocatedObject);
669
670 VOID
671 RxFreeFcbObject(
672 _In_ PVOID Object);
673
674 VOID
675 RxPurgeFcb(
676 _In_ PFCB Fcb);
677
678 BOOLEAN
679 RxFinalizeNetFcb(
680 _Out_ PFCB ThisFcb,
681 _In_ BOOLEAN RecursiveFinalize,
682 _In_ BOOLEAN ForceFinalize,
683 _In_ LONG ReferenceCount);
684
685 BOOLEAN
686 RxIsThisACscAgentOpen(
687 _In_ PRX_CONTEXT RxContext);
688
689 VOID
690 NTAPI
691 RxCheckFcbStructuresForAlignment(
692 VOID);
693
694 NTSTATUS
695 RxInitializeWorkQueueDispatcher(
696 _In_ PRX_WORK_QUEUE_DISPATCHER Dispatcher);
697
698 VOID
699 RxInitializeWorkQueue(
700 _In_ PRX_WORK_QUEUE WorkQueue,
701 _In_ WORK_QUEUE_TYPE WorkQueueType,
702 _In_ ULONG MaximumNumberOfWorkerThreads,
703 _In_ ULONG MinimumNumberOfWorkerThreads);
704
705 NTSTATUS
706 RxSpinUpWorkerThread(
707 _In_ PRX_WORK_QUEUE WorkQueue,
708 _In_ PRX_WORKERTHREAD_ROUTINE Routine,
709 _In_ PVOID Parameter);
710
711 VOID
712 RxSpinUpWorkerThreads(
713 _In_ PRX_WORK_QUEUE WorkQueue);
714
715 VOID
716 NTAPI
717 RxSpinUpRequestsDispatcher(
718 _In_ PVOID Dispatcher);
719
720 VOID
721 RxpWorkerThreadDispatcher(
722 _In_ PRX_WORK_QUEUE WorkQueue,
723 _In_ PLARGE_INTEGER WaitInterval);
724
725 VOID
726 NTAPI
727 RxBootstrapWorkerThreadDispatcher(
728 _In_ PVOID WorkQueue);
729
730 PRX_PREFIX_ENTRY
731 RxTableLookupName_ExactLengthMatch(
732 _In_ PRX_PREFIX_TABLE ThisTable,
733 _In_ PUNICODE_STRING Name,
734 _In_ ULONG HashValue,
735 _In_opt_ PRX_CONNECTION_ID RxConnectionId);
736
737 PVOID
738 RxTableLookupName(
739 _In_ PRX_PREFIX_TABLE ThisTable,
740 _In_ PUNICODE_STRING Name,
741 _Out_ PUNICODE_STRING RemainingName,
742 _In_opt_ PRX_CONNECTION_ID RxConnectionId);
743
744 VOID
745 RxOrphanSrvOpens(
746 _In_ PV_NET_ROOT ThisVNetRoot);
747
748 VOID
749 RxOrphanThisFcb(
750 _In_ PFCB Fcb);
751
752 VOID
753 RxOrphanSrvOpensForThisFcb(
754 _In_ PFCB Fcb,
755 _In_ PV_NET_ROOT ThisVNetRoot,
756 _In_ BOOLEAN OrphanAll);
757
758 #define RxEqualConnectionId(C1, C2) RtlEqualMemory(C1, C2, sizeof(RX_CONNECTION_ID))
759
760 NTSTATUS
761 NTAPI
762 RxLockOperationCompletion(
763 _In_ PVOID Context,
764 _In_ PIRP Irp);
765
766 VOID
767 NTAPI
768 RxUnlockOperation(
769 _In_ PVOID Context,
770 _In_ PFILE_LOCK_INFO LockInfo);
771
772 #if (_WIN32_WINNT >= 0x0600)
773 NTSTATUS
774 RxPostStackOverflowRead(
775 _In_ PRX_CONTEXT RxContext,
776 _In_ PFCB Fcb);
777 #else
778 NTSTATUS
779 RxPostStackOverflowRead(
780 _In_ PRX_CONTEXT RxContext);
781 #endif
782
783 VOID
784 NTAPI
785 RxCancelRoutine(
786 _In_ PDEVICE_OBJECT DeviceObject,
787 _In_ PIRP Irp);
788
789 #ifdef __REACTOS__
790 #define RxWriteCacheingAllowed(F, S) ( \
791 BooleanFlagOn((F)->FcbState, FCB_STATE_WRITECACHING_ENABLED) && \
792 !BooleanFlagOn((S)->Flags, SRVOPEN_FLAG_DONTUSE_WRITE_CACHING))
793 #endif
794
795 #endif