xref: /reactos/drivers/filesystems/mup/mup.h (revision 845faec4)
1 #ifndef _MUP_PCH_
2 #define _MUP_PCH_
3 
4 #include <wdm.h>
5 #include <ntifs.h>
6 #include <pseh/pseh2.h>
7 #include <ndk/muptypes.h>
8 
9 #ifdef __GNUC__
10 #define INIT_SECTION __attribute__((section ("INIT")))
11 #else
12 #define INIT_SECTION /* Done via alloc_text for MSC */
13 #endif
14 
15 #define ROUND_UP(N, S) ((((N) + (S) - 1) / (S)) * (S))
16 #define IO_METHOD_FROM_CTL_CODE(C) (C & 0x00000003)
17 
18 #define TAG_MUP ' puM'
19 
20 #define FILE_SIMPLE_RIGHTS_MASK (FILE_ALL_ACCESS & ~STANDARD_RIGHTS_REQUIRED &~ SYNCHRONIZE)
21 
22 #define NODE_TYPE_VCB 0x1
23 #define NODE_TYPE_UNC 0x2
24 #define NODE_TYPE_PFX 0x3
25 #define NODE_TYPE_FCB 0x4
26 #define NODE_TYPE_CCB 0x5
27 #define NODE_TYPE_MIC 0x6
28 #define NODE_TYPE_MQC 0x8
29 
30 #define NODE_STATUS_HEALTHY 0x1
31 #define NODE_STATUS_CLEANUP 0x2
32 
33 typedef struct _MUP_VCB
34 {
35     ULONG NodeType;
36     ULONG NodeStatus;
37     LONG NodeReferences;
38     ULONG NodeSize;
39     SHARE_ACCESS ShareAccess;
40 } MUP_VCB, *PMUP_VCB;
41 
42 typedef struct _MUP_FCB
43 {
44     ULONG NodeType;
45     ULONG NodeStatus;
46     LONG NodeReferences;
47     ULONG NodeSize;
48     PFILE_OBJECT FileObject;
49     LIST_ENTRY CcbList;
50 } MUP_FCB, *PMUP_FCB;
51 
52 typedef struct _MUP_CCB
53 {
54     ULONG NodeType;
55     ULONG NodeStatus;
56     LONG NodeReferences;
57     ULONG NodeSize;
58     PMUP_FCB Fcb;
59     LIST_ENTRY CcbListEntry;
60     PDEVICE_OBJECT DeviceObject;
61     PFILE_OBJECT FileObject;
62 } MUP_CCB, *PMUP_CCB;
63 
64 typedef struct _MUP_MIC
65 {
66     ULONG NodeType;
67     ULONG NodeStatus;
68     LONG NodeReferences;
69     ULONG NodeSize;
70     PIRP Irp;
71     NTSTATUS LastSuccess;
72     NTSTATUS LastFailed;
73     PMUP_FCB Fcb;
74 } MUP_MIC, *PMUP_MIC;
75 
76 typedef struct _MUP_UNC
77 {
78     ULONG NodeType;
79     ULONG NodeStatus;
80     LONG NodeReferences;
81     ULONG NodeSize;
82     LIST_ENTRY ProviderListEntry;
83     UNICODE_STRING DeviceName;
84     HANDLE DeviceHandle;
85     PDEVICE_OBJECT DeviceObject;
86     PFILE_OBJECT FileObject;
87     ULONG ProviderOrder;
88     BOOLEAN MailslotsSupported;
89     BOOLEAN Registered;
90 } MUP_UNC, *PMUP_UNC;
91 
92 typedef struct _MUP_PFX
93 {
94     ULONG NodeType;
95     ULONG NodeStatus;
96     LONG NodeReferences;
97     ULONG NodeSize;
98     UNICODE_PREFIX_TABLE_ENTRY PrefixTableEntry;
99     UNICODE_STRING AcceptedPrefix;
100     ULONG Reserved;
101     LARGE_INTEGER ValidityTimeout;
102     PMUP_UNC UncProvider;
103     BOOLEAN ExternalAlloc;
104     BOOLEAN InTable;
105     BOOLEAN KeepExtraRef;
106     BOOLEAN Padding;
107     LIST_ENTRY PrefixListEntry;
108 } MUP_PFX, *PMUP_PFX;
109 
110 typedef struct _MUP_MQC
111 {
112     ULONG NodeType;
113     ULONG NodeStatus;
114     LONG NodeReferences;
115     ULONG NodeSize;
116     PIRP Irp;
117     PFILE_OBJECT FileObject;
118     PMUP_UNC LatestProvider;
119     ERESOURCE QueryPathListLock;
120     PMUP_PFX Prefix;
121     NTSTATUS LatestStatus;
122     LIST_ENTRY QueryPathList;
123     LIST_ENTRY MQCListEntry;
124 } MUP_MQC, *PMUP_MQC;
125 
126 typedef struct _FORWARDED_IO_CONTEXT
127 {
128     PMUP_CCB Ccb;
129     PMUP_MIC MasterIoContext;
130     WORK_QUEUE_ITEM WorkQueueItem;
131     PDEVICE_OBJECT DeviceObject;
132     PIRP Irp;
133 } FORWARDED_IO_CONTEXT, *PFORWARDED_IO_CONTEXT;
134 
135 typedef struct _QUERY_PATH_CONTEXT
136 {
137     PMUP_MQC MasterQueryContext;
138     PMUP_UNC UncProvider;
139     PQUERY_PATH_REQUEST QueryPathRequest;
140     LIST_ENTRY QueryPathListEntry;
141     PIRP Irp;
142 } QUERY_PATH_CONTEXT, *PQUERY_PATH_CONTEXT;
143 
144 #include "dfs.h"
145 
146 #endif /* _MUP_PCH_ */
147