summaryrefslogtreecommitdiff
path: root/BaseTools/Source/C/GenFv
diff options
context:
space:
mode:
authorHess Chen <hesheng.chen@intel.com>2014-08-15 03:06:48 +0000
committerhchen30 <hchen30@6f19259b-4bc3-4df7-8a09-765794883524>2014-08-15 03:06:48 +0000
commit1be2ed90a20618d71ddf34b8a07d038da0b36854 (patch)
tree468f6ad18b924e3a58c180403f96d5afcd47a4f9 /BaseTools/Source/C/GenFv
parentb8a13d736961faff0d11241a0428abc44a084d6e (diff)
downloadedk2-platforms-1be2ed90a20618d71ddf34b8a07d038da0b36854.tar.xz
There is a limitation on WINDOWS OS for the length of entire file path can’t be larger than 255. There is an OS API provided by Microsoft to add “\\?\” before the path header to support the long file path. Enable this feature on basetools.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen <hesheng.chen@intel.com> Reviewed-by: Yingke Liu <yingke.d.liu@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15809 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'BaseTools/Source/C/GenFv')
-rw-r--r--BaseTools/Source/C/GenFv/GenFv.c8
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.c40
-rw-r--r--BaseTools/Source/C/GenFv/GenFvInternalLib.h14
3 files changed, 31 insertions, 31 deletions
diff --git a/BaseTools/Source/C/GenFv/GenFv.c b/BaseTools/Source/C/GenFv/GenFv.c
index 8f837d2695..56c52b850f 100644
--- a/BaseTools/Source/C/GenFv/GenFv.c
+++ b/BaseTools/Source/C/GenFv/GenFv.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -97,7 +97,7 @@ Returns:
//
// Copyright declaration
//
- fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");
+ fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");
//
// Details Option
@@ -603,7 +603,7 @@ Returns:
if (OutFileName == NULL) {
FpFile = stdout;
} else {
- FpFile = fopen (OutFileName, "w");
+ FpFile = fopen (LongFilePath (OutFileName), "w");
if (FpFile == NULL) {
Error (NULL, 0, 0001, "Error opening file", OutFileName);
return STATUS_ERROR;
@@ -672,7 +672,7 @@ Returns:
// update boot driver address and runtime driver address in address file
//
if (Status == EFI_SUCCESS && AddrFileName != NULL && mFvBaseAddressNumber > 0) {
- FpFile = fopen (AddrFileName, "w");
+ FpFile = fopen (LongFilePath (AddrFileName), "w");
if (FpFile == NULL) {
Error (NULL, 0, 0001, "Error opening file", AddrFileName);
return STATUS_ERROR;
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.c b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
index 0522cf4254..6ac542d6c0 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.c
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.c
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
@@ -187,7 +187,7 @@ Returns:
EFI_NOT_FOUND A required string was not found in the INF file.
--*/
{
- CHAR8 Value[_MAX_PATH];
+ CHAR8 Value[MAX_LONG_FILE_PATH];
UINT64 Value64;
UINTN Index;
UINTN Number;
@@ -730,7 +730,7 @@ Returns:
--*/
{
- CHAR8 PeMapFileName [_MAX_PATH];
+ CHAR8 PeMapFileName [MAX_LONG_FILE_PATH];
CHAR8 *Cptr, *Cptr2;
CHAR8 FileGuidName [MAX_LINE_LEN];
FILE *PeMapFile;
@@ -866,7 +866,7 @@ Returns:
//
// Open PeMapFile
//
- PeMapFile = fopen (PeMapFileName, "r");
+ PeMapFile = fopen (LongFilePath (PeMapFileName), "r");
if (PeMapFile == NULL) {
// fprintf (stdout, "can't open %s file to reading\n", PeMapFileName);
return EFI_ABORTED;
@@ -992,7 +992,7 @@ Returns:
//
// Read the file to add
//
- NewFile = fopen (FvInfo->FvFiles[Index], "rb");
+ NewFile = fopen (LongFilePath (FvInfo->FvFiles[Index]), "rb");
if (NewFile == NULL) {
Error (NULL, 0, 0001, "Error opening file", FvInfo->FvFiles[Index]);
@@ -2077,12 +2077,12 @@ Returns:
UINT8 *FvImage;
UINTN FvImageSize;
FILE *FvFile;
- CHAR8 FvMapName [_MAX_PATH];
+ CHAR8 FvMapName [MAX_LONG_FILE_PATH];
FILE *FvMapFile;
EFI_FIRMWARE_VOLUME_EXT_HEADER *FvExtHeader;
FILE *FvExtHeaderFile;
UINTN FileSize;
- CHAR8 FvReportName[_MAX_PATH];
+ CHAR8 FvReportName[MAX_LONG_FILE_PATH];
FILE *FvReportFile;
FvBufferHeader = NULL;
@@ -2152,7 +2152,7 @@ Returns:
//
// Open the FV Extension Header file
//
- FvExtHeaderFile = fopen (mFvDataInfo.FvExtHeaderFile, "rb");
+ FvExtHeaderFile = fopen (LongFilePath (mFvDataInfo.FvExtHeaderFile), "rb");
//
// Get the file size
@@ -2343,7 +2343,7 @@ Returns:
//
// Open FvMap file
//
- FvMapFile = fopen (FvMapName, "w");
+ FvMapFile = fopen (LongFilePath (FvMapName), "w");
if (FvMapFile == NULL) {
Error (NULL, 0, 0001, "Error opening file", FvMapName);
return EFI_ABORTED;
@@ -2352,7 +2352,7 @@ Returns:
//
// Open FvReport file
//
- FvReportFile = fopen(FvReportName, "w");
+ FvReportFile = fopen (LongFilePath (FvReportName), "w");
if (FvReportFile == NULL) {
Error (NULL, 0, 0001, "Error opening file", FvReportName);
return EFI_ABORTED;
@@ -2484,7 +2484,7 @@ WriteFile:
//
// Write fv file
//
- FvFile = fopen (FvFileName, "wb");
+ FvFile = fopen (LongFilePath (FvFileName), "wb");
if (FvFile == NULL) {
Error (NULL, 0, 0001, "Error opening file", FvFileName);
Status = EFI_ABORTED;
@@ -2651,7 +2651,7 @@ Returns:
// Calculate PI extension header
//
if (mFvDataInfo.FvExtHeaderFile[0] != '\0') {
- fpin = fopen (mFvDataInfo.FvExtHeaderFile, "rb");
+ fpin = fopen (LongFilePath (mFvDataInfo.FvExtHeaderFile), "rb");
if (fpin == NULL) {
Error (NULL, 0, 0001, "Error opening file", mFvDataInfo.FvExtHeaderFile);
return EFI_ABORTED;
@@ -2678,7 +2678,7 @@ Returns:
// Open FFS file
//
fpin = NULL;
- fpin = fopen (FvInfoPtr->FvFiles[Index], "rb");
+ fpin = fopen (LongFilePath (FvInfoPtr->FvFiles[Index]), "rb");
if (fpin == NULL) {
Error (NULL, 0, 0001, "Error opening file", FvInfoPtr->FvFiles[Index]);
return EFI_ABORTED;
@@ -2915,7 +2915,7 @@ Returns:
EFI_TE_IMAGE_HEADER *TEImageHeader;
UINT8 *MemoryImagePointer;
EFI_IMAGE_SECTION_HEADER *SectionHeader;
- CHAR8 PeFileName [_MAX_PATH];
+ CHAR8 PeFileName [MAX_LONG_FILE_PATH];
CHAR8 *Cptr;
FILE *PeFile;
UINT8 *PeFileBuffer;
@@ -3066,7 +3066,7 @@ Returns:
*(Cptr + 3) = 'i';
*(Cptr + 4) = '\0';
}
- PeFile = fopen (PeFileName, "rb");
+ PeFile = fopen (LongFilePath (PeFileName), "rb");
if (PeFile == NULL) {
Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);
//Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);
@@ -3322,7 +3322,7 @@ Returns:
*(Cptr + 4) = '\0';
}
- PeFile = fopen (PeFileName, "rb");
+ PeFile = fopen (LongFilePath (PeFileName), "rb");
if (PeFile == NULL) {
Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);
//Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);
@@ -3567,7 +3567,7 @@ Returns:
EFI_NOT_FOUND A required string was not found in the INF file.
--*/
{
- CHAR8 Value[_MAX_PATH];
+ CHAR8 Value[MAX_LONG_FILE_PATH];
UINT64 Value64;
UINTN Index, Number;
EFI_STATUS Status;
@@ -3773,7 +3773,7 @@ Returns:
FileSize = 0;
CapSize = mCapDataInfo.HeaderSize;
while (mCapDataInfo.CapFiles [Index][0] != '\0') {
- fpin = fopen (mCapDataInfo.CapFiles[Index], "rb");
+ fpin = fopen (LongFilePath (mCapDataInfo.CapFiles[Index]), "rb");
if (fpin == NULL) {
Error (NULL, 0, 0001, "Error opening file", mCapDataInfo.CapFiles[Index]);
return EFI_ABORTED;
@@ -3811,7 +3811,7 @@ Returns:
FileSize = 0;
CapSize = CapsuleHeader->HeaderSize;
while (mCapDataInfo.CapFiles [Index][0] != '\0') {
- fpin = fopen (mCapDataInfo.CapFiles[Index], "rb");
+ fpin = fopen (LongFilePath (mCapDataInfo.CapFiles[Index]), "rb");
if (fpin == NULL) {
Error (NULL, 0, 0001, "Error opening file", mCapDataInfo.CapFiles[Index]);
free (CapBuffer);
@@ -3827,7 +3827,7 @@ Returns:
//
// write capsule data into the output file
//
- fpout = fopen (CapFileName, "wb");
+ fpout = fopen (LongFilePath (CapFileName), "wb");
if (fpout == NULL) {
Error (NULL, 0, 0001, "Error opening file", CapFileName);
free (CapBuffer);
diff --git a/BaseTools/Source/C/GenFv/GenFvInternalLib.h b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
index a9a00ec028..f8eecbade1 100644
--- a/BaseTools/Source/C/GenFv/GenFvInternalLib.h
+++ b/BaseTools/Source/C/GenFv/GenFvInternalLib.h
@@ -1,6 +1,6 @@
/** @file
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>
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
@@ -214,7 +214,7 @@ Abstract:
//
typedef struct {
UINTN Size;
- CHAR8 ComponentName[_MAX_PATH];
+ CHAR8 ComponentName[MAX_LONG_FILE_PATH];
} COMPONENT_INFO;
//
@@ -227,12 +227,12 @@ typedef struct {
BOOLEAN FvFileSystemGuidSet;
EFI_GUID FvNameGuid;
BOOLEAN FvNameGuidSet;
- CHAR8 FvExtHeaderFile[_MAX_PATH];
+ CHAR8 FvExtHeaderFile[MAX_LONG_FILE_PATH];
UINTN Size;
EFI_FVB_ATTRIBUTES_2 FvAttributes;
- CHAR8 FvName[_MAX_PATH];
+ CHAR8 FvName[MAX_LONG_FILE_PATH];
EFI_FV_BLOCK_MAP_ENTRY FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];
- CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];
+ CHAR8 FvFiles[MAX_NUMBER_OF_FILES_IN_FV][MAX_LONG_FILE_PATH];
UINT32 SizeofFvFiles[MAX_NUMBER_OF_FILES_IN_FV];
BOOLEAN IsPiFvImage;
INT8 ForceRebase;
@@ -242,8 +242,8 @@ typedef struct {
EFI_GUID CapGuid;
UINT32 HeaderSize;
UINT32 Flags;
- CHAR8 CapName[_MAX_PATH];
- CHAR8 CapFiles[MAX_NUMBER_OF_FILES_IN_CAP][_MAX_PATH];
+ CHAR8 CapName[MAX_LONG_FILE_PATH];
+ CHAR8 CapFiles[MAX_NUMBER_OF_FILES_IN_CAP][MAX_LONG_FILE_PATH];
} CAP_INFO;
#pragma pack(1)