DiskImage.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. /** @file
  2. Defines DiskImage - the view of the file that is visible at any point,
  3. as well as the event handlers for editing the file
  4. Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
  5. SPDX-License-Identifier: BSD-2-Clause-Patent
  6. **/
  7. #ifndef _LIB_DISK_IMAGE_H_
  8. #define _LIB_DISK_IMAGE_H_
  9. #include "HexEditor.h"
  10. /**
  11. Initialization function for HDiskImage.
  12. @retval EFI_SUCCESS The operation was successful.
  13. @retval EFI_LOAD_ERROR A load error occurred.
  14. **/
  15. EFI_STATUS
  16. HDiskImageInit (
  17. VOID
  18. );
  19. /**
  20. Cleanup function for HDiskImage.
  21. @retval EFI_SUCCESS The operation was successful.
  22. **/
  23. EFI_STATUS
  24. HDiskImageCleanup (
  25. VOID
  26. );
  27. /**
  28. Backup function for HDiskImage. Only a few fields need to be backup.
  29. This is for making the Disk buffer refresh as few as possible.
  30. @retval EFI_SUCCESS The operation was successful.
  31. @retval EFI_OUT_OF_RESOURCES gST->ConOut of resources.
  32. **/
  33. EFI_STATUS
  34. HDiskImageBackup (
  35. VOID
  36. );
  37. /**
  38. Read a disk from disk into HBufferImage.
  39. @param[in] DeviceName filename to read.
  40. @param[in] Offset The offset.
  41. @param[in] Size The size.
  42. @param[in] Recover if is for recover, no information print.
  43. @retval EFI_SUCCESS The operation was successful.
  44. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
  45. @retval EFI_LOAD_ERROR A load error occurred.
  46. @retval EFI_INVALID_PARAMETER A parameter was invalid.
  47. **/
  48. EFI_STATUS
  49. HDiskImageRead (
  50. IN CONST CHAR16 *DeviceName,
  51. IN UINTN Offset,
  52. IN UINTN Size,
  53. IN BOOLEAN Recover
  54. );
  55. /**
  56. Save lines in HBufferImage to disk.
  57. NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!!
  58. @param[in] DeviceName The device name.
  59. @param[in] Offset The offset.
  60. @param[in] Size The size.
  61. @retval EFI_SUCCESS The operation was successful.
  62. @retval EFI_OUT_OF_RESOURCES A memory allocation failed.
  63. @retval EFI_LOAD_ERROR A load error occurred.
  64. @retval EFI_INVALID_PARAMETER A parameter was invalid.
  65. **/
  66. EFI_STATUS
  67. HDiskImageSave (
  68. IN CHAR16 *DeviceName,
  69. IN UINTN Offset,
  70. IN UINTN Size
  71. );
  72. #endif