]> git.proxmox.com Git - mirror_edk2.git/blobdiff - ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.h
ShellPkg/Dp: Add null pointer check
[mirror_edk2.git] / ShellPkg / Library / UefiHandleParsingLib / UefiHandleParsingLib.h
index 767e1e68f1c118e3a5905d0a56a0bd9328bf2e3d..68bb00c620056f691d1d64472f9a07d4f7161032 100644 (file)
@@ -1,8 +1,9 @@
 /** @file\r
   Provides interface to advanced shell functionality for parsing both handle and protocol database.\r
 \r
-  Copyright (c) 2013 Hewlett-Packard Development Company, L.P.\r
-  Copyright (c) 2011 - 2012, Intel Corporation. All rights reserved.<BR>\r
+  Copyright (c) 2011 - 2017, Intel Corporation. All rights reserved.<BR>\r
+  (C) Copyright 2016 Hewlett Packard Enterprise Development LP<BR>\r
+  (C) Copyright 2013-2016 Hewlett-Packard Development Company, L.P.<BR>\r
   This program and the accompanying materials\r
   are licensed and made available under the terms and conditions of the BSD License\r
   which accompanies this distribution.  The full text of the license may be found at\r
@@ -31,8 +32,8 @@
 #include <Protocol/LoadedImage.h>\r
 #include <Protocol/EfiShellInterface.h>\r
 #include <Protocol/EfiShellEnvironment2.h>\r
-#include <Protocol/EfiShell.h>\r
-#include <Protocol/EfiShellParameters.h>\r
+#include <Protocol/Shell.h>\r
+#include <Protocol/ShellParameters.h>\r
 #include <Protocol/DevicePathToText.h>\r
 #include <Protocol/DriverBinding.h>\r
 #include <Protocol/DriverConfiguration2.h>\r
@@ -86,6 +87,7 @@
 #include <Protocol/Tcp4.h>\r
 #include <Protocol/Ip4.h>\r
 #include <Protocol/Ip4Config.h>\r
+#include <Protocol/Ip4Config2.h>\r
 #include <Protocol/Udp4.h>\r
 #include <Protocol/Mtftp4.h>\r
 #include <Protocol/AuthenticationInfo.h>\r
 #include <Protocol/BlockIo2.h>\r
 #include <Protocol/StorageSecurityCommand.h>\r
 #include <Protocol/UserCredential2.h>\r
+#include <Protocol/IdeControllerInit.h>\r
 #include <Protocol/DiskIo2.h>\r
+#include <Protocol/AdapterInformation.h>\r
+#include <Protocol/ShellDynamicCommand.h>\r
+#include <Protocol/DiskInfo.h>\r
+#include <Protocol/PartitionInfo.h>\r
 \r
 #include <Library/HandleParsingLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
 #include <Library/HiiLib.h>\r
 #include <Library/ShellLib.h>\r
 #include <Library/SortLib.h>\r
+#include <Library/ShellCommandLib.h>\r
+#include <Library/PeCoffGetEntryPointLib.h>\r
+\r
+#define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V1   1\r
+#define   EFI_FIRMWARE_IMAGE_DESCRIPTOR_VERSION_V2   2\r
+\r
+///\r
+/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec < 2.4a\r
+///\r
+typedef struct {\r
+  /// \r
+  /// A unique number identifying the firmware image within the device.  The number is \r
+  /// between 1 and DescriptorCount.\r
+  /// \r
+  UINT8                            ImageIndex;\r
+  ///\r
+  /// A unique number identifying the firmware image type.  \r
+  /// \r
+  EFI_GUID                         ImageTypeId;\r
+  /// \r
+  /// A unique number identifying the firmware image. \r
+  /// \r
+  UINT64                           ImageId;\r
+  /// \r
+  /// A pointer to a null-terminated string representing the firmware image name.  \r
+  /// \r
+  CHAR16                           *ImageIdName;\r
+  /// \r
+  /// Identifies the version of the device firmware. The format is vendor specific and new \r
+  /// version must have a greater value than an old version.\r
+  /// \r
+  UINT32                           Version;\r
+  /// \r
+  /// A pointer to a null-terminated string representing the firmware image version name.\r
+  /// \r
+  CHAR16                           *VersionName;\r
+  /// \r
+  /// Size of the image in bytes.  If size=0, then only ImageIndex and ImageTypeId are valid.\r
+  /// \r
+  UINTN                            Size;\r
+  /// \r
+  /// Image attributes that are supported by this device.  See 'Image Attribute Definitions' \r
+  /// for possible returned values of this parameter.  A value of 1 indicates the attribute is \r
+  /// supported and the current setting value is indicated in AttributesSetting.  A \r
+  /// value of 0 indicates the attribute is not supported and the current setting value in \r
+  /// AttributesSetting is meaningless.\r
+  /// \r
+  UINT64                           AttributesSupported;\r
+  /// \r
+  /// Image attributes.  See 'Image Attribute Definitions' for possible returned values of \r
+  /// this parameter.\r
+  /// \r
+  UINT64                           AttributesSetting;\r
+  /// \r
+  /// Image compatibilities.  See 'Image Compatibility Definitions' for possible returned \r
+  /// values of this parameter.\r
+  /// \r
+  UINT64                           Compatibilities;\r
+} EFI_FIRMWARE_IMAGE_DESCRIPTOR_V1;\r
+\r
+\r
+///\r
+/// EFI_FIRMWARE_IMAGE_DESCRIPTOR in UEFI spec > 2.4a and < 2.5\r
+///\r
+typedef struct {\r
+  /// \r
+  /// A unique number identifying the firmware image within the device.  The number is \r
+  /// between 1 and DescriptorCount.\r
+  /// \r
+  UINT8                            ImageIndex;\r
+  ///\r
+  /// A unique number identifying the firmware image type.  \r
+  /// \r
+  EFI_GUID                         ImageTypeId;\r
+  /// \r
+  /// A unique number identifying the firmware image. \r
+  /// \r
+  UINT64                           ImageId;\r
+  /// \r
+  /// A pointer to a null-terminated string representing the firmware image name.  \r
+  /// \r
+  CHAR16                           *ImageIdName;\r
+  /// \r
+  /// Identifies the version of the device firmware. The format is vendor specific and new \r
+  /// version must have a greater value than an old version.\r
+  /// \r
+  UINT32                           Version;\r
+  /// \r
+  /// A pointer to a null-terminated string representing the firmware image version name.\r
+  /// \r
+  CHAR16                           *VersionName;\r
+  /// \r
+  /// Size of the image in bytes.  If size=0, then only ImageIndex and ImageTypeId are valid.\r
+  /// \r
+  UINTN                            Size;\r
+  /// \r
+  /// Image attributes that are supported by this device.  See 'Image Attribute Definitions' \r
+  /// for possible returned values of this parameter.  A value of 1 indicates the attribute is \r
+  /// supported and the current setting value is indicated in AttributesSetting.  A \r
+  /// value of 0 indicates the attribute is not supported and the current setting value in \r
+  /// AttributesSetting is meaningless.\r
+  /// \r
+  UINT64                           AttributesSupported;\r
+  /// \r
+  /// Image attributes.  See 'Image Attribute Definitions' for possible returned values of \r
+  /// this parameter.\r
+  /// \r
+  UINT64                           AttributesSetting;\r
+  /// \r
+  /// Image compatibilities.  See 'Image Compatibility Definitions' for possible returned \r
+  /// values of this parameter.\r
+  /// \r
+  UINT64                           Compatibilities;\r
+  ///\r
+  /// Describes the lowest ImageDescriptor version that the device will accept. Only\r
+  /// present in version 2 or higher.\r
+  UINT32                           LowestSupportedImageVersion;\r
+} EFI_FIRMWARE_IMAGE_DESCRIPTOR_V2;\r
 \r
 typedef struct {\r
   LIST_ENTRY  Link;\r