TianoCore EDK2 master
|
#include "FileExplorer.h"
Go to the source code of this file.
Variables | |
EFI_GUID | FileExplorerGuid = EFI_FILE_EXPLORE_FORMSET_GUID |
MENU_OPTION | mFsOptionMenu |
FILE_EXPLORER_CALLBACK_DATA | gFileExplorerPrivate |
HII_VENDOR_DEVICE_PATH * | gHiiVendorDevicePath |
HII_VENDOR_DEVICE_PATH | FeHiiVendorDevicePath |
VOID * | mLibStartOpCodeHandle = NULL |
VOID * | mLibEndOpCodeHandle = NULL |
EFI_IFR_GUID_LABEL * | mLibStartLabel = NULL |
EFI_IFR_GUID_LABEL * | mLibEndLabel = NULL |
UINT16 | mQuestionIdUpdate |
CHAR16 | mNewFileName [MAX_FILE_NAME_LEN] |
CHAR16 | mNewFolderName [MAX_FOLDER_NAME_LEN] |
UINTN | mNewFileQuestionId = NEW_FILE_QUESTION_ID_BASE |
UINTN | mNewFolderQuestionId = NEW_FOLDER_QUESTION_ID_BASE |
File explorer related functions.
Copyright (c) 2004 - 2019, Intel Corporation. All rights reserved.
SPDX-License-Identifier: BSD-2-Clause-Patent
Definition in file FileExplorer.c.
EFI_STATUS EFIAPI ChooseFile | ( | IN EFI_DEVICE_PATH_PROTOCOL * | RootDirectory, |
IN CHAR16 *FileType | OPTIONAL, | ||
IN CHOOSE_HANDLER ChooseHandler | OPTIONAL, | ||
OUT EFI_DEVICE_PATH_PROTOCOL **File | OPTIONAL | ||
) |
Choose a file in the specified directory.
If user input NULL for the RootDirectory, will choose file in the system.
If user input *File != NULL, function will return the allocate device path info for the choosed file, caller has to free the memory after use it.
RootDirectory | Pointer to the root directory. |
FileType | The file type need to choose. |
ChooseHandler | Function pointer to the extra task need to do after choose one file. |
File | Return the device path for the last time chosed file. |
EFI_SUCESS | Choose file success. |
EFI_INVALID_PARAMETER | Both ChooseHandler and return device path are NULL One of them must not NULL. |
Other | errors Choose file failed. |
Definition at line 1488 of file FileExplorer.c.
EFI_STATUS EFIAPI FileExplorerLibConstructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Install Boot Manager Menu driver.
ImageHandle | The image handle. |
SystemTable | The system table. |
EFI_SUCEESS | Install File explorer library success. |
Definition at line 1576 of file FileExplorer.c.
EFI_STATUS EFIAPI FileExplorerLibDestructor | ( | IN EFI_HANDLE | ImageHandle, |
IN EFI_SYSTEM_TABLE * | SystemTable | ||
) |
Unloads the application and its installed protocol.
[in] | ImageHandle | Handle that identifies the image to be unloaded. |
[in] | SystemTable | The system table. |
EFI_SUCCESS | The image has been unloaded. |
Definition at line 1639 of file FileExplorer.c.
Append file name to existing file name.
Str1 | The existing file name |
Str2 | The file name to be appended |
Definition at line 676 of file FileExplorer.c.
EFI_STATUS EFIAPI LibCallback | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN EFI_BROWSER_ACTION | Action, | ||
IN EFI_QUESTION_ID | QuestionId, | ||
IN UINT8 | Type, | ||
IN EFI_IFR_TYPE_VALUE * | Value, | ||
OUT EFI_BROWSER_ACTION_REQUEST * | ActionRequest | ||
) |
This function processes the results of changes in configuration. When user select a interactive opcode, this callback will be triggered. Based on the Question(QuestionId) that triggers the callback, the corresponding actions is performed. It handles:
1) Process the axtra action or exit file explorer when user select one file . 2) update of file content if a dir is selected.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Action | Specifies the type of action taken by the browser. |
QuestionId | A unique value which is sent to the original exporting driver so that it can identify the type of data to expect. |
Type | The type of value for the question. |
Value | A pointer to the data being sent to the original exporting driver. |
ActionRequest | On return, points to the action requested by the callback function. |
EFI_SUCCESS | The callback successfully handled the action. |
other | error Error occur when parse one directory. |
Definition at line 179 of file FileExplorer.c.
MENU_ENTRY * LibCreateMenuEntry | ( | VOID | ) |
Create a menu entry by given menu type.
NULL | If failed to create the menu. |
Definition at line 296 of file FileExplorer.c.
EFI_STATUS LibCreateNewFile | ( | IN CHAR16 * | FileName, |
IN BOOLEAN | CreateFile | ||
) |
Create a new file or folder in current directory.
FileName | Point to the fileNmae or folder. |
CreateFile | CreateFile== TRUE means create a new file. CreateFile== FALSE means create a new Folder. |
Create a new file or folder in current directory.
FileName | Point to the fileNmae or folder name. |
CreateFile | CreateFile== TRUE means create a new file. CreateFile== FALSE means create a new Folder. |
Definition at line 1063 of file FileExplorer.c.
VOID LibDestroyMenuEntry | ( | MENU_ENTRY * | MenuEntry | ) |
Free up all resource allocated for a BM_MENU_ENTRY.
MenuEntry | A pointer to BM_MENU_ENTRY. |
Definition at line 361 of file FileExplorer.c.
CHAR16 * LibDevicePathToStr | ( | IN EFI_DEVICE_PATH_PROTOCOL * | DevPath | ) |
This function converts an input device structure to a Unicode string.
DevPath | A pointer to the device path structure. |
Definition at line 476 of file FileExplorer.c.
EFI_STATUS EFIAPI LibExtractConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Request, | ||
OUT EFI_STRING * | Progress, | ||
OUT EFI_STRING * | Results | ||
) |
This function allows a caller to extract the current configuration for one or more named elements from the target driver.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Request | A null-terminated Unicode string in <ConfigRequest> format. |
Progress | On return, points to a character in the Request string. Points to the string's null terminator if request was successful. Points to the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) if the request was not successful. |
Results | A null-terminated Unicode string in <ConfigAltResp> format which has all values filled in for the names in the Request string. String to be allocated by the called function. |
EFI_INVALID_PARAMETER | Request is illegal syntax, or unknown name. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
Definition at line 111 of file FileExplorer.c.
VOID * LibFileInfo | ( | IN EFI_FILE_HANDLE | FHand, |
IN EFI_GUID * | InfoType | ||
) |
Function gets the file information from an open file descriptor, and stores it in a buffer allocated from pool.
FHand | File Handle. |
InfoType | Info type need to get. |
A | pointer to a buffer with file information or NULL is returned |
Definition at line 543 of file FileExplorer.c.
EFI_STATUS LibFindFiles | ( | IN EFI_FILE_HANDLE | FileHandle, |
IN UINT16 * | FileName, | ||
IN EFI_HANDLE | DeviceHandle | ||
) |
Find files under current directory.
All files and sub-directories in current directory will be stored in DirectoryMenu for future use.
FileHandle | Parent file handle. |
FileName | Parent file name. |
DeviceHandle | Driver handle for this partition. |
EFI_SUCCESS | Get files from current dir successfully. |
Definition at line 1138 of file FileExplorer.c.
EFI_STATUS LibFindFileSystem | ( | VOID | ) |
This function build the FsOptionMenu list which records all available file system in the system. They includes all instances of EFI_SIMPLE_FILE_SYSTEM_PROTOCOL, all instances of EFI_LOAD_FILE_SYSTEM.
EFI_SUCCESS | Success find the file system |
EFI_OUT_OF_RESOURCES | Can not create menu entry |
Definition at line 765 of file FileExplorer.c.
VOID LibFreeMenu | ( | MENU_OPTION * | FreeMenu | ) |
Free resources allocated in Allocate Rountine.
FreeMenu | Menu to be freed |
Definition at line 402 of file FileExplorer.c.
VOID LibGetDevicePath | ( | IN UINT16 | KeyValue | ) |
Get the device path info saved in the menu structure.
KeyValue | Key value to identify the type of data to expect. |
Definition at line 1446 of file FileExplorer.c.
EFI_STATUS LibGetFileHandleFromDevicePath | ( | IN EFI_DEVICE_PATH_PROTOCOL * | RootDirectory, |
OUT EFI_FILE_HANDLE * | RetFileHandle, | ||
OUT UINT16 ** | ParentFileName, | ||
OUT EFI_HANDLE * | DeviceHandle | ||
) |
Find the file handle from the input device path info.
RootDirectory | Device path info. |
RetFileHandle | Return the file handle for the input device path. |
ParentFileName | Parent file name. |
DeviceHandle | Driver handle for this partition. |
EFI_SUCESS | Find the file handle success. |
Other | Find the file handle failure. |
Definition at line 925 of file FileExplorer.c.
EFI_STATUS LibGetFileHandleFromMenu | ( | IN MENU_ENTRY * | MenuEntry, |
OUT EFI_FILE_HANDLE * | RetFileHandle | ||
) |
Find the file handle from the input menu info.
MenuEntry | Input Menu info. |
RetFileHandle | Return the file handle for the input device path. |
EFI_SUCESS | Find the file handle success. |
Other | Find the file handle failure. |
Definition at line 877 of file FileExplorer.c.
MENU_ENTRY * LibGetMenuEntry | ( | MENU_OPTION * | MenuOption, |
UINTN | MenuNumber | ||
) |
Get the Menu Entry from the list in Menu Entry List.
If MenuNumber is great or equal to the number of Menu Entry in the list, then ASSERT.
MenuOption | The Menu Entry List to read the menu entry. |
MenuNumber | The index of Menu Entry. |
Definition at line 333 of file FileExplorer.c.
CHAR16 * LibGetTypeFromName | ( | IN CHAR16 * | FileName | ) |
Get file type base on the file name. Just cut the file name, from the ".". eg ".efi"
FileName | File need to be checked. |
the | file type string. |
Definition at line 587 of file FileExplorer.c.
BOOLEAN LibIsSupportedFileType | ( | IN UINT16 * | FileName | ) |
Check whether current FileName point to a valid Efi Image File.
FileName | File need to be checked. |
TRUE | Is Efi Image |
FALSE | Not a valid Efi Image |
Definition at line 634 of file FileExplorer.c.
EFI_FILE_HANDLE LibOpenRoot | ( | IN EFI_HANDLE | DeviceHandle | ) |
Function opens and returns a file handle to the root directory of a volume.
DeviceHandle | A handle for a device |
Definition at line 432 of file FileExplorer.c.
VOID LibRefreshUpdateData | ( | VOID | ) |
Refresh the global UpdateData structure.
Definition at line 1256 of file FileExplorer.c.
EFI_STATUS EFIAPI LibRouteConfig | ( | IN CONST EFI_HII_CONFIG_ACCESS_PROTOCOL * | This, |
IN CONST EFI_STRING | Configuration, | ||
OUT EFI_STRING * | Progress | ||
) |
This function processes the results of changes in configuration.
This | Points to the EFI_HII_CONFIG_ACCESS_PROTOCOL. |
Configuration | A null-terminated Unicode string in <ConfigResp> format. |
Progress | A pointer to a string filled in with the offset of the most recent '&' before the first failing name/value pair (or the beginning of the string if the failure is in the first name/value pair) or the terminating NULL if all was successful. |
EFI_INVALID_PARAMETER | Configuration is NULL. |
EFI_NOT_FOUND | Routing data doesn't match any storage in this driver. |
Definition at line 143 of file FileExplorer.c.
CHAR16 * LibStrDuplicate | ( | IN CHAR16 * | Src | ) |
Duplicate a string.
Src | The source. |
NULL | If there is not enough memory. |
Definition at line 514 of file FileExplorer.c.
VOID LibToLowerString | ( | IN CHAR16 * | String | ) |
Converts the unicode character of the string from uppercase to lowercase. This is a internal function.
ConfigString | String to be converted |
Definition at line 609 of file FileExplorer.c.
VOID LibUpdateFileExplorePage | ( | VOID | ) |
Update the File Explore page.
Definition at line 1310 of file FileExplorer.c.
EFI_STATUS LibUpdateFileExplorer | ( | IN UINT16 | KeyValue | ) |
Update the file explower page with the refershed file system.
KeyValue | Key value to identify the type of data to expect. |
EFI_SUCCESS | Update the file explorer form success. |
other | errors Error occur when parse one directory. |
Definition at line 1405 of file FileExplorer.c.
HII_VENDOR_DEVICE_PATH FeHiiVendorDevicePath |
Definition at line 39 of file FileExplorer.c.
EFI_GUID FileExplorerGuid = EFI_FILE_EXPLORE_FORMSET_GUID |
Definition at line 11 of file FileExplorer.c.
FILE_EXPLORER_CALLBACK_DATA gFileExplorerPrivate |
Definition at line 23 of file FileExplorer.c.
HII_VENDOR_DEVICE_PATH* gHiiVendorDevicePath |
Definition at line 37 of file FileExplorer.c.
MENU_OPTION mFsOptionMenu |
File system selection menu
Definition at line 16 of file FileExplorer.c.
EFI_IFR_GUID_LABEL* mLibEndLabel = NULL |
Definition at line 68 of file FileExplorer.c.
VOID* mLibEndOpCodeHandle = NULL |
Definition at line 66 of file FileExplorer.c.
EFI_IFR_GUID_LABEL* mLibStartLabel = NULL |
Definition at line 67 of file FileExplorer.c.
VOID* mLibStartOpCodeHandle = NULL |
Definition at line 65 of file FileExplorer.c.
CHAR16 mNewFileName[MAX_FILE_NAME_LEN] |
Definition at line 70 of file FileExplorer.c.
UINTN mNewFileQuestionId = NEW_FILE_QUESTION_ID_BASE |
Definition at line 72 of file FileExplorer.c.
CHAR16 mNewFolderName[MAX_FOLDER_NAME_LEN] |
Definition at line 71 of file FileExplorer.c.
UINTN mNewFolderQuestionId = NEW_FOLDER_QUESTION_ID_BASE |
Definition at line 73 of file FileExplorer.c.
UINT16 mQuestionIdUpdate |
Definition at line 69 of file FileExplorer.c.