]> git.proxmox.com Git - mirror_edk2.git/blobdiff - MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.c
Synchronize function comment in
[mirror_edk2.git] / MdePkg / Library / UefiDevicePathLib / UefiDevicePathLib.c
index 708b48a088e42d19ade75df6aa435f247a00de5e..8bdb598f88f106f9bdf2289edaa981dde63137f3 100644 (file)
@@ -50,8 +50,9 @@ GLOBAL_REMOVE_IF_UNREFERENCED CONST EFI_DEVICE_PATH_PROTOCOL  mUefiDevicePathLib
   DevicePath including the end of device path node.  If DevicePath is NULL, then 0 is returned.\r
 \r
   @param  DevicePath                 A pointer to a device path data structure.\r
-\r
-  @return The size of a device path in bytes.\r
+  \r
+  @retval 0       If DevicePath is NULL.\r
+  @retval Others  The size of a device path in bytes.\r
 \r
 **/\r
 UINTN\r
@@ -87,11 +88,14 @@ GetDevicePathSize (
   DevicePath is NULL, then NULL is returned.  If the memory is successfully allocated, then the\r
   contents of DevicePath are copied to the newly allocated buffer, and a pointer to that buffer\r
   is returned.  Otherwise, NULL is returned.  \r
+  The memory for the new device path is allocated from EFI boot services memory. \r
+  It is the responsibility of the caller to free the memory allocated. \r
   \r
   @param  DevicePath                 A pointer to a device path data structure.\r
 \r
-  @return A pointer to the duplicated device path.\r
-\r
+  @retval NULL    If DevicePath is NULL.\r
+  @retval Others  A pointer to the duplicated device path.\r
+  \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
 EFIAPI\r
@@ -132,8 +136,10 @@ DuplicateDevicePath (
 \r
   @param  FirstDevicePath            A pointer to a device path data structure.\r
   @param  SecondDevicePath           A pointer to a device path data structure.\r
-\r
-  @return A pointer to the new device path.\r
+  \r
+  @retval NULL      If there is not enough memory for the newly allocated buffer.\r
+  @retval Others    A pointer to the new device path if success.\r
+                    Or a copy an end-of-device-path if both FirstDevicePath and SecondDevicePath are NULL.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
@@ -201,7 +207,11 @@ AppendDevicePath (
   @param  DevicePath                 A pointer to a device path data structure.\r
   @param  DevicePathNode             A pointer to a single device path node.\r
 \r
-  @return A pointer to the new device path.\r
+  @retval NULL      If there is not enough memory for the new device path.\r
+  @retval Others    A pointer to the new device path if success.\r
+                    A copy of DevicePathNode followed by an end-of-device-path node \r
+                    if both FirstDevicePath and SecondDevicePath are NULL.\r
+                    A copy of an end-of-device-path node if both FirstDevicePath and SecondDevicePath are NULL.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
@@ -381,8 +391,7 @@ GetNextDevicePathInstance (
 }\r
 \r
 /**\r
-  Creates a copy of the current device path instance and returns a pointer to the next device path\r
-  instance.\r
+  Creates a device node.\r
 \r
   This function creates a new device node in a newly allocated buffer of size NodeLength and\r
   initializes the device path node header with NodeType and NodeSubType.  The new device path node\r
@@ -396,7 +405,7 @@ GetNextDevicePathInstance (
   @param  NodeSubType                The device node sub-type for the new device node.\r
   @param  NodeLength                 The length of the new device node.\r
 \r
-  @return A pointer to the new create device path.\r
+  @return The new device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r
@@ -502,13 +511,17 @@ DevicePathFromHandle (
   handle Device.  The allocated device path is returned.  If Device is NULL or Device is a handle\r
   that does not support the device path protocol, then a device path containing a single device\r
   path node for the file specified by FileName is allocated and returned.\r
+  The memory for the new device path is allocated from EFI boot services memory. It is the responsibility\r
+  of the caller to free the memory allocated.\r
+  \r
   If FileName is NULL, then ASSERT().\r
+  If FileName is not aligned on a 16-bit boundary, then ASSERT().\r
 \r
   @param  Device                     A pointer to a device handle.  This parameter is optional and\r
                                      may be NULL.\r
   @param  FileName                   A pointer to a Null-terminated Unicode string.\r
 \r
-  @return A pointer to the new created file device path.\r
+  @return The allocated device path.\r
 \r
 **/\r
 EFI_DEVICE_PATH_PROTOCOL *\r