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