DiskImage.c revision 4fd606d1f5abe38e1f42c38de1d2e895166bd0f4
1N/A Functions to deal with Disk buffer. 1N/A Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR> 1N/A This program and the accompanying materials 1N/A are licensed and made available under the terms and conditions of the BSD License 1N/A which accompanies this distribution. The full text of the license may be found at 1N/A THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, 1N/A WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. 1N/A// for basic initialization of HDiskImage 1N/A Initialization function for HDiskImage. @retval EFI_SUCCESS The operation was successful. @retval EFI_LOAD_ERROR A load error occured. // basically initialize the HDiskImage Backup function for HDiskImage. Only a few fields need to be backup. This is for making the Disk buffer refresh as few as possible. @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES gST->ConOut of resources. // backup the disk name, offset and size Cleanup function for HDiskImage. @retval EFI_SUCCESS The operation was successful. Set FileName field in HFileImage. @param[in] Str File name to set. @param[in] Offset The offset. @param[in] Size The size. @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. // free the old file name Read a disk from disk into HBufferImage. @param[in] DeviceName filename to read. @param[in] Offset The offset. @param[in] Size The size. @param[in] Recover if is for recover, no information print. @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A load error occured. @retval EFI_INVALID_PARAMETER A parameter was invalid. // if Offset exceeds LastBlock, // convert buffer to line list // initialize some variables Save lines in HBufferImage to disk. NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!! @param[in] DeviceName The device name. @param[in] Offset The offset. @param[in] Size The size. @retval EFI_SUCCESS The operation was successful. @retval EFI_OUT_OF_RESOURCES A memory allocation failed. @retval EFI_LOAD_ERROR A load error occured. @retval EFI_INVALID_PARAMETER A parameter was invalid. // if not modified, directly return // StatusBarSetStatusString (L"Cannot Find Device"); // StatusBarSetStatusString (L"Read Disk Failed"); // StatusBarSetStatusString (L"Read Disk Failed"); // concatenate the line list to a buffer // write the buffer to disk