+} EFI_SYSTEM_TABLE;\r
+\r
+/**\r
+ This is the declaration of an EFI image entry point. This entry point is\r
+ the same for UEFI Applications, UEFI OS Loaders, and UEFI Drivers including\r
+ both device drivers and bus drivers.\r
+\r
+ @param[in] ImageHandle The firmware allocated handle for the UEFI image.\r
+ @param[in] SystemTable A pointer to the EFI System Table.\r
+\r
+ @retval EFI_SUCCESS The operation completed successfully.\r
+ @retval Others An unexpected error occurred.\r
+**/\r
+typedef\r
+EFI_STATUS\r
+(EFIAPI *EFI_IMAGE_ENTRY_POINT)(\r
+ IN EFI_HANDLE ImageHandle,\r
+ IN EFI_SYSTEM_TABLE *SystemTable\r
+ );\r
+\r
+//\r
+// EFI Load Option. This data structure describes format of UEFI boot option variables.\r
+//\r
+// NOTE: EFI Load Option is a byte packed buffer of variable length fields.\r
+// The first two fields have fixed length. They are declared as members of the\r
+// EFI_LOAD_OPTION structure. All the other fields are variable length fields.\r
+// They are listed in the comment block below for reference purposes.\r
+//\r
+#pragma pack(1)\r
+typedef struct _EFI_LOAD_OPTION {\r
+ ///\r
+ /// The attributes for this load option entry. All unused bits must be zero\r
+ /// and are reserved by the UEFI specification for future growth.\r
+ ///\r
+ UINT32 Attributes;\r
+ ///\r
+ /// Length in bytes of the FilePathList. OptionalData starts at offset\r
+ /// sizeof(UINT32) + sizeof(UINT16) + StrSize(Description) + FilePathListLength\r
+ /// of the EFI_LOAD_OPTION descriptor.\r
+ ///\r
+ UINT16 FilePathListLength;\r
+ ///\r
+ /// The user readable description for the load option.\r
+ /// This field ends with a Null character.\r
+ ///\r
+ // CHAR16 Description[];\r
+ ///\r
+ /// A packed array of UEFI device paths. The first element of the array is a\r
+ /// device path that describes the device and location of the Image for this\r
+ /// load option. The FilePathList[0] is specific to the device type. Other\r
+ /// device paths may optionally exist in the FilePathList, but their usage is\r
+ /// OSV specific. Each element in the array is variable length, and ends at\r
+ /// the device path end structure. Because the size of Description is\r
+ /// arbitrary, this data structure is not guaranteed to be aligned on a\r
+ /// natural boundary. This data structure may have to be copied to an aligned\r
+ /// natural boundary before it is used.\r
+ ///\r
+ // EFI_DEVICE_PATH_PROTOCOL FilePathList[];\r
+ ///\r
+ /// The remaining bytes in the load option descriptor are a binary data buffer\r
+ /// that is passed to the loaded image. If the field is zero bytes long, a\r
+ /// NULL pointer is passed to the loaded image. The number of bytes in\r
+ /// OptionalData can be computed by subtracting the starting offset of\r
+ /// OptionalData from total size in bytes of the EFI_LOAD_OPTION.\r
+ ///\r
+ // UINT8 OptionalData[];\r
+} EFI_LOAD_OPTION;\r
+#pragma pack()\r
+\r
+//\r
+// EFI Load Options Attributes\r
+//\r
+#define LOAD_OPTION_ACTIVE 0x00000001\r
+#define LOAD_OPTION_FORCE_RECONNECT 0x00000002\r
+#define LOAD_OPTION_HIDDEN 0x00000008\r
+#define LOAD_OPTION_CATEGORY 0x00001F00\r
+\r
+#define LOAD_OPTION_CATEGORY_BOOT 0x00000000\r
+#define LOAD_OPTION_CATEGORY_APP 0x00000100\r
+\r
+#define EFI_BOOT_OPTION_SUPPORT_KEY 0x00000001\r
+#define EFI_BOOT_OPTION_SUPPORT_APP 0x00000002\r
+#define EFI_BOOT_OPTION_SUPPORT_SYSPREP 0x00000010\r
+#define EFI_BOOT_OPTION_SUPPORT_COUNT 0x00000300\r
+\r
+///\r
+/// EFI Boot Key Data\r
+///\r
+typedef union {\r
+ struct {\r
+ ///\r
+ /// Indicates the revision of the EFI_KEY_OPTION structure. This revision level should be 0.\r
+ ///\r
+ UINT32 Revision : 8;\r
+ ///\r
+ /// Either the left or right Shift keys must be pressed (1) or must not be pressed (0).\r
+ ///\r
+ UINT32 ShiftPressed : 1;\r
+ ///\r
+ /// Either the left or right Control keys must be pressed (1) or must not be pressed (0).\r
+ ///\r
+ UINT32 ControlPressed : 1;\r
+ ///\r
+ /// Either the left or right Alt keys must be pressed (1) or must not be pressed (0).\r
+ ///\r
+ UINT32 AltPressed : 1;\r
+ ///\r
+ /// Either the left or right Logo keys must be pressed (1) or must not be pressed (0).\r
+ ///\r
+ UINT32 LogoPressed : 1;\r
+ ///\r
+ /// The Menu key must be pressed (1) or must not be pressed (0).\r
+ ///\r
+ UINT32 MenuPressed : 1;\r
+ ///\r
+ /// The SysReq key must be pressed (1) or must not be pressed (0).\r
+ ///\r
+ UINT32 SysReqPressed : 1;\r
+ UINT32 Reserved : 16;\r
+ ///\r
+ /// Specifies the actual number of entries in EFI_KEY_OPTION.Keys, from 0-3. If\r
+ /// zero, then only the shift state is considered. If more than one, then the boot option will\r
+ /// only be launched if all of the specified keys are pressed with the same shift state.\r
+ ///\r
+ UINT32 InputKeyCount : 2;\r
+ } Options;\r
+ UINT32 PackedValue;\r
+} EFI_BOOT_KEY_DATA;\r
+\r
+///\r
+/// EFI Key Option.\r
+///\r
+#pragma pack(1)\r
+typedef struct {\r
+ ///\r
+ /// Specifies options about how the key will be processed.\r
+ ///\r
+ EFI_BOOT_KEY_DATA KeyData;\r
+ ///\r
+ /// The CRC-32 which should match the CRC-32 of the entire EFI_LOAD_OPTION to\r
+ /// which BootOption refers. If the CRC-32s do not match this value, then this key\r
+ /// option is ignored.\r
+ ///\r
+ UINT32 BootOptionCrc;\r
+ ///\r
+ /// The Boot#### option which will be invoked if this key is pressed and the boot option\r
+ /// is active (LOAD_OPTION_ACTIVE is set).\r
+ ///\r
+ UINT16 BootOption;\r
+ ///\r
+ /// The key codes to compare against those returned by the\r
+ /// EFI_SIMPLE_TEXT_INPUT and EFI_SIMPLE_TEXT_INPUT_EX protocols.\r
+ /// The number of key codes (0-3) is specified by the EFI_KEY_CODE_COUNT field in KeyOptions.\r
+ ///\r
+ //EFI_INPUT_KEY Keys[];\r
+} EFI_KEY_OPTION;\r
+#pragma pack()\r