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