From 1be2ed90a20618d71ddf34b8a07d038da0b36854 Mon Sep 17 00:00:00 2001 From: Hess Chen Date: Fri, 15 Aug 2014 03:06:48 +0000 Subject: =?UTF-8?q?There=20is=20a=20limitation=20on=20WINDOWS=20OS=20for?= =?UTF-8?q?=20the=20length=20of=20entire=20file=20path=20can=E2=80=99t=20b?= =?UTF-8?q?e=20larger=20than=20255.=20There=20is=20an=20OS=20API=20provide?= =?UTF-8?q?d=20by=20Microsoft=20to=20add=20=E2=80=9C\\=3F\=E2=80=9D=20befo?= =?UTF-8?q?re=20the=20path=20header=20to=20support=20the=20long=20file=20p?= =?UTF-8?q?ath.=20Enable=20this=20feature=20on=20basetools.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Hess Chen Reviewed-by: Yingke Liu git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@15809 6f19259b-4bc3-4df7-8a09-765794883524 --- BaseTools/Source/C/GenVtf/GenVtf.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'BaseTools/Source/C/GenVtf/GenVtf.c') diff --git a/BaseTools/Source/C/GenVtf/GenVtf.c b/BaseTools/Source/C/GenVtf/GenVtf.c index eaf2f56fed..60df34906e 100644 --- a/BaseTools/Source/C/GenVtf/GenVtf.c +++ b/BaseTools/Source/C/GenVtf/GenVtf.c @@ -1,6 +1,6 @@ /** -Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.
+Copyright (c) 1999 - 2014, 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 @@ -1070,7 +1070,7 @@ Returns: CHAR8 Buff5[10]; CHAR8 Token[50]; - Fp = fopen (VtfInfo->CompSymName, "rb"); + Fp = fopen (LongFilePath (VtfInfo->CompSymName), "rb"); if (Fp == NULL) { Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompSymName); @@ -1152,7 +1152,7 @@ Returns: return EFI_SUCCESS; } - Fp = fopen (VtfInfo->CompBinName, "rb"); + Fp = fopen (LongFilePath (VtfInfo->CompBinName), "rb"); if (Fp == NULL) { Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompBinName); @@ -1332,7 +1332,7 @@ Returns: FILE *Fp; FIT_TABLE *PalFitPtr; - Fp = fopen (VtfInfo->CompBinName, "rb"); + Fp = fopen (LongFilePath (VtfInfo->CompBinName), "rb"); if (Fp == NULL) { Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompBinName); @@ -1551,7 +1551,7 @@ Returns: VtfBuffer = (VOID *) RelativeAddress; } - Fp = fopen (FileName, "wb"); + Fp = fopen (LongFilePath (FileName), "wb"); if (Fp == NULL) { Error (NULL, 0, 0001, "Error opening file", FileName); return EFI_ABORTED; @@ -1763,7 +1763,7 @@ Returns: return EFI_INVALID_PARAMETER; } - Fp = fopen (FileName, "rb"); + Fp = fopen (LongFilePath (FileName), "rb"); if (Fp == NULL) { Error (NULL, 0, 0001, "Error opening file", FileName); @@ -2125,7 +2125,7 @@ Returns: } *StartAddressPtr = StartAddress; - Fp = fopen (OutFileName1, "rb"); + Fp = fopen (LongFilePath (OutFileName1), "rb"); if (Fp == NULL) { Error (NULL, 0, 0001, "Error opening file", OutFileName1); @@ -2183,12 +2183,12 @@ Returns: { FILE *SourceFile; FILE *DestFile; - CHAR8 Buffer[_MAX_PATH]; - CHAR8 Type[_MAX_PATH]; - CHAR8 Address[_MAX_PATH]; - CHAR8 Section[_MAX_PATH]; - CHAR8 Token[_MAX_PATH]; - CHAR8 BaseToken[_MAX_PATH]; + CHAR8 Buffer[MAX_LONG_FILE_PATH]; + CHAR8 Type[MAX_LONG_FILE_PATH]; + CHAR8 Address[MAX_LONG_FILE_PATH]; + CHAR8 Section[MAX_LONG_FILE_PATH]; + CHAR8 Token[MAX_LONG_FILE_PATH]; + CHAR8 BaseToken[MAX_LONG_FILE_PATH]; UINT64 TokenAddress; long StartLocation; @@ -2202,7 +2202,7 @@ Returns: // // Open the source file // - SourceFile = fopen (SourceFileName, "r"); + SourceFile = fopen (LongFilePath (SourceFileName), "r"); if (SourceFile == NULL) { // @@ -2221,7 +2221,7 @@ Returns: // // Open the destination file // - DestFile = fopen (DestFileName, "a+"); + DestFile = fopen (LongFilePath (DestFileName), "a+"); if (DestFile == NULL) { fclose (SourceFile); Error (NULL, 0, 0001, "Error opening file", DestFileName); @@ -2252,7 +2252,7 @@ Returns: // // Read the first line // - if (fgets (Buffer, _MAX_PATH, SourceFile) == NULL) { + if (fgets (Buffer, MAX_LONG_FILE_PATH, SourceFile) == NULL) { Buffer[0] = 0; } @@ -2410,7 +2410,7 @@ Returns: // // Copyright declaration // - fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n"); + fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n"); // // Details Option // @@ -2546,7 +2546,7 @@ Returns: // Get the input VTF file name // VtfFileName = argv[Index+1]; - VtfFP = fopen(VtfFileName, "rb"); + VtfFP = fopen (LongFilePath (VtfFileName), "rb"); if (VtfFP == NULL) { Error (NULL, 0, 0001, "Error opening file", VtfFileName); goto ERROR; -- cgit v1.2.3