xref: /reactos/sdk/include/ddk/mountdev.h (revision 1de09c47)
1 /*
2  * mountmgr.h
3  *
4  * Mount Manager mounted devices interface
5  *
6  * This file is part of the ReactOS DDK package.
7  *
8  * Contributors:
9  *   Magnus Olsen <greatlord@reactos.org>
10  *   Amine Khaldi <amine.khaldi@reactos.org>
11  *   Hermès Bélusca-Maïto <hermes.belusca-maito@reactos.org>
12  *
13  * THIS SOFTWARE IS NOT COPYRIGHTED
14  *
15  * This source code is offered for use in the public domain. You may
16  * use, modify or distribute it freely.
17  *
18  * This code is distributed in the hope that it will be useful but
19  * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
20  * DISCLAIMED. This includes but is not limited to warranties of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
22  *
23  */
24 
25 #ifndef _MOUNTDEV_
26 #define _MOUNTDEV_
27 
28 #pragma once
29 
30 #include <mountmgr.h>
31 
32 #ifdef __cplusplus
33 extern "C" {
34 #endif
35 
36 /* Windows 2003 fixed the required access for some IOCTLs */
37 #if (NTDDI_VERSION >= NTDDI_WS03)
38     #define EXPECTED_ACCESS (FILE_READ_ACCESS | FILE_WRITE_ACCESS)
39 #else
40     #define EXPECTED_ACCESS FILE_ANY_ACCESS
41 #endif
42 
43 #if (NTDDI_VERSION >= NTDDI_WIN2K)
44 
45 #define IOCTL_MOUNTDEV_QUERY_UNIQUE_ID            CTL_CODE(MOUNTDEVCONTROLTYPE, 0, METHOD_BUFFERED, FILE_ANY_ACCESS)
46 #define IOCTL_MOUNTDEV_QUERY_SUGGESTED_LINK_NAME  CTL_CODE(MOUNTDEVCONTROLTYPE, 3, METHOD_BUFFERED, FILE_ANY_ACCESS)
47 #define IOCTL_MOUNTDEV_LINK_CREATED               CTL_CODE(MOUNTDEVCONTROLTYPE, 4, METHOD_BUFFERED, EXPECTED_ACCESS)
48 #define IOCTL_MOUNTDEV_LINK_DELETED               CTL_CODE(MOUNTDEVCONTROLTYPE, 5, METHOD_BUFFERED, EXPECTED_ACCESS)
49 
50 typedef struct _MOUNTDEV_UNIQUE_ID {
51   USHORT UniqueIdLength;
52   UCHAR UniqueId[1];
53 } MOUNTDEV_UNIQUE_ID, *PMOUNTDEV_UNIQUE_ID;
54 
55 typedef struct _MOUNTDEV_SUGGESTED_LINK_NAME {
56   BOOLEAN UseOnlyIfThereAreNoOtherLinks;
57   USHORT NameLength;
58   WCHAR Name[1];
59 } MOUNTDEV_SUGGESTED_LINK_NAME, *PMOUNTDEV_SUGGESTED_LINK_NAME;
60 
61 #endif /* (NTDDI_VERSION >= NTDDI_WIN2K) */
62 
63 #if (NTDDI_VERSION >= NTDDI_WINXP)
64 
65 #define IOCTL_MOUNTDEV_QUERY_STABLE_GUID          CTL_CODE(MOUNTDEVCONTROLTYPE, 6, METHOD_BUFFERED, FILE_ANY_ACCESS)
66 
67 typedef struct _MOUNTDEV_STABLE_GUID {
68   GUID StableGuid;
69 } MOUNTDEV_STABLE_GUID, *PMOUNTDEV_STABLE_GUID;
70 
71 #endif /* (NTDDI_VERSION >= NTDDI_WINXP) */
72 
73 /* NOTE: Support for IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY
74  * seems to have been removed from official WDK in Vista+ */
75 #define IOCTL_MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY    CTL_CODE(MOUNTDEVCONTROLTYPE, 1, METHOD_BUFFERED, EXPECTED_ACCESS)
76 typedef struct _MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT {
77   ULONG Size;
78   USHORT OldUniqueIdOffset;
79   USHORT OldUniqueIdLength;
80   USHORT NewUniqueIdOffset;
81   USHORT NewUniqueIdLength;
82 } MOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT, *PMOUNTDEV_UNIQUE_ID_CHANGE_NOTIFY_OUTPUT;
83 
84 #ifdef __cplusplus
85 } /* extern "C" */
86 #endif
87 
88 #endif /* _MOUNTDEV_ */
89