0bdcf57ccb4f665bd55d24e0590e3a863dee52d2
[reactos.git] / include / ddk / mountmgr.h
1
2 #ifndef _MOUNTMGR_
3 #define _MOUNTMGR_
4
5 DEFINE_GUID(MOUNTDEV_MOUNTED_DEVICE_GUID, 0x53F5630D, 0xB6BF, 0x11D0, 0x94, 0xF2, 0x00, 0xA0, 0xC9, 0x1E, 0xFB, 0x8B);
6
7 #define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager"
8 #define MOUNTMGR_DOS_DEVICE_NAME L"\\\\.\\MountPointManager"
9 #define MOUNTMGRCONTROLTYPE ((ULONG) 'm')
10 #define MOUNTDEVCONTROLTYPE ((ULONG) 'M')
11
12 #define IOCTL_MOUNTMGR_CREATE_POINT \
13 CTL_CODE(MOUNTMGRCONTROLTYPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
14 #define IOCTL_MOUNTMGR_DELETE_POINTS \
15 CTL_CODE(MOUNTMGRCONTROLTYPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
16 #define IOCTL_MOUNTMGR_QUERY_POINTS \
17 CTL_CODE(MOUNTMGRCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
18 #define IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY \
19 CTL_CODE(MOUNTMGRCONTROLTYPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
20 #define IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER \
21 CTL_CODE(MOUNTMGRCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
22 #define IOCTL_MOUNTMGR_AUTO_DL_ASSIGNMENTS \
23 CTL_CODE(MOUNTMGRCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
24 #define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED \
25 CTL_CODE(MOUNTMGRCONTROLTYPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
26 #define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED \
27 CTL_CODE(MOUNTMGRCONTROLTYPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
28 #define IOCTL_MOUNTMGR_CHANGE_NOTIFY \
29 CTL_CODE(MOUNTMGRCONTROLTYPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS)
30 #define IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE \
31 CTL_CODE(MOUNTMGRCONTROLTYPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
32 #define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES \
33 CTL_CODE(MOUNTMGRCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS)
34 #define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION \
35 CTL_CODE(MOUNTMGRCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS)
36 #define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATH \
37 CTL_CODE(MOUNTMGRCONTROLTYPE, 12, METHOD_BUFFERED, FILE_ANY_ACCESS)
38 #define IOCTL_MOUNTMGR_QUERY_DOS_VOLUME_PATHS \
39 CTL_CODE(MOUNTMGRCONTROLTYPE, 13, METHOD_BUFFERED, FILE_ANY_ACCESS)
40 #define IOCTL_MOUNTDEV_QUERY_DEVICE_NAME \
41 CTL_CODE(MOUNTDEVCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
42
43 typedef struct _MOUNTDEV_NAME
44 {
45 USHORT NameLength;
46 WCHAR Name[1];
47 } MOUNTDEV_NAME, *PMOUNTDEV_NAME;
48
49 typedef struct _MOUNTMGR_MOUNT_POINT
50 {
51 ULONG SymbolicLinkNameOffset;
52 USHORT SymbolicLinkNameLength;
53 ULONG UniqueIdOffset;
54 USHORT UniqueIdLength;
55 ULONG DeviceNameOffset;
56 USHORT DeviceNameLength;
57 } MOUNTMGR_MOUNT_POINT, *PMOUNTMGR_MOUNT_POINT;
58
59 typedef struct _MOUNTMGR_CREATE_POINT_INPUT
60 {
61 USHORT SymbolicLinkNameOffset;
62 USHORT SymbolicLinkNameLength;
63 USHORT DeviceNameOffset;
64 USHORT DeviceNameLength;
65 } MOUNTMGR_CREATE_POINT_INPUT, *PMOUNTMGR_CREATE_POINT_INPUT;
66
67 typedef struct _MOUNTMGR_MOUNT_POINTS
68 {
69 ULONG Size;
70 ULONG NumberOfMountPoints;
71 MOUNTMGR_MOUNT_POINT MountPoints[1];
72 } MOUNTMGR_MOUNT_POINTS, *PMOUNTMGR_MOUNT_POINTS;
73
74 typedef struct _MOUNTMGR_DRIVE_LETTER_INFORMATION
75 {
76 BOOLEAN DriveLetterWasAssigned;
77 UCHAR CurrentDriveLetter;
78 } MOUNTMGR_DRIVE_LETTER_INFORMATION, *PMOUNTMGR_DRIVE_LETTER_INFORMATION;
79
80 typedef struct _MOUNTMGR_DRIVE_LETTER_TARGET
81 {
82 USHORT DeviceNameLength;
83 WCHAR DeviceName[1];
84 } MOUNTMGR_DRIVE_LETTER_TARGET, *PMOUNTMGR_DRIVE_LETTER_TARGET;
85
86 typedef struct _MOUNTMGR_CHANGE_NOTIFY_INFO {
87 ULONG EpicNumber;
88 } MOUNTMGR_CHANGE_NOTIFY_INFO, *PMOUNTMGR_CHANGE_NOTIFY_INFO;
89
90 typedef struct _MOUNTMGR_VOLUME_MOUNT_POINT
91 {
92 USHORT SourceVolumeNameOffset;
93 USHORT SourceVolumeNameLength;
94 USHORT TargetVolumeNameOffset;
95 USHORT TargetVolumeNameLength;
96 } MOUNTMGR_VOLUME_MOUNT_POINT, *PMOUNTMGR_VOLUME_MOUNT_POINT;
97
98 typedef struct _MOUNTMGR_TARGET_NAME
99 {
100 USHORT DeviceNameLength;
101 WCHAR DeviceName[1];
102 } MOUNTMGR_TARGET_NAME, *PMOUNTMGR_TARGET_NAME;
103
104 typedef struct _MOUNTMGR_VOLUME_PATHS
105 {
106 ULONG MultiSzLength;
107 WCHAR MultiSz[1];
108 } MOUNTMGR_VOLUME_PATHS, *PMOUNTMGR_VOLUME_PATHS;
109
110 #define MOUNTMGR_IS_DRIVE_LETTER(s) ((s)->Length == 28 && (s)->Buffer[0] == '\\' && (s)->Buffer[1] == 'D' && \
111 (s)->Buffer[2] == 'o' && (s)->Buffer[3] == 's' && (s)->Buffer[4] == 'D' && \
112 (s)->Buffer[5] == 'e' && \ (s)->Buffer[6] == 'v' && (s)->Buffer[7] == 'i' && \
113 (s)->Buffer[8] == 'c' && (s)->Buffer[9] == 'e' && (s)->Buffer[10] == 's' && \
114 (s)->Buffer[11] == '\\' && (s)->Buffer[12] >= 'A' && \
115 (s)->Buffer[12] <= 'Z' && (s)->Buffer[13] == ':')
116
117 #define MOUNTMGR_IS_VOLUME_NAME(s) (((s)->Length == 96 || ((s)->Length == 98 && (s)->Buffer[48] == '\\')) && \
118 (s)->Buffer[0] == '\\'&& ((s)->Buffer[1] == '?' || (s)->Buffer[1] == '\\') && \
119 (s)->Buffer[2] == '?' && (s)->Buffer[3] == '\\' && (s)->Buffer[4] == 'V' && \
120 (s)->Buffer[5] == 'o' && (s)->Buffer[6] == 'l' && (s)->Buffer[7] == 'u' && \
121 (s)->Buffer[8] == 'm' && (s)->Buffer[9] == 'e' && (s)->Buffer[10] == '{' && \
122 (s)->Buffer[19] == '-' && (s)->Buffer[24] == '-' && (s)->Buffer[29] == '-' && \
123 (s)->Buffer[34] == '-' && (s)->Buffer[47] == '}')
124
125 #define MOUNTMGR_IS_DOS_VOLUME_NAME(s) (MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 96 && (s)->Buffer[1] == '\\')
126 #define MOUNTMGR_IS_DOS_VOLUME_NAME_WB(s) (MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 98 && (s)->Buffer[1] == '\\')
127 #define MOUNTMGR_IS_NT_VOLUME_NAME(s) ( MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 96 && (s)->Buffer[1] == '?')
128 #define MOUNTMGR_IS_NT_VOLUME_NAME_WB(s) (MOUNTMGR_IS_VOLUME_NAME(s) && (s)->Length == 98 && (s)->Buffer[1] == '?')
129 #endif
130