xref: /reactos/sdk/include/ddk/lowio.h (revision c2c66aff)
1 #ifndef _RXLOWIO_
2 #define _RXLOWIO_
3 
4 #include "mrx.h"
5 
6 extern FAST_MUTEX RxLowIoPagingIoSyncMutex;
7 
8 #define RxLowIoIsMdlLocked(MDL) (RxMdlIsLocked((MDL)) || RxMdlSourceIsNonPaged((MDL)))
9 
10 #define RxLowIoIsBufferLocked(LowIoContext)                              \
11     (((LowIoContext)->Operation > LOWIO_OP_WRITE) ||                     \
12      ((LowIoContext)->ParamsFor.ReadWrite.Buffer == NULL) ||             \
13      (((LowIoContext)->ParamsFor.ReadWrite.Buffer != NULL) &&            \
14        RxLowIoIsMdlLocked(((LowIoContext)->ParamsFor.ReadWrite.Buffer))))
15 
16 
17 typedef struct _LOWIO_PER_FCB_INFO
18 {
19     LIST_ENTRY PagingIoReadsOutstanding;
20     LIST_ENTRY PagingIoWritesOutstanding;
21 } LOWIO_PER_FCB_INFO, *PLOWIO_PER_FCB_INFO;
22 
23 #if (_WIN32_WINNT >= 0x0600)
24 NTSTATUS
25 NTAPI
26 RxLowIoPopulateFsctlInfo(
27     _In_ PRX_CONTEXT RxContext,
28     _In_ PIRP Irp);
29 #else
30 NTSTATUS
31 NTAPI
32 RxLowIoPopulateFsctlInfo(
33     _In_ PRX_CONTEXT RxContext);
34 #endif
35 
36 #if (_WIN32_WINNT >= 0x0600)
37 NTSTATUS
38 NTAPI
39 RxLowIoSubmit(
40     _In_ PRX_CONTEXT RxContext,
41     _In_ PIRP Irp,
42     _In_ PFCB Fcb,
43     _In_ PLOWIO_COMPLETION_ROUTINE CompletionRoutine);
44 #else
45 NTSTATUS
46 NTAPI
47 RxLowIoSubmit(
48     _In_ PRX_CONTEXT RxContext,
49     _In_ PLOWIO_COMPLETION_ROUTINE CompletionRoutine);
50 #endif
51 
52 NTSTATUS
53 NTAPI
54 RxLowIoCompletion(
55     _In_ PRX_CONTEXT RxContext);
56 
57 #if (_WIN32_WINNT >= 0x0600)
58 VOID
59 NTAPI
60 RxInitializeLowIoContext(
61     _In_ PRX_CONTEXT RxContext,
62     _In_ ULONG Operation,
63     _Out_ PLOWIO_CONTEXT LowIoContext);
64 #else
65 VOID
66 NTAPI
67 RxInitializeLowIoContext(
68     _Out_ PLOWIO_CONTEXT LowIoContext,
69     _In_ ULONG Operation);
70 #endif
71 
72 VOID
73 RxInitializeLowIoPerFcbInfo(
74     _Inout_ PLOWIO_PER_FCB_INFO LowIoPerFcbInfo);
75 
76 #endif
77