d2a3a30092d0e59c8e94ffde1061530446c8e197
[reactos.git] / reactos / include / ddk / mountmgr.h
1 #ifndef _MOUNTMGR_
2 #define _MOUNTMGR_
3
4 #if (NTDDI_VERSION >= NTDDI_WIN2K)
5
6 #if defined(DEFINE_GUID)
7 DEFINE_GUID(MOUNTDEV_MOUNTED_DEVICE_GUID, 0x53F5630D, 0xB6BF, 0x11D0, 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B);
8 #endif
9
10 #define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager"
11 #define MOUNTMGR_DOS_DEVICE_NAME L"\\\\.\\MountPointManager"
12 #define MOUNTMGRCONTROLTYPE ((ULONG) 'm')
13 #define MOUNTDEVCONTROLTYPE ((ULONG) 'M')
14
15 #define IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 32, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
16 #define IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 33, METHOD_BUFFERED, FILE_READ_ACCESS)
17
18 struct mountmgr_unix_drive
19 {
20 ULONG size;
21 ULONG type;
22 WCHAR letter;
23 USHORT mount_point_offset;
24 USHORT device_offset;
25 };
26
27 #define IOCTL_MOUNTMGR_CREATE_POINT \
28 CTL_CODE(MOUNTMGRCONTROLTYPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
29 #define IOCTL_MOUNTMGR_DELETE_POINTS \
30 CTL_CODE(MOUNTMGRCONTROLTYPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
31 #define IOCTL_MOUNTMGR_QUERY_POINTS \
32 CTL_CODE(MOUNTMGRCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
33 #define IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY \
34 CTL_CODE(MOUNTMGRCONTROLTYPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
35 #define IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER \
36 CTL_CODE(MOUNTMGRCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
37 #define IOCTL_MOUNTMGR_AUTO_DL_ASSIGNMENTS \
38 CTL_CODE(MOUNTMGRCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
39 #define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED \
40 CTL_CODE(MOUNTMGRCONTROLTYPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
41 #define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED \
42 CTL_CODE(MOUNTMGRCONTROLTYPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
43 #define IOCTL_MOUNTMGR_CHANGE_NOTIFY \
44 CTL_CODE(MOUNTMGRCONTROLTYPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS)
45 #define IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE \
46 CTL_CODE(MOUNTMGRCONTROLTYPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
47 #define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES \
48 CTL_CODE(MOUNTMGRCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS)
49 #define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION \
50 CTL_CODE(MOUNTMGRCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS)
51 #define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME \
52 CTL_CODE(MOUNTDEVCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
53
54 #define MOUNTMGR_IS_DRIVE_LETTER(s) ((s)->Length == 28 && (s)->Buffer[0] == '\\' && (s)->Buffer[1] == 'D' && \
55 (s)->Buffer[2] == 'o' && (s)->Buffer[3] == 's' && (s)->Buffer[4] == 'D' && \
56 (s)->Buffer[5] == 'e' && \ (s)->Buffer[6] == 'v' && (s)->Buffer[7] == 'i' && \
57 (s)->Buffer[8] == 'c' && (s)->Buffer[9] == 'e' && (s)->Buffer[10] == 's' && \
58 (s)->Buffer[11] == '\\' && (s)->Buffer[12] >= 'A' && \
59 (s)->Buffer[12] <= 'Z' && (s)->Buffer[13] == ':')
60
61 #define MOUNTMGR_IS_VOLUME_NAME(s) (((s)->Length == 96 || ((s)->Length == 98 && (s)->Buffer[48] == '\\')) && \
62 (s)->Buffer[0] == '\\'&& ((s)->Buffer[1] == '?' || (s)->Buffer[1] == '\\') && \
63 (s)->Buffer[2] == '?' && (s)->Buffer[3] == '\\' && (s)->Buffer[4] == 'V' && \
64 (s)->Buffer[5] == 'o' && (s)->Buffer[6] == 'l' && (s)->Buffer[7] == 'u' && \
65 (s)->Buffer[8] == 'm' && (s)->Buffer[9] == 'e' && (s)->Buffer[10] == '{' && \
66 (s)->Buffer[19] == '-' && (s)->Buffer[24] == '-' && (s)->Buffer[29] == '-' && \
67 (s)->Buffer[34] == '-' && (s)->Buffer[47] == '}')
68
69 typedef struct _MOUNTMGR_CREATE_POINT_INPUT {
70 USHORT SymbolicLinkNameOffset;
71 USHORT SymbolicLinkNameLength;
72 USHORT DeviceNameOffset;
73 USHORT DeviceNameLength;
74 } MOUNTMGR_CREATE_POINT_INPUT, *PMOUNTMGR_CREATE_POINT_INPUT;
75
76 typedef struct _MOUNTMGR_MOUNT_POINT {
77 ULONG SymbolicLinkNameOffset;
78 USHORT SymbolicLinkNameLength;
79 ULONG UniqueIdOffset;
80 USHORT UniqueIdLength;
81 ULONG DeviceNameOffset;
82 USHORT DeviceNameLength;
83 } MOUNTMGR_MOUNT_POINT, *PMOUNTMGR_MOUNT_POINT;
84
85 typedef struct _MOUNTMGR_MOUNT_POINTS {
86 ULONG Size;
87 ULONG NumberOfMountPoints;
88 MOUNTMGR_MOUNT_POINT MountPoints[1];
89 } MOUNTMGR_MOUNT_POINTS, *PMOUNTMGR_MOUNT_POINTS;
90
91 typedef struct _MOUNTMGR_DRIVE_LETTER_TARGET {
92 USHORT DeviceNameLength;
93 WCHAR DeviceName[1];
94 } MOUNTMGR_DRIVE_LETTER_TARGET, *PMOUNTMGR_DRIVE_LETTER_TARGET;
95
96 typedef struct _MOUNTMGR_DRIVE_LETTER_INFORMATION {
97 BOOLEAN DriveLetterWasAssigned;
98 UCHAR CurrentDriveLetter;
99 } MOUNTMGR_DRIVE_LETTER_INFORMATION, *PMOUNTMGR_DRIVE_LETTER_INFORMATION;
100
101 typedef struct _MOUNTMGR_VOLUME_MOUNT_POINT {
102 USHORT SourceVolumeNameOffset;
103 USHORT SourceVolumeNameLength;
104 USHORT TargetVolumeNameOffset;
105 USHORT TargetVolumeNameLength;
106 } MOUNTMGR_VOLUME_MOUNT_POINT, *PMOUNTMGR_VOLUME_MOUNT_POINT;
107
108 typedef struct _MOUNTMGR_CHANGE_NOTIFY_INFO {
109 ULONG EpicNumber;
110 } MOUNTMGR_CHANGE_NOTIFY_INFO, *PMOUNTMGR_CHANGE_NOTIFY_INFO;
111
112 typedef struct _MOUNTMGR_TARGET_NAME {
113 USHORT DeviceNameLength;
114 WCHAR DeviceName[1];
115 } MOUNTMGR_TARGET_NAME, *PMOUNTMGR_TARGET_NAME;
116
117 typedef struct _MOUNTDEV_NAME {
118 USHORT NameLength;
119 WCHAR Name[1];
120 } MOUNTDEV_NAME, *PMOUNTDEV_NAME;
121
122 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
123
124 #if (NTDDI_VERSION >= NTDDI_WINXP)
125
126 #define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH \
127 CTL_CODE(MOUNTMGRCONTROLTYPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
128 #define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS \
129 CTL_CODE(MOUNTMGRCONTROLTYPE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
130
131 #define MOUNTMGR_IS_DOS_VOLUME_NAME(s) (MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 96 && (s)->Buffer[1] == '\\')
132 #define MOUNTMGR_IS_DOS_VOLUME_NAME_WB(s) (MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 98 && (s)->Buffer[1] == '\\')
133 #define MOUNTMGR_IS_NT_VOLUME_NAME(s) ( MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 96 && (s)->Buffer[1] == '?')
134 #define MOUNTMGR_IS_NT_VOLUME_NAME_WB(s) (MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 98 && (s)->Buffer[1] == '?')
135
136 typedef struct _MOUNTMGR_VOLUME_PATHS {
137 ULONG MultiSzLength;
138 WCHAR MultiSz[1];
139 } MOUNTMGR_VOLUME_PATHS, *PMOUNTMGR_VOLUME_PATHS;
140
141 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
142
143 #if (NTDDI_VERSION >= NTDDI_WS03)
144
145 #define IOCTL_MOUNTMGR_SCRUB_REGISTRY \
146 CTL_CODE(MOUNTMGRCONTROLTYPE, 14, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
147 #define IOCTL_MOUNTMGR_QUERY_AUTO_MOUNT \
148 CTL_CODE(MOUNTMGRCONTROLTYPE, 15, METHOD_BUFFERED, FILE_ANY_ACCESS)
149 #define IOCTL_MOUNTMGR_SET_AUTO_MOUNT \
150 CTL_CODE(MOUNTMGRCONTROLTYPE, 16, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
151
152 typedef enum _MOUNTMGR_AUTO_MOUNT_STATE {
153 Disabled = 0,
154 Enabled
155 } MOUNTMGR_AUTO_MOUNT_STATE;
156
157 typedef struct _MOUNTMGR_QUERY_AUTO_MOUNT {
158 MOUNTMGR_AUTO_MOUNT_STATE CurrentState;
159 } MOUNTMGR_QUERY_AUTO_MOUNT, *PMOUNTMGR_QUERY_AUTO_MOUNT;
160
161 typedef struct _MOUNTMGR_SET_AUTO_MOUNT {
162 MOUNTMGR_AUTO_MOUNT_STATE NewState;
163 } MOUNTMGR_SET_AUTO_MOUNT, *PMOUNTMGR_SET_AUTO_MOUNT;
164
165 #endif /* (NTDDI_VERSION >= NTDDI_WS03) */
166
167 #if (NTDDI_VERSION >= NTDDI_WIN7)
168
169 #define IOCTL_MOUNTMGR_BOOT_DL_ASSIGNMENT \
170 CTL_CODE(MOUNTMGRCONTROLTYPE, 17, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
171 #define IOCTL_MOUNTMGR_TRACELOG_CACHE \
172 CTL_CODE(MOUNTMGRCONTROLTYPE, 18, METHOD_BUFFERED, FILE_READ_ACCESS)
173
174 #endif
175
176 #endif /* _MOUNTMGR_ */
177