• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 
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_DISK_IMAGE_H_
17 #define _LIB_DISK_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 HDiskImageInit (
29   VOID
30   );
31 
32 /**
33   Cleanup function for HDiskImage.
34 
35   @retval EFI_SUCCESS           The operation was successful.
36 **/
37 EFI_STATUS
38 HDiskImageCleanup (
39   VOID
40   );
41 
42 /**
43   Backup function for HDiskImage. Only a few fields need to be backup.
44   This is for making the Disk buffer refresh as few as possible.
45 
46   @retval EFI_SUCCESS           The operation was successful.
47   @retval EFI_OUT_OF_RESOURCES  gST->ConOut of resources.
48 **/
49 EFI_STATUS
50 HDiskImageBackup (
51   VOID
52   );
53 
54 /**
55   Read a disk from disk into HBufferImage.
56 
57   @param[in] DeviceName   filename to read.
58   @param[in] Offset       The offset.
59   @param[in] Size         The size.
60   @param[in] Recover      if is for recover, no information print.
61 
62   @retval EFI_SUCCESS           The operation was successful.
63   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.
64   @retval EFI_LOAD_ERROR        A load error occured.
65   @retval EFI_INVALID_PARAMETER A parameter was invalid.
66 **/
67 EFI_STATUS
68 HDiskImageRead (
69   IN CONST CHAR16   *DeviceName,
70   IN UINTN    Offset,
71   IN UINTN    Size,
72   IN BOOLEAN  Recover
73   );
74 
75 /**
76   Save lines in HBufferImage to disk.
77   NOT ALLOW TO WRITE TO ANOTHER DISK!!!!!!!!!
78 
79   @param[in] DeviceName   The device name.
80   @param[in] Offset       The offset.
81   @param[in] Size         The size.
82 
83   @retval EFI_SUCCESS           The operation was successful.
84   @retval EFI_OUT_OF_RESOURCES  A memory allocation failed.
85   @retval EFI_LOAD_ERROR        A load error occured.
86   @retval EFI_INVALID_PARAMETER A parameter was invalid.
87 **/
88 EFI_STATUS
89 HDiskImageSave (
90   IN CHAR16 *DeviceName,
91   IN UINTN  Offset,
92   IN UINTN  Size
93   );
94 
95 #endif
96