]> code.delx.au - refind/blob - include/RemovableMedia.h
Added more information on Mac "Retina" display problems to todo.html.
[refind] / include / RemovableMedia.h
1 /*
2 * Copyright (c) 2005 Apple Computer, Inc. All rights reserved.
3 *
4 * Module Name:
5 *
6 * RemovableMedia.h
7 *
8 * Abstract:
9 *
10 * Protocol interface for any device that supports removable media (i.e. optical drives).
11 *
12
13 Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple
14 Computer, Inc. ("Apple") in consideration of your agreement to the
15 following terms, and your use, installation, modification or
16 redistribution of this Apple software constitutes acceptance of these
17 terms. If you do not agree with these terms, please do not use,
18 install, modify or redistribute this Apple software.
19
20 In consideration of your agreement to abide by the following terms, and
21 subject to these terms, Apple grants you a personal, non-exclusive
22 license, under Apple's copyrights in this original Apple software (the
23 "Apple Software"), to use, reproduce, modify and redistribute the Apple
24 Software, with or without modifications, in source and/or binary forms;
25 provided that if you redistribute the Apple Software in its entirety and
26 without modifications, you must retain this notice and the following
27 text and disclaimers in all such redistributions of the Apple Software.
28 Neither the name, trademarks, service marks or logos of Apple Computer,
29 Inc. may be used to endorse or promote products derived from the Apple
30 Software without specific prior written permission from Apple. Except
31 as expressly stated in this notice, no other rights or licenses, express
32 or implied, are granted by Apple herein, including but not limited to
33 any patent rights that may be infringed by your derivative works or by
34 other works in which the Apple Software may be incorporated.
35
36 The Apple Software is provided by Apple on an "AS IS" basis. APPLE
37 MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION
38 THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS
39 FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND
40 OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.
41
42 IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL
43 OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
44 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
45 INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,
46 MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED
47 AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),
48 STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE
49 POSSIBILITY OF SUCH DAMAGE.
50
51 Copyright © 2006 Apple Computer, Inc., All Rights Reserved
52
53 */
54
55 #ifndef _APPLE_REMOVABLE_MEDIA_H
56 #define _APPLE_REMOVABLE_MEDIA_H
57
58 //
59 // Global Id for Removable_Media Interface
60 //
61 // {2EA9743A-23D9-425e-872C-F615AA195788}
62 #define APPLE_REMOVABLE_MEDIA_PROTOCOL_GUID \
63 { \
64 0x2ea9743a, 0x23d9, 0x425e, { 0x87, 0x2c, 0xf6, 0x15, 0xaa, 0x19, 0x57, 0x88 } \
65 }
66
67 #define APPLE_REMOVABLE_MEDIA_PROTOCOL_REVISION 0x00000001
68
69 // EFI_FORWARD_DECLARATION (APPLE_REMOVABLE_MEDIA_PROTOCOL);
70 typedef struct _APPLE_REMOVABLE_MEDIA_PROTOCOL APPLE_REMOVABLE_MEDIA_PROTOCOL;
71
72 //
73 // Eject
74 //
75 typedef
76 EFI_STATUS
77 (EFIAPI *APPLE_REMOVABLE_MEDIA_EJECT) (
78 IN APPLE_REMOVABLE_MEDIA_PROTOCOL * This
79 )
80 /*++
81
82 Routine Description:
83 Eject removable media from drive (such as a CD/DVD).
84
85 Arguments:
86 This - Protocol instance pointer.
87
88 Returns:
89 EFI_SUCCESS - The media was ejected.
90
91 --*/
92 ;
93
94 //
95 // Inject
96 //
97 typedef
98 EFI_STATUS
99 (EFIAPI *APPLE_REMOVABLE_MEDIA_INJECT) (
100 IN APPLE_REMOVABLE_MEDIA_PROTOCOL * This
101 )
102 /*++
103
104 Routine Description:
105 Inject removable media into drive (such as a CD/DVD).
106
107 Arguments:
108 This - Protocol instance pointer.
109
110 Returns:
111 EFI_SUCCESS - The media was injected.
112
113 --*/
114 ;
115
116 //
117 // Allow media to be ejected
118 //
119 typedef
120 EFI_STATUS
121 (EFIAPI *APPLE_REMOVABLE_MEDIA_ALLOW_REMOVAL) (
122 IN APPLE_REMOVABLE_MEDIA_PROTOCOL * This
123 )
124 /*++
125
126 Routine Description:
127 Allow the media to be removed from the drive.
128
129 Arguments:
130 This - Protocol instance pointer.
131
132 Returns:
133 EFI_SUCCESS - The media can now be removed.
134 EFI_UNSUPPORTED - The media cannot be removed.
135
136 --*/
137 ;
138
139 //
140 // Prevent media from being ejected
141 //
142 typedef
143 EFI_STATUS
144 (EFIAPI *APPLE_REMOVABLE_MEDIA_PREVENT_REMOVAL) (
145 IN APPLE_REMOVABLE_MEDIA_PROTOCOL * This
146 )
147 /*++
148
149 Routine Description:
150 Prevent the media from being removed from the drive.
151
152 Arguments:
153 This - Protocol instance pointer.
154
155 Returns:
156 EFI_SUCCESS - The drive is locked, and the media cannot be removed.
157 EFI_UNSUPPORTED - The drive cannot be locked.
158
159 --*/
160 ;
161
162 //
163 // Detect state of removable media tray
164 //
165 typedef
166 EFI_STATUS
167 (EFIAPI *APPLE_REMOVABLE_MEDIA_DETECT_TRAY_STATE) (
168 IN APPLE_REMOVABLE_MEDIA_PROTOCOL * This,
169 OUT BOOLEAN * TrayOpen
170 )
171 /*++
172
173 Routine Description:
174 Get the status of the drive tray.
175
176 Arguments:
177 This - Protocol instance pointer.
178 TrayOpen - Status of the drive tray.
179
180 Returns:
181 EFI_SUCCESS - The status has been returned in TrayOpen.
182
183 --*/
184 ;
185
186 //
187 // Protocol definition
188 //
189 struct _APPLE_REMOVABLE_MEDIA_PROTOCOL {
190 UINT32 Revision;
191 BOOLEAN RemovalAllowed;
192 APPLE_REMOVABLE_MEDIA_EJECT Eject;
193 APPLE_REMOVABLE_MEDIA_INJECT Inject;
194 APPLE_REMOVABLE_MEDIA_ALLOW_REMOVAL AllowRemoval;
195 APPLE_REMOVABLE_MEDIA_PREVENT_REMOVAL PreventRemoval;
196 APPLE_REMOVABLE_MEDIA_DETECT_TRAY_STATE DetectTrayState;
197
198 };
199
200 //extern EFI_GUID gAppleRemovableMediaProtocolGuid;
201
202 #endif
203