2011-03-25 22:15:07 +01:00
|
|
|
/** @file
|
2018-06-27 15:13:38 +02:00
|
|
|
Defines DiskImage - the view of the file that is visible at any point,
|
2011-03-25 22:15:07 +01:00
|
|
|
as well as the event handlers for editing the file
|
2018-06-27 15:13:38 +02:00
|
|
|
|
|
|
|
Copyright (c) 2005 - 2018, Intel Corporation. All rights reserved. <BR>
|
2019-04-04 01:07:06 +02:00
|
|
|
SPDX-License-Identifier: BSD-2-Clause-Patent
|
2011-03-25 22:15:07 +01:00
|
|
|
|
|
|
|
**/
|
|
|
|
|
|
|
|
#ifndef _LIB_DISK_IMAGE_H_
|
|
|
|
#define _LIB_DISK_IMAGE_H_
|
|
|
|
|
|
|
|
#include "HexEditor.h"
|
|
|
|
|
2011-04-05 22:55:45 +02:00
|
|
|
/**
|
|
|
|
Initialization function for HDiskImage.
|
2018-06-27 15:13:38 +02:00
|
|
|
|
2011-04-05 22:55:45 +02:00
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
@retval EFI_LOAD_ERROR A load error occured.
|
|
|
|
**/
|
2011-03-25 22:15:07 +01:00
|
|
|
EFI_STATUS
|
|
|
|
HDiskImageInit (
|
|
|
|
VOID
|
|
|
|
);
|
2011-04-05 22:55:45 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
Cleanup function for HDiskImage.
|
|
|
|
|
|
|
|
@retval EFI_SUCCESS The operation was successful.
|
|
|
|
**/
|
2011-03-25 22:15:07 +01:00
|
|
|
EFI_STATUS
|
|
|
|
HDiskImageCleanup (
|
|
|
|
VOID
|
|
|
|
);
|
2011-04-05 22:55:45 +02:00
|
|
|
|
|
|
|
/**
|
2018-06-27 15:13:38 +02:00
|
|
|
Backup function for HDiskImage. Only a few fields need to be backup.
|
2011-04-05 22:55:45 +02:00
|
|
|
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.
|
|
|
|
**/
|
2011-03-25 22:15:07 +01:00
|
|
|
EFI_STATUS
|
|
|
|
HDiskImageBackup (
|
|
|
|
VOID
|
|
|
|
);
|
|
|
|
|
2011-04-05 22:55:45 +02:00
|
|
|
/**
|
|
|
|
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.
|
2018-06-27 15:13:38 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
2011-04-05 22:55:45 +02:00
|
|
|
**/
|
2011-03-25 22:15:07 +01:00
|
|
|
EFI_STATUS
|
|
|
|
HDiskImageRead (
|
2011-04-05 22:55:45 +02:00
|
|
|
IN CONST CHAR16 *DeviceName,
|
|
|
|
IN UINTN Offset,
|
|
|
|
IN UINTN Size,
|
|
|
|
IN BOOLEAN Recover
|
2011-03-25 22:15:07 +01:00
|
|
|
);
|
2011-04-05 22:55:45 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
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.
|
2018-06-27 15:13:38 +02:00
|
|
|
@retval EFI_INVALID_PARAMETER A parameter was invalid.
|
2011-04-05 22:55:45 +02:00
|
|
|
**/
|
2011-03-25 22:15:07 +01:00
|
|
|
EFI_STATUS
|
|
|
|
HDiskImageSave (
|
2011-04-05 22:55:45 +02:00
|
|
|
IN CHAR16 *DeviceName,
|
|
|
|
IN UINTN Offset,
|
|
|
|
IN UINTN Size
|
2011-03-25 22:15:07 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
#endif
|