]> code.delx.au - refind/commitdiff
New file for disc-eject function.
authorsrs5694 <srs5694@users.sourceforge.net>
Sat, 19 May 2012 05:30:58 +0000 (01:30 -0400)
committersrs5694 <srs5694@users.sourceforge.net>
Sat, 19 May 2012 05:30:58 +0000 (01:30 -0400)
include/RemovableMedia.h [new file with mode: 0644]

diff --git a/include/RemovableMedia.h b/include/RemovableMedia.h
new file mode 100644 (file)
index 0000000..75b2f62
--- /dev/null
@@ -0,0 +1,203 @@
+/*\r
+ * Copyright (c) 2005 Apple Computer, Inc.  All rights reserved.\r
+ *\r
+ * Module Name:\r
+ *\r
+ *     RemovableMedia.h\r
+ *\r
+ * Abstract:\r
+ *\r
+ *     Protocol interface for any device that supports removable media (i.e. optical drives).\r
+ *\r
+\r
+Disclaimer: IMPORTANT:  This Apple software is supplied to you by Apple\r
+Computer, Inc. ("Apple") in consideration of your agreement to the\r
+following terms, and your use, installation, modification or\r
+redistribution of this Apple software constitutes acceptance of these\r
+terms.  If you do not agree with these terms, please do not use,\r
+install, modify or redistribute this Apple software.\r
+\r
+In consideration of your agreement to abide by the following terms, and\r
+subject to these terms, Apple grants you a personal, non-exclusive\r
+license, under Apple's copyrights in this original Apple software (the\r
+"Apple Software"), to use, reproduce, modify and redistribute the Apple\r
+Software, with or without modifications, in source and/or binary forms;\r
+provided that if you redistribute the Apple Software in its entirety and\r
+without modifications, you must retain this notice and the following\r
+text and disclaimers in all such redistributions of the Apple Software. \r
+Neither the name, trademarks, service marks or logos of Apple Computer,\r
+Inc. may be used to endorse or promote products derived from the Apple\r
+Software without specific prior written permission from Apple.  Except\r
+as expressly stated in this notice, no other rights or licenses, express\r
+or implied, are granted by Apple herein, including but not limited to\r
+any patent rights that may be infringed by your derivative works or by\r
+other works in which the Apple Software may be incorporated.\r
+\r
+The Apple Software is provided by Apple on an "AS IS" basis.  APPLE\r
+MAKES NO WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION\r
+THE IMPLIED WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS\r
+FOR A PARTICULAR PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND\r
+OPERATION ALONE OR IN COMBINATION WITH YOUR PRODUCTS.\r
+\r
+IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL\r
+OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\r
+SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\r
+INTERRUPTION) ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION,\r
+MODIFICATION AND/OR DISTRIBUTION OF THE APPLE SOFTWARE, HOWEVER CAUSED\r
+AND WHETHER UNDER THEORY OF CONTRACT, TORT (INCLUDING NEGLIGENCE),\r
+STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN ADVISED OF THE\r
+POSSIBILITY OF SUCH DAMAGE.\r
+\r
+Copyright © 2006 Apple Computer, Inc., All Rights Reserved\r
+\r
+ */\r
+\r
+#ifndef _APPLE_REMOVABLE_MEDIA_H\r
+#define _APPLE_REMOVABLE_MEDIA_H\r
+\r
+//\r
+// Global Id for Removable_Media Interface\r
+//\r
+// {2EA9743A-23D9-425e-872C-F615AA195788}\r
+#define APPLE_REMOVABLE_MEDIA_PROTOCOL_GUID \\r
+  { \\r
+    0x2ea9743a, 0x23d9, 0x425e, { 0x87, 0x2c, 0xf6, 0x15, 0xaa, 0x19, 0x57, 0x88 } \\r
+  }\r
+\r
+#define        APPLE_REMOVABLE_MEDIA_PROTOCOL_REVISION         0x00000001\r
+\r
+// EFI_FORWARD_DECLARATION (APPLE_REMOVABLE_MEDIA_PROTOCOL);\r
+typedef struct _APPLE_REMOVABLE_MEDIA_PROTOCOL APPLE_REMOVABLE_MEDIA_PROTOCOL;\r
+\r
+//\r
+// Eject\r
+//\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *APPLE_REMOVABLE_MEDIA_EJECT) (\r
+  IN APPLE_REMOVABLE_MEDIA_PROTOCOL                            * This\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Eject removable media from drive (such as a CD/DVD).\r
+\r
+  Arguments:\r
+    This                 - Protocol instance pointer.\r
+\r
+  Returns:\r
+    EFI_SUCCESS          - The media was ejected.\r
+\r
+--*/\r
+;\r
+\r
+//\r
+// Inject\r
+//\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *APPLE_REMOVABLE_MEDIA_INJECT) (\r
+  IN APPLE_REMOVABLE_MEDIA_PROTOCOL                            * This\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Inject removable media into drive (such as a CD/DVD).\r
+\r
+  Arguments:\r
+    This                 - Protocol instance pointer.\r
+\r
+  Returns:\r
+    EFI_SUCCESS          - The media was injected.\r
+\r
+--*/\r
+;\r
+\r
+//\r
+// Allow media to be ejected\r
+//\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *APPLE_REMOVABLE_MEDIA_ALLOW_REMOVAL) (\r
+  IN APPLE_REMOVABLE_MEDIA_PROTOCOL                            * This\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Allow the media to be removed from the drive.\r
+\r
+  Arguments:\r
+    This                 - Protocol instance pointer.\r
+\r
+  Returns:\r
+    EFI_SUCCESS          - The media can now be removed.\r
+       EFI_UNSUPPORTED      - The media cannot be removed.\r
+\r
+--*/\r
+;\r
+\r
+//\r
+// Prevent media from being ejected\r
+//\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *APPLE_REMOVABLE_MEDIA_PREVENT_REMOVAL) (\r
+  IN APPLE_REMOVABLE_MEDIA_PROTOCOL                            * This\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Prevent the media from being removed from the drive.\r
+\r
+  Arguments:\r
+    This                 - Protocol instance pointer.\r
+\r
+  Returns:\r
+    EFI_SUCCESS          - The drive is locked, and the media cannot be removed.\r
+       EFI_UNSUPPORTED      - The drive cannot be locked.\r
+\r
+--*/\r
+;\r
+\r
+//\r
+// Detect state of removable media tray\r
+//\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *APPLE_REMOVABLE_MEDIA_DETECT_TRAY_STATE) (\r
+  IN APPLE_REMOVABLE_MEDIA_PROTOCOL                            * This,\r
+  OUT BOOLEAN                                                                  * TrayOpen\r
+  )\r
+/*++\r
+\r
+  Routine Description:\r
+    Get the status of the drive tray.\r
+\r
+  Arguments:\r
+    This                 - Protocol instance pointer.\r
+       TrayOpen             - Status of the drive tray.\r
+\r
+  Returns:\r
+    EFI_SUCCESS          - The status has been returned in TrayOpen.\r
+\r
+--*/\r
+;\r
+\r
+//\r
+// Protocol definition\r
+//\r
+struct _APPLE_REMOVABLE_MEDIA_PROTOCOL {\r
+  UINT32                                                                               Revision;\r
+  BOOLEAN                                                                              RemovalAllowed;\r
+  APPLE_REMOVABLE_MEDIA_EJECT                                  Eject;\r
+  APPLE_REMOVABLE_MEDIA_INJECT                                 Inject;\r
+  APPLE_REMOVABLE_MEDIA_ALLOW_REMOVAL                  AllowRemoval;\r
+  APPLE_REMOVABLE_MEDIA_PREVENT_REMOVAL                        PreventRemoval;\r
+  APPLE_REMOVABLE_MEDIA_DETECT_TRAY_STATE              DetectTrayState;\r
+\r
+};\r
+\r
+//extern EFI_GUID gAppleRemovableMediaProtocolGuid;\r
+\r
+#endif\r
+\r