SecurityPkg/VariableAuthenticated/SecureBootConfigDxe/SecureBootConfigFileExplorer.c File Reference


Functions

CHAR16 * StrDuplicate (IN CHAR16 *Src)
BOOLEAN GrowBuffer (IN OUT EFI_STATUS *Status, IN OUT VOID **Buffer, IN UINTN BufferSize)
CHAR16 * AppendFileName (IN CHAR16 *Str1, IN CHAR16 *Str2)
SECUREBOOT_MENU_ENTRYCreateMenuEntry (VOID)
SECUREBOOT_MENU_ENTRYGetMenuEntry (IN SECUREBOOT_MENU_OPTION *MenuOption, IN UINTN MenuNumber)
VOID CreateMenuStringToken (IN EFI_HII_HANDLE HiiHandle, IN SECUREBOOT_MENU_OPTION *MenuOption)
VOID DestroyMenuEntry (IN OUT SECUREBOOT_MENU_ENTRY *MenuEntry)
VOID FreeMenu (IN OUT SECUREBOOT_MENU_OPTION *MenuOption)
EFI_FILE_INFO * FileInfo (IN EFI_FILE_HANDLE FHand)
EFI_FILE_SYSTEM_VOLUME_LABEL * FileSystemVolumeLabelInfo (IN EFI_FILE_HANDLE FHand)
EFI_STATUS EFIAPI OpenFileByDevicePath (IN OUT EFI_DEVICE_PATH_PROTOCOL **FilePath, OUT EFI_FILE_HANDLE *FileHandle, IN UINT64 OpenMode, IN UINT64 Attributes)
EFI_FILE_HANDLE OpenRoot (IN EFI_HANDLE DeviceHandle)
EFI_STATUS FindFileSystem (VOID)
EFI_STATUS FindFiles (IN SECUREBOOT_MENU_ENTRY *MenuEntry)
VOID RefreshUpdateData (VOID)
VOID UpdateFileExplorePage (IN EFI_HII_HANDLE HiiHandle, IN SECUREBOOT_MENU_OPTION *MenuOption, IN FILE_EXPLORER_STATE FeCurrentState)
BOOLEAN UpdateFileExplorer (IN SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData, IN UINT16 KeyValue)
VOID CleanUpPage (IN UINT16 LabelId, IN SECUREBOOT_CONFIG_PRIVATE_DATA *PrivateData)

Variables

SECUREBOOT_MENU_OPTION FsOptionMenu
SECUREBOOT_MENU_OPTION DirectoryMenu
VOID * mStartOpCodeHandle = NULL
VOID * mEndOpCodeHandle = NULL
EFI_IFR_GUID_LABEL * mStartLabel = NULL
EFI_IFR_GUID_LABEL * mEndLabel = NULL

Detailed Description

Internal file explorer functions for SecureBoot configuration module.

Copyright (c) 2012 - 2015, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at http://opensource.org/licenses/bsd-license.php

THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.


Function Documentation

CHAR16* AppendFileName ( IN CHAR16 *  Str1,
IN CHAR16 *  Str2 
)

Append file name to existing file name, and allocate a new buffer to hold the appended result.

Parameters:
[in] Str1 The existing file name
[in] Str2 The file name to be appended
Returns:
A new string with appended result.

References UINTN().

Referenced by FindFiles().

VOID CleanUpPage ( IN UINT16  LabelId,
IN SECUREBOOT_CONFIG_PRIVATE_DATA PrivateData 
)

Clean up the dynamic opcode at label and form specified by both LabelId.

Parameters:
[in] LabelId It is both the Form ID and Label ID for opcode deletion.
[in] PrivateData Module private data.

References gSecureBootConfigFormSetGuid, mEndOpCodeHandle, mStartLabel, mStartOpCodeHandle, and RefreshUpdateData().

Referenced by SecureBootCallback().

SECUREBOOT_MENU_ENTRY* CreateMenuEntry ( VOID   ) 

Create a SECUREBOOT_MENU_ENTRY, and stores it in a buffer allocated from the pool.

Returns:
The new menu entry or NULL of error happens.

References SECUREBOOT_MENU_ENTRY::FileContext, SECUREBOOT_MENU_ENTRY_SIGNATURE, SECUREBOOT_MENU_ENTRY::Signature, and UINTN().

Referenced by FindFiles(), and FindFileSystem().

VOID CreateMenuStringToken ( IN EFI_HII_HANDLE  HiiHandle,
IN SECUREBOOT_MENU_OPTION MenuOption 
)

Create string tokens for a menu from its help strings and display strings.

Parameters:
[in] HiiHandle Hii Handle of the package to be updated.
[in] MenuOption The Menu whose string tokens need to be created.

References SECUREBOOT_MENU_ENTRY::DisplayString, SECUREBOOT_MENU_ENTRY::DisplayStringToken, GetMenuEntry(), SECUREBOOT_MENU_ENTRY::HelpString, SECUREBOOT_MENU_ENTRY::HelpStringToken, and UINTN().

Referenced by UpdateFileExplorer().

VOID DestroyMenuEntry ( IN OUT SECUREBOOT_MENU_ENTRY MenuEntry  ) 

EFI_FILE_INFO* FileInfo ( IN EFI_FILE_HANDLE  FHand  ) 

This function gets the file information from an open file descriptor, and stores it in a buffer allocated from pool.

Parameters:
[in] FHand File Handle.
Returns:
A pointer to a buffer with file information or NULL is returned

References EFI_STATUS(), GrowBuffer(), and UINTN().

Referenced by FindFiles(), and GetFileData().

EFI_FILE_SYSTEM_VOLUME_LABEL* FileSystemVolumeLabelInfo ( IN EFI_FILE_HANDLE  FHand  ) 

This function gets the file system information from an open file descriptor, and stores it in a buffer allocated from pool.

Parameters:
[in] FHand The file handle.
Returns:
A pointer to a buffer with file information.
Return values:
NULL is returned if failed to get Vaolume Label Info.

References EFI_STATUS(), GrowBuffer(), and UINTN().

Referenced by FindFileSystem().

EFI_STATUS FindFiles ( IN SECUREBOOT_MENU_ENTRY MenuEntry  ) 

EFI_STATUS FindFileSystem ( VOID   ) 

VOID FreeMenu ( IN OUT SECUREBOOT_MENU_OPTION MenuOption  ) 

Free resources allocated in Allocate Rountine.

Parameters:
[in,out] MenuOption Menu to be freed

References DestroyMenuEntry(), SECUREBOOT_MENU_ENTRY::Link, and SECUREBOOT_MENU_ENTRY_SIGNATURE.

Referenced by SecureBootCallback(), UninstallSecureBootConfigForm(), and UpdateFileExplorer().

SECUREBOOT_MENU_ENTRY* GetMenuEntry ( IN SECUREBOOT_MENU_OPTION MenuOption,
IN UINTN  MenuNumber 
)

Get Menu Entry from the Menu Entry List by MenuNumber.

If MenuNumber is great or equal to the number of Menu Entry in the list, then ASSERT.

Parameters:
[in] MenuOption The Menu Entry List to read the menu entry.
[in] MenuNumber The index of Menu Entry.
Returns:
The Menu Entry.

References SECUREBOOT_MENU_ENTRY_SIGNATURE, and UINTN().

Referenced by CreateMenuStringToken(), UpdateFileExplorePage(), and UpdateFileExplorer().

BOOLEAN GrowBuffer ( IN OUT EFI_STATUS *  Status,
IN OUT VOID **  Buffer,
IN UINTN  BufferSize 
)

Helper function called as part of the code needed to allocate the proper sized buffer for various EFI interfaces.

Parameters:
[in,out] Status Current status
[in,out] Buffer Current allocated buffer, or NULL
[in] BufferSize Current buffer size needed
Return values:
TRUE If the buffer was reallocated and the caller should try the API again.
FALSE The caller should not call this function again.

References BOOLEAN(), and TRUE.

Referenced by FileInfo(), and FileSystemVolumeLabelInfo().

EFI_STATUS EFIAPI OpenFileByDevicePath ( IN OUT EFI_DEVICE_PATH_PROTOCOL **  FilePath,
OUT EFI_FILE_HANDLE *  FileHandle,
IN UINT64  OpenMode,
IN UINT64  Attributes 
)

This function will open a file or directory referenced by DevicePath.

This function opens a file with the open mode according to the file path. The Attributes is valid only for EFI_FILE_MODE_CREATE.

Parameters:
[in,out] FilePath On input, the device path to the file. On output, the remaining device path.
[out] FileHandle Pointer to the file handle.
[in] OpenMode The mode to open the file with.
[in] Attributes The file's file attributes.
Return values:
EFI_SUCCESS The information was set.
EFI_INVALID_PARAMETER One of the parameters has an invalid value.
EFI_UNSUPPORTED Could not open the file path.
EFI_NOT_FOUND The specified file could not be found on the device or the file system could not be found on the device.
EFI_NO_MEDIA The device has no medium.
EFI_MEDIA_CHANGED The device has a different medium in it or the medium is no longer supported.
EFI_DEVICE_ERROR The device reported an error.
EFI_VOLUME_CORRUPTED The file system structures are corrupted.
EFI_WRITE_PROTECTED The file or medium is write protected.
EFI_ACCESS_DENIED The file was opened read only.
EFI_OUT_OF_RESOURCES Not enough resources were available to open the file.
EFI_VOLUME_FULL The volume is full.

References EFI_STATUS().

Referenced by UpdateFileExplorer().

EFI_FILE_HANDLE OpenRoot ( IN EFI_HANDLE  DeviceHandle  ) 

Function opens and returns a file handle to the root directory of a volume.

Parameters:
[in] DeviceHandle A handle for a device
Returns:
A valid file handle or NULL if error happens.

References EFI_STATUS().

Referenced by FindFileSystem().

VOID RefreshUpdateData ( VOID   ) 

Refresh the global UpdateData structure.

References mStartLabel, and mStartOpCodeHandle.

Referenced by CleanUpPage(), UpdateFileExplorePage(), and UpdateFileExplorer().

CHAR16* StrDuplicate ( IN CHAR16 *  Src  ) 

Duplicate a string.

Parameters:
[in] Src The source string.
Returns:
A new string which is duplicated copy of the source, or NULL if there is not enough memory.

References UINTN().

Referenced by FindFiles(), and FindFileSystem().

VOID UpdateFileExplorePage ( IN EFI_HII_HANDLE  HiiHandle,
IN SECUREBOOT_MENU_OPTION MenuOption,
IN FILE_EXPLORER_STATE  FeCurrentState 
)

BOOLEAN UpdateFileExplorer ( IN SECUREBOOT_CONFIG_PRIVATE_DATA PrivateData,
IN UINT16  KeyValue 
)


Variable Documentation

Initial value:

Files and sub-directories in current directory menu

Referenced by InstallSecureBootConfigForm(), SecureBootCallback(), and UninstallSecureBootConfigForm().

Initial value:

File system selection menu

Referenced by InstallSecureBootConfigForm(), SecureBootCallback(), and UninstallSecureBootConfigForm().

EFI_IFR_GUID_LABEL* mEndLabel = NULL

VOID* mEndOpCodeHandle = NULL

EFI_IFR_GUID_LABEL* mStartLabel = NULL

VOID* mStartOpCodeHandle = NULL


Generated on Thu Sep 24 23:44:25 2015 for SecurityPkg[ALL] by  doxygen 1.5.7.1