/** @file\r
Internal file explorer functions for SecureBoot configuration module.\r
\r
-Copyright (c) 2012 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2012 - 2014, Intel Corporation. All rights reserved.<BR>\r
This program and the accompanying materials\r
are licensed and made available under the terms and conditions of the BSD License\r
which accompanies this distribution. The full text of the license may be found at\r
}\r
\r
/**\r
- Helper function called as part of the code needed to allocate \r
+ Helper function called as part of the code needed to allocate\r
the proper sized buffer for various EFI interfaces.\r
\r
@param[in, out] Status Current status\r
}\r
\r
/**\r
- Append file name to existing file name, and allocate a new buffer \r
+ Append file name to existing file name, and allocate a new buffer\r
to hold the appended result.\r
\r
@param[in] Str1 The existing file name\r
Str = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));\r
ASSERT (Str != NULL);\r
\r
- TmpStr = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16)); \r
+ TmpStr = AllocateZeroPool (Size1 + Size2 + sizeof (CHAR16));\r
ASSERT (TmpStr != NULL);\r
\r
StrCat (Str, Str1);\r
//\r
\r
//\r
- // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings \r
+ // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings\r
// that overlap.\r
//\r
StrCpy (TmpStr, Ptr + 3);\r
//\r
\r
//\r
- // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings \r
+ // Use TmpStr as a backup, as StrCpy in BaseLib does not handle copy of two strings\r
// that overlap.\r
//\r
StrCpy (TmpStr, Ptr + 2);\r
}\r
\r
FreePool (TmpStr);\r
- \r
+\r
return Str;\r
}\r
\r
Free resources allocated in Allocate Rountine.\r
\r
@param[in, out] MenuOption Menu to be freed\r
- \r
+\r
**/\r
VOID\r
FreeMenu (\r
This function opens a file with the open mode according to the file path. The\r
Attributes is valid only for EFI_FILE_MODE_CREATE.\r
\r
- @param[in, out] FilePath On input, the device path to the file. \r
+ @param[in, out] FilePath On input, the device path to the file.\r
On output, the remaining device path.\r
@param[out] FileHandle Pointer to the file handle.\r
@param[in] OpenMode The mode to open the file with.\r
EFI_SIMPLE_FILE_SYSTEM_PROTOCOL *EfiSimpleFileSystemProtocol;\r
EFI_FILE_PROTOCOL *Handle1;\r
EFI_FILE_PROTOCOL *Handle2;\r
- EFI_HANDLE DeviceHandle; \r
+ EFI_HANDLE DeviceHandle;\r
\r
if ((FilePath == NULL || FileHandle == NULL)) {\r
return EFI_INVALID_PARAMETER;\r
{\r
UINTN NoBlkIoHandles;\r
UINTN NoSimpleFsHandles;\r
- UINTN NoLoadFileHandles;\r
EFI_HANDLE *BlkIoHandle;\r
EFI_HANDLE *SimpleFsHandle;\r
UINT16 *VolumeLabel;\r
\r
\r
NoSimpleFsHandles = 0;\r
- NoLoadFileHandles = 0;\r
OptionNumber = 0;\r
InitializeListHead (&FsOptionMenu.Head);\r
\r
if (NoSimpleFsHandles != 0) {\r
FreePool (SimpleFsHandle);\r
}\r
- \r
+\r
//\r
// Remember how many file system options are here\r
//\r
\r
\r
/**\r
- Find files under the current directory. All files and sub-directories \r
+ Find files under the current directory. All files and sub-directories\r
in current directory will be stored in DirectoryMenu for future use.\r
\r
@param[in] MenuEntry The Menu Entry.\r
if (DirInfo == NULL) {\r
return EFI_OUT_OF_RESOURCES;\r
}\r
- \r
+\r
//\r
// Get all files in current directory\r
// Pass 1 to get Directories\r
NewFileContext->FileName\r
);\r
NewMenuEntry->HelpString = NULL;\r
- \r
+\r
NewFileContext->IsDir = (BOOLEAN) ((DirInfo->Attribute & EFI_FILE_DIRECTORY) == EFI_FILE_DIRECTORY);\r
if (NewFileContext->IsDir) {\r
BufferSize = StrLen (DirInfo->FileName) * 2 + 6;\r
{\r
//\r
// Free current updated date\r
- // \r
+ //\r
if (mStartOpCodeHandle != NULL) {\r
HiiFreeOpCodeHandle (mStartOpCodeHandle);\r
}\r
} else if (FeCurrentState == FileExplorerStateEnrollSignatureFileToDbx) {\r
FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DBX;\r
FileFormId = FORM_FILE_EXPLORER_ID_DBX;\r
+ } else if (FeCurrentState == FileExplorerStateEnrollSignatureFileToDbt) {\r
+ FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DBT;\r
+ FileFormId = FORM_FILE_EXPLORER_ID_DBT;\r
} else {\r
return;\r
}\r
NewMenuEntry->DisplayStringToken,\r
STRING_TOKEN (STR_NULL),\r
EFI_IFR_FLAG_CALLBACK,\r
- (UINT16) (FILE_OPTION_OFFSET + Index)\r
+ (UINT16) (FILE_OPTION_GOTO_OFFSET + Index)\r
);\r
}\r
}\r
//\r
FreeMenu (&FsOptionMenu);\r
FindFileSystem ();\r
- \r
+\r
CreateMenuStringToken (PrivateData->HiiHandle, &FsOptionMenu);\r
UpdateFileExplorePage (PrivateData->HiiHandle, &FsOptionMenu, PrivateData->FeCurrentState);\r
\r
FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DB;\r
} else if (PrivateData->FeCurrentState == FileExplorerStateEnrollSignatureFileToDbx) {\r
FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DBX;\r
+ } else if (PrivateData->FeCurrentState == FileExplorerStateEnrollSignatureFileToDbt) {\r
+ FormId = SECUREBOOT_ENROLL_SIGNATURE_TO_DBT;\r
} else {\r
return FALSE;\r
}\r
\r
PrivateData->MenuEntry = NewMenuEntry;\r
PrivateData->FileContext->FileName = NewFileContext->FileName;\r
- \r
+\r
TmpDevicePath = NewFileContext->DevicePath;\r
OpenFileByDevicePath (\r
&TmpDevicePath,\r
}\r
\r
/**\r
- Clean up the dynamic opcode at label and form specified by both LabelId. \r
+ Clean up the dynamic opcode at label and form specified by both LabelId.\r
\r
@param[in] LabelId It is both the Form ID and Label ID for opcode deletion.\r
@param[in] PrivateData Module private data.\r
mEndOpCodeHandle // LABEL_END\r
);\r
}\r
-\r