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