]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdeModulePkg/Core/Dxe/Hand/Locate.c
retire gEfiFirmwareVolumeDispatcherProtocolGuid as its original design is used to...
[mirror_edk2.git] / MdeModulePkg / Core / Dxe / Hand / Locate.c
index 3bed845cf56df9162f714064589344900ab64d31..8e60a0567ac67c304de7a176ac9704e2c290896c 100644 (file)
@@ -12,7 +12,8 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 **/\r
 \r
-#include <DxeMain.h>\r
+#include "DxeMain.h"\r
+#include "Handle.h"\r
 \r
 //\r
 // ProtocolRequest - Last LocateHandle request ID\r
@@ -45,7 +46,7 @@ IHANDLE *
                                  protocol.\r
 \r
   @return An pointer to IHANDLE if the next Position is not the end of the list.\r
-          Otherwise,NULL_HANDLE is returned.\r
+          Otherwise,NULL is returned.\r
 \r
 **/\r
 IHANDLE *\r
@@ -63,7 +64,7 @@ CoreGetNextLocateAllHandles (
                                  protocol.\r
 \r
   @return An pointer to IHANDLE if the next Position is not the end of the list.\r
-          Otherwise,NULL_HANDLE is returned.\r
+          Otherwise,NULL is returned.\r
 \r
 **/\r
 IHANDLE *\r
@@ -80,7 +81,7 @@ CoreGetNextLocateByRegisterNotify (
                                  protocol.\r
 \r
   @return An pointer to IHANDLE if the next Position is not the end of the list.\r
-          Otherwise,NULL_HANDLE is returned.\r
+          Otherwise,NULL is returned.\r
 \r
 **/\r
 IHANDLE *\r
@@ -128,7 +129,7 @@ CoreLocateHandle (
   VOID                *Interface;\r
 \r
   if (BufferSize == NULL) {\r
-    Status = EFI_INVALID_PARAMETER;\r
+    return EFI_INVALID_PARAMETER;\r
   }\r
 \r
   if ((*BufferSize > 0) && (Buffer == NULL)) {\r
@@ -264,7 +265,7 @@ CoreLocateHandle (
                                  protocol.\r
 \r
   @return An pointer to IHANDLE if the next Position is not the end of the list.\r
-          Otherwise,NULL_HANDLE is returned.\r
+          Otherwise,NULL is returned.\r
 \r
 **/\r
 IHANDLE *\r
@@ -283,7 +284,7 @@ CoreGetNextLocateAllHandles (
   //\r
   // If not at the end of the list, get the handle\r
   //\r
-  Handle      = NULL_HANDLE;\r
+  Handle      = NULL;\r
   *Interface  = NULL;\r
   if (Position->Position != &gHandleList) {\r
     Handle = CR (Position->Position, IHANDLE, AllHandles, EFI_HANDLE_SIGNATURE);\r
@@ -303,7 +304,7 @@ CoreGetNextLocateAllHandles (
                                  protocol.\r
 \r
   @return An pointer to IHANDLE if the next Position is not the end of the list.\r
-          Otherwise,NULL_HANDLE is returned.\r
+          Otherwise,NULL is returned.\r
 \r
 **/\r
 IHANDLE *\r
@@ -317,7 +318,7 @@ CoreGetNextLocateByRegisterNotify (
   PROTOCOL_INTERFACE  *Prot;\r
   LIST_ENTRY          *Link;\r
 \r
-  Handle      = NULL_HANDLE;\r
+  Handle      = NULL;\r
   *Interface  = NULL;\r
   ProtNotify = Position->SearchKey;\r
 \r
@@ -334,7 +335,7 @@ CoreGetNextLocateByRegisterNotify (
     Link = ProtNotify->Position->ForwardLink;\r
     if (Link != &ProtNotify->Protocol->Protocols) {\r
       Prot = CR (Link, PROTOCOL_INTERFACE, ByProtocol, PROTOCOL_INTERFACE_SIGNATURE);\r
-      Handle = (IHANDLE *) Prot->Handle;\r
+      Handle = Prot->Handle;\r
       *Interface = Prot->Interface;\r
     }\r
   }\r
@@ -351,7 +352,7 @@ CoreGetNextLocateByRegisterNotify (
                                  protocol.\r
 \r
   @return An pointer to IHANDLE if the next Position is not the end of the list.\r
-          Otherwise,NULL_HANDLE is returned.\r
+          Otherwise,NULL is returned.\r
 \r
 **/\r
 IHANDLE *\r
@@ -364,7 +365,7 @@ CoreGetNextLocateByProtocol (
   LIST_ENTRY          *Link;\r
   PROTOCOL_INTERFACE  *Prot;\r
 \r
-  Handle      = NULL_HANDLE;\r
+  Handle      = NULL;\r
   *Interface  = NULL;\r
   for (; ;) {\r
     //\r
@@ -377,7 +378,7 @@ CoreGetNextLocateByProtocol (
     // If not at the end, return the handle\r
     //\r
     if (Link == &Position->ProtEntry->Protocols) {\r
-      Handle = NULL_HANDLE;\r
+      Handle = NULL;\r
       break;\r
     }\r
 \r
@@ -385,7 +386,7 @@ CoreGetNextLocateByProtocol (
     // Get the handle\r
     //\r
     Prot = CR(Link, PROTOCOL_INTERFACE, ByProtocol, PROTOCOL_INTERFACE_SIGNATURE);\r
-    Handle = (IHANDLE *) Prot->Handle;\r
+    Handle = Prot->Handle;\r
     *Interface = Prot->Interface;\r
 \r
     //\r
@@ -448,14 +449,14 @@ CoreLocateDevicePath (
     return  EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  *Device = NULL_HANDLE;\r
+  *Device = NULL;\r
   SourcePath = *DevicePath;\r
-  SourceSize = CoreDevicePathSize (SourcePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);\r
+  SourceSize = GetDevicePathSize (SourcePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);\r
 \r
   //\r
   // The source path can only have 1 instance\r
   //\r
-  if (CoreIsDevicePathMultiInstance (SourcePath)) {\r
+  if (IsDevicePathMultiInstance (SourcePath)) {\r
     DEBUG((DEBUG_ERROR, "LocateDevicePath: Device path has too many instances\n"));\r
     return EFI_INVALID_PARAMETER;\r
   }\r
@@ -482,7 +483,7 @@ CoreLocateDevicePath (
     //\r
     // Check if DevicePath is first part of SourcePath\r
     //\r
-    Size = CoreDevicePathSize (TmpDevicePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);\r
+    Size = GetDevicePathSize (TmpDevicePath) - sizeof(EFI_DEVICE_PATH_PROTOCOL);\r
     if ((Size <= SourceSize) && CompareMem (SourcePath, TmpDevicePath, Size) == 0) {\r
       //\r
       // If the size is equal to the best match, then we\r
@@ -672,7 +673,7 @@ CoreLocateHandleBuffer (
     return Status;\r
   }\r
 \r
-  *Buffer = CoreAllocateBootServicesPool (BufferSize);\r
+  *Buffer = AllocatePool (BufferSize);\r
   if (*Buffer == NULL) {\r
     return EFI_OUT_OF_RESOURCES;\r
   }\r