X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=ShellPkg%2FLibrary%2FUefiShellLevel2CommandsLib%2FRm.c;h=ea3792a3be1fb8a33b44c623643e507f244ee974;hp=bde710faf044f9be2a4b1df3728f71c2c581e24c;hb=ae724571beb0cff6edefe42942b7cdc7aa81ee94;hpb=a405b86d274d32b92f69842bfb9a1ab143128f57 diff --git a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c index bde710faf0..ea3792a3be 100644 --- a/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c +++ b/ShellPkg/Library/UefiShellLevel2CommandsLib/Rm.c @@ -1,7 +1,7 @@ /** @file Main file for attrib shell level 2 function. - Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.
+ Copyright (c) 2009 - 2011, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -19,6 +19,14 @@ STATIC CONST SHELL_PARAM_ITEM ParamList[] = { {NULL, TypeMax} }; +/** + Determine if a directory has no files in it. + + @param[in] FileHandle The EFI_HANDLE to the directory. + + @retval TRUE The directory has no files (or directories). + @retval FALSE The directory has at least 1 file or directory in it. +**/ BOOLEAN EFIAPI IsDirectoryEmpty ( @@ -45,6 +53,17 @@ IsDirectoryEmpty ( return (RetVal); } +/** + Delete a node and all nodes under it (including sub directories). + + @param[in] Node The node to start deleting with. + @param[in] Quiet TRUE to print no messages. + + @retval SHELL_SUCCESS The operation was successful. + @retval SHELL_ACCESS_DENIED A file was read only. + @retval SHELL_ABORTED The abort message was received. + @retval SHELL_DEVICE_ERROR A device error occured reading this Node. +**/ SHELL_STATUS EFIAPI CascadeDelete( @@ -126,7 +145,7 @@ CascadeDelete( } // - // We cant allow for the warning here! + // We cant allow for the warning here! (Dont use EFI_ERROR Macro). // if (Status != EFI_SUCCESS){ ShellPrintHiiEx(-1, -1, NULL, STRING_TOKEN (STR_RM_LOG_DELETE_ERR), gShellLevel2HiiHandle, Status); @@ -137,6 +156,13 @@ CascadeDelete( } } +/** + Determins if a Node is a valid delete target. Will prevent deleting the root directory. + + @param[in] List RESERVED. Not used. + @param[in] Node The node to analyze. + @param[in] Package RESERVED. Not used. +**/ BOOLEAN EFIAPI IsValidDeleteTarget(