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