]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Library/ExtendedHiiLib/ExtendedHiiLib.c
Move MdeModuleHii.h into Include\Guid directory
[mirror_edk2.git] / MdeModulePkg / Library / ExtendedHiiLib / ExtendedHiiLib.c
index bfaf49e4b10d81a9c98313a7b085a5521b51b439..48f8df483c57edaf6c7aaf33093fce758c606e68 100644 (file)
@@ -1,5 +1,10 @@
 /** @file\r
-  HII Library implementation that uses DXE protocols and services.\r
+Library instance for ExtendedHiiLib.\r
+  \r
+This library instance implements the common HII routines which is\r
+related to HII but reference data structures that are not defined in \r
+UEFI specification, for example HII_VENDOR_DEVICE_PATH.\r
+\r
 \r
 Copyright (c) 2006 - 2008, Intel Corporation. <BR>\r
 All rights reserved. This program and the accompanying materials\r
@@ -13,21 +18,19 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 **/\r
 \r
 \r
-#include <PiDxe.h>\r
-\r
+#include <Uefi.h>\r
 #include <Protocol/DevicePath.h>\r
-\r
-#include <Library/BaseMemoryLib.h>\r
 #include <Library/DebugLib.h>\r
 #include <Library/MemoryAllocationLib.h>\r
 #include <Library/UefiBootServicesTableLib.h>\r
-#include <MdeModuleHii.h>\r
+#include <Library/DevicePathLib.h>\r
+#include <Guid\MdeModuleHii.h>\r
 \r
 \r
 //\r
 // Hii vendor device path template\r
 //\r
-HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePathTemplate = {\r
+GLOBAL_REMOVE_IF_UNREFERENCED CONST HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePathTemplate = {\r
   {\r
     {\r
       {\r
@@ -40,6 +43,7 @@ HII_VENDOR_DEVICE_PATH  mHiiVendorDevicePathTemplate = {
       },\r
       EFI_IFR_TIANO_GUID\r
     },\r
+    0,\r
     0\r
   },\r
   {\r
@@ -74,22 +78,23 @@ HiiLibCreateHiiDriverHandle (
 {\r
   EFI_STATUS                   Status;\r
   HII_VENDOR_DEVICE_PATH_NODE  *VendorDevicePath;\r
-  UINT64                       MonotonicCount;\r
 \r
   VendorDevicePath = AllocateCopyPool (sizeof (HII_VENDOR_DEVICE_PATH), &mHiiVendorDevicePathTemplate);\r
   if (VendorDevicePath == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r
 \r
-  gBS->GetNextMonotonicCount (&MonotonicCount);\r
-  VendorDevicePath->MonotonicCount = (UINT32) MonotonicCount;\r
+  //\r
+  // Use memory address as unique ID to distinguish from different device paths\r
+  //\r
+  VendorDevicePath->UniqueId = (UINT64) ((UINTN) VendorDevicePath);\r
 \r
   *DriverHandle = NULL;\r
-  Status = gBS->InstallProtocolInterface (\r
+  Status = gBS->InstallMultipleProtocolInterfaces (\r
                   DriverHandle,\r
                   &gEfiDevicePathProtocolGuid,\r
-                  EFI_NATIVE_INTERFACE,\r
-                  VendorDevicePath\r
+                  VendorDevicePath,\r
+                  NULL\r
                   );\r
   if (EFI_ERROR (Status)) {\r
     return Status;\r