1 /** @file
2   Defines MemImage - the view of the file that is visible at any point,
3   as well as the event handlers for editing the file
4 
5   Copyright (c) 2005 - 2011, Intel Corporation. All rights reserved. <BR>
6   This program and the accompanying materials
7   are licensed and made available under the terms and conditions of the BSD License
8   which accompanies this distribution.  The full text of the license may be found at
9   http://opensource.org/licenses/bsd-license.php
10 
11   THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12   WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 
14 **/
15 
16 #ifndef _LIB_MEM_IMAGE_H_
17 #define _LIB_MEM_IMAGE_H_
18 
19 #include "HexEditor.h"
20 
21 /**
22   Initialization function for HDiskImage.
23 
24   @retval EFI_SUCCESS       The operation was successful.
25   @retval EFI_LOAD_ERROR    A load error occured.
26 **/
27 EFI_STATUS
28 HMemImageInit (
29   VOID
30   );
31 
32 /**
33   Backup function for HDiskImage. Only a few fields need to be backup.
34   This is for making the Disk buffer refresh as few as possible.
35 
36   @retval EFI_SUCCESS       The operation was successful.
37 **/
38 EFI_STATUS
39 HMemImageBackup (
40   VOID
41   );
42 
43 /**
44   Set FileName field in HFileImage.
45 
46   @param[in] Offset   The offset.
47   @param[in] Size     The size.
48 
49   @retval EFI_SUCCESS           The operation was successful.
50   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.
51 **/
52 EFI_STATUS
53 HMemImageSetMemOffsetSize (
54   IN UINTN Offset,
55   IN UINTN Size
56   );
57 
58 /**
59   Read a disk from disk into HBufferImage.
60 
61   @param[in] Offset   The offset.
62   @param[in] Size     The size.
63   @param[in] Recover  if is for recover, no information print.
64 
65   @retval EFI_LOAD_ERROR        A load error occured.
66   @retval EFI_SUCCESS           The operation was successful.
67   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.
68 **/
69 EFI_STATUS
70 HMemImageRead (
71   IN UINTN     Offset,
72   IN UINTN     Size,
73   IN BOOLEAN   Recover
74   );
75 
76 /**
77   Save lines in HBufferImage to disk.
78 
79   @param[in] Offset   The offset.
80   @param[in] Size     The size.
81 
82   @retval EFI_LOAD_ERROR        A load error occured.
83   @retval EFI_SUCCESS           The operation was successful.
84   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.
85 **/
86 EFI_STATUS
87 HMemImageSave (
88   IN UINTN Offset,
89   IN UINTN Size
90   );
91 
92 #endif
93