1 | /*
|
---|
2 | * Mount point manager definitions
|
---|
3 | *
|
---|
4 | * Copyright 2007 Alexandre Julliard
|
---|
5 | *
|
---|
6 | * This library is free software; you can redistribute it and/or
|
---|
7 | * modify it under the terms of the GNU Lesser General Public
|
---|
8 | * License as published by the Free Software Foundation; either
|
---|
9 | * version 2.1 of the License, or (at your option) any later version.
|
---|
10 | *
|
---|
11 | * This library is distributed in the hope that it will be useful,
|
---|
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
---|
14 | * Lesser General Public License for more details.
|
---|
15 | *
|
---|
16 | * You should have received a copy of the GNU Lesser General Public
|
---|
17 | * License along with this library; if not, write to the Free Software
|
---|
18 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
---|
19 | */
|
---|
20 |
|
---|
21 | /*
|
---|
22 | * Oracle LGPL Disclaimer: For the avoidance of doubt, except that if any license choice
|
---|
23 | * other than GPL or LGPL is available it will apply instead, Oracle elects to use only
|
---|
24 | * the Lesser General Public License version 2.1 (LGPLv2) at this time for any software where
|
---|
25 | * a choice of LGPL license versions is made available with the language indicating
|
---|
26 | * that LGPLv2 or any later version may be used, or where a choice of which version
|
---|
27 | * of the LGPL is applied is otherwise unspecified.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef _MOUNTMGR_
|
---|
31 | #define _MOUNTMGR_
|
---|
32 |
|
---|
33 | #define MOUNTMGRCONTROLTYPE ((ULONG)'m')
|
---|
34 | #define MOUNTDEVCONTROLTYPE ((ULONG)'M')
|
---|
35 |
|
---|
36 | #if defined(__GNUC__)
|
---|
37 | #define MOUNTMGR_DEVICE_NAME (const WCHAR []){'\\','D','e','v','i','c','e','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0}
|
---|
38 | #define MOUNTMGR_DOS_DEVICE_NAME (const WCHAR []){'\\','\\','.','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0}
|
---|
39 | #elif defined(_MSC_VER)
|
---|
40 | #define MOUNTMGR_DEVICE_NAME L"\\Device\\MountPointManager"
|
---|
41 | #define MOUNTMGR_DOS_DEVICE_NAME L"\\\\.\\MountPointManager"
|
---|
42 | #else
|
---|
43 | static const WCHAR MOUNTMGR_DEVICE_NAME[] = {'\\','D','e','v','i','c','e','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0};
|
---|
44 | static const WCHAR MOUNTMGR_DOS_DEVICE_NAME[] = {'\\','\\','.','\\','M','o','u','n','t','P','o','i','n','t','M','a','n','a','g','e','r',0};
|
---|
45 | #endif
|
---|
46 |
|
---|
47 |
|
---|
48 | #define IOCTL_MOUNTMGR_CREATE_POINT CTL_CODE(MOUNTMGRCONTROLTYPE, 0, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
49 | #define IOCTL_MOUNTMGR_DELETE_POINTS CTL_CODE(MOUNTMGRCONTROLTYPE, 1, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
50 | #define IOCTL_MOUNTMGR_QUERY_POINTS CTL_CODE(MOUNTMGRCONTROLTYPE, 2, METHOD_BUFFERED, FILE_ANY_ACCESS)
|
---|
51 | #define IOCTL_MOUNTMGR_DELETE_POINTS_DBONLY CTL_CODE(MOUNTMGRCONTROLTYPE, 3, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
52 | #define IOCTL_MOUNTMGR_NEXT_DRIVE_LETTER CTL_CODE(MOUNTMGRCONTROLTYPE, 4, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
53 | #define IOCTL_MOUNTMGR_AUTO_DL_ASSIGNMENTS CTL_CODE(MOUNTMGRCONTROLTYPE, 5, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
54 | #define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_CREATED CTL_CODE(MOUNTMGRCONTROLTYPE, 6, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
55 | #define IOCTL_MOUNTMGR_VOLUME_MOUNT_POINT_DELETED CTL_CODE(MOUNTMGRCONTROLTYPE, 7, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
56 | #define IOCTL_MOUNTMGR_CHANGE_NOTIFY CTL_CODE(MOUNTMGRCONTROLTYPE, 8, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
57 | #define IOCTL_MOUNTMGR_KEEP_LINKS_WHEN_OFFLINE CTL_CODE(MOUNTMGRCONTROLTYPE, 9, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
58 | #define IOCTL_MOUNTMGR_CHECK_UNPROCESSED_VOLUMES CTL_CODE(MOUNTMGRCONTROLTYPE, 10, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
59 | #define IOCTL_MOUNTMGR_VOLUME_ARRIVAL_NOTIFICATION CTL_CODE(MOUNTMGRCONTROLTYPE, 11, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
60 |
|
---|
61 | /* Wine extensions */
|
---|
62 | #ifdef WINE_MOUNTMGR_EXTENSIONS
|
---|
63 |
|
---|
64 | #define IOCTL_MOUNTMGR_DEFINE_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 32, METHOD_BUFFERED, FILE_READ_ACCESS | FILE_WRITE_ACCESS)
|
---|
65 | #define IOCTL_MOUNTMGR_QUERY_UNIX_DRIVE CTL_CODE(MOUNTMGRCONTROLTYPE, 33, METHOD_BUFFERED, FILE_READ_ACCESS)
|
---|
66 |
|
---|
67 | struct mountmgr_unix_drive
|
---|
68 | {
|
---|
69 | ULONG size;
|
---|
70 | ULONG type;
|
---|
71 | WCHAR letter;
|
---|
72 | USHORT mount_point_offset;
|
---|
73 | USHORT device_offset;
|
---|
74 | };
|
---|
75 |
|
---|
76 | #endif
|
---|
77 |
|
---|
78 | typedef struct _MOUNTMGR_CREATE_POINT_INPUT
|
---|
79 | {
|
---|
80 | USHORT SymbolicLinkNameOffset;
|
---|
81 | USHORT SymbolicLinkNameLength;
|
---|
82 | USHORT DeviceNameOffset;
|
---|
83 | USHORT DeviceNameLength;
|
---|
84 | } MOUNTMGR_CREATE_POINT_INPUT, *PMOUNTMGR_CREATE_POINT_INPUT;
|
---|
85 |
|
---|
86 | typedef struct _MOUNTMGR_MOUNT_POINT
|
---|
87 | {
|
---|
88 | ULONG SymbolicLinkNameOffset;
|
---|
89 | USHORT SymbolicLinkNameLength;
|
---|
90 | ULONG UniqueIdOffset;
|
---|
91 | USHORT UniqueIdLength;
|
---|
92 | ULONG DeviceNameOffset;
|
---|
93 | USHORT DeviceNameLength;
|
---|
94 | } MOUNTMGR_MOUNT_POINT, *PMOUNTMGR_MOUNT_POINT;
|
---|
95 |
|
---|
96 | typedef struct _MOUNTMGR_MOUNT_POINTS
|
---|
97 | {
|
---|
98 | ULONG Size;
|
---|
99 | ULONG NumberOfMountPoints;
|
---|
100 | MOUNTMGR_MOUNT_POINT MountPoints[1];
|
---|
101 | } MOUNTMGR_MOUNT_POINTS, *PMOUNTMGR_MOUNT_POINTS;
|
---|
102 |
|
---|
103 | typedef struct _MOUNTMGR_DRIVE_LETTER_TARGET
|
---|
104 | {
|
---|
105 | USHORT DeviceNameLength;
|
---|
106 | WCHAR DeviceName[1];
|
---|
107 | } MOUNTMGR_DRIVE_LETTER_TARGET, *PMOUNTMGR_DRIVE_LETTER_TARGET;
|
---|
108 |
|
---|
109 | typedef struct _MOUNTMGR_DRIVE_LETTER_INFORMATION
|
---|
110 | {
|
---|
111 | BOOLEAN DriveLetterWasAssigned;
|
---|
112 | UCHAR CurrentDriveLetter;
|
---|
113 | } MOUNTMGR_DRIVE_LETTER_INFORMATION, *PMOUNTMGR_DRIVE_LETTER_INFORMATION;
|
---|
114 |
|
---|
115 | typedef struct _MOUNTMGR_VOLUME_MOUNT_POINT
|
---|
116 | {
|
---|
117 | USHORT SourceVolumeNameOffset;
|
---|
118 | USHORT SourceVolumeNameLength;
|
---|
119 | USHORT TargetVolumeNameOffset;
|
---|
120 | USHORT TargetVolumeNameLength;
|
---|
121 | } MOUNTMGR_VOLUME_MOUNT_POINT, *PMOUNTMGR_VOLUME_MOUNT_POINT;
|
---|
122 |
|
---|
123 | typedef struct _MOUNTMGR_CHANGE_NOTIFY_INFO
|
---|
124 | {
|
---|
125 | ULONG EpicNumber;
|
---|
126 | } MOUNTMGR_CHANGE_NOTIFY_INFO, *PMOUNTMGR_CHANGE_NOTIFY_INFO;
|
---|
127 |
|
---|
128 | typedef struct _MOUNTMGR_TARGET_NAME
|
---|
129 | {
|
---|
130 | USHORT DeviceNameLength;
|
---|
131 | WCHAR DeviceName[1];
|
---|
132 | } MOUNTMGR_TARGET_NAME, *PMOUNTMGR_TARGET_NAME;
|
---|
133 |
|
---|
134 | #define MOUNTMGR_IS_DRIVE_LETTER(s) \
|
---|
135 | ((s)->Length == 28 && \
|
---|
136 | (s)->Buffer[0] == '\\' && (s)->Buffer[1] == 'D' && (s)->Buffer[2] == 'o' && \
|
---|
137 | (s)->Buffer[3] == 's' && (s)->Buffer[4] == 'D' && (s)->Buffer[5] == 'e' && \
|
---|
138 | (s)->Buffer[6] == 'v' && (s)->Buffer[7] == 'i' && (s)->Buffer[8] == 'c' && \
|
---|
139 | (s)->Buffer[9] == 'e' && (s)->Buffer[10] == 's' && (s)->Buffer[11] == '\\' && \
|
---|
140 | (s)->Buffer[12] >= 'A' && (s)->Buffer[12] <= 'Z' && (s)->Buffer[13] == ':')
|
---|
141 |
|
---|
142 | #define MOUNTMGR_IS_VOLUME_NAME(s) \
|
---|
143 | (((s)->Length == 96 || ((s)->Length == 98 && (s)->Buffer[48] == '\\')) && \
|
---|
144 | (s)->Buffer[0] == '\\' && ((s)->Buffer[1] == '?' || (s)->Buffer[1] == '\\') && \
|
---|
145 | (s)->Buffer[2] == '?' && (s)->Buffer[3] == '\\' && (s)->Buffer[4] == 'V' && \
|
---|
146 | (s)->Buffer[5] == 'o' && (s)->Buffer[6] == 'l' && (s)->Buffer[7] == 'u' && \
|
---|
147 | (s)->Buffer[8] == 'm' && (s)->Buffer[9] == 'e' && (s)->Buffer[10] == '{' && \
|
---|
148 | (s)->Buffer[19] == '-' && (s)->Buffer[24] == '-' && (s)->Buffer[29] == '-' && \
|
---|
149 | (s)->Buffer[34] == '-' && (s)->Buffer[47] == '}')
|
---|
150 |
|
---|
151 | #endif /* _MOUNTMGR_ */
|
---|