]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GenVtf/GenVtf.c
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
[mirror_edk2.git] / BaseTools / Source / C / GenVtf / GenVtf.c
index eaf2f56fedfeaaadc463fb98cda4785f6b2beaa5..60df34906eb804cab97ff26cddf6289787a92371 100644 (file)
@@ -1,6 +1,6 @@
 /**\r
 \r
-Copyright (c) 1999 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 1999 - 2014, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials are licensed and made available \r
 under the terms and conditions of the BSD License which accompanies this \r
 distribution.  The full text of the license may be found at\r
@@ -1070,7 +1070,7 @@ Returns:
   CHAR8   Buff5[10];\r
   CHAR8   Token[50];\r
 \r
-  Fp = fopen (VtfInfo->CompSymName, "rb");\r
+  Fp = fopen (LongFilePath (VtfInfo->CompSymName), "rb");\r
 \r
   if (Fp == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompSymName);\r
@@ -1152,7 +1152,7 @@ Returns:
     return EFI_SUCCESS;\r
   }\r
 \r
-  Fp = fopen (VtfInfo->CompBinName, "rb");\r
+  Fp = fopen (LongFilePath (VtfInfo->CompBinName), "rb");\r
 \r
   if (Fp == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompBinName);\r
@@ -1332,7 +1332,7 @@ Returns:
   FILE        *Fp;\r
   FIT_TABLE   *PalFitPtr;\r
 \r
-  Fp = fopen (VtfInfo->CompBinName, "rb");\r
+  Fp = fopen (LongFilePath (VtfInfo->CompBinName), "rb");\r
 \r
   if (Fp == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", VtfInfo->CompBinName);\r
@@ -1551,7 +1551,7 @@ Returns:
     VtfBuffer = (VOID *) RelativeAddress;\r
   }\r
 \r
-  Fp = fopen (FileName, "wb");\r
+  Fp = fopen (LongFilePath (FileName), "wb");\r
   if (Fp == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", FileName);\r
     return EFI_ABORTED;\r
@@ -1763,7 +1763,7 @@ Returns:
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
-  Fp = fopen (FileName, "rb");\r
+  Fp = fopen (LongFilePath (FileName), "rb");\r
 \r
   if (Fp == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", FileName);\r
@@ -2125,7 +2125,7 @@ Returns:
   }\r
   *StartAddressPtr = StartAddress;\r
 \r
-  Fp = fopen (OutFileName1, "rb");\r
+  Fp = fopen (LongFilePath (OutFileName1), "rb");\r
 \r
   if (Fp == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", OutFileName1);\r
@@ -2183,12 +2183,12 @@ Returns:
 {\r
   FILE    *SourceFile;\r
   FILE    *DestFile;\r
-  CHAR8   Buffer[_MAX_PATH];\r
-  CHAR8   Type[_MAX_PATH];\r
-  CHAR8   Address[_MAX_PATH];\r
-  CHAR8   Section[_MAX_PATH];\r
-  CHAR8   Token[_MAX_PATH];\r
-  CHAR8   BaseToken[_MAX_PATH];\r
+  CHAR8   Buffer[MAX_LONG_FILE_PATH];\r
+  CHAR8   Type[MAX_LONG_FILE_PATH];\r
+  CHAR8   Address[MAX_LONG_FILE_PATH];\r
+  CHAR8   Section[MAX_LONG_FILE_PATH];\r
+  CHAR8   Token[MAX_LONG_FILE_PATH];\r
+  CHAR8   BaseToken[MAX_LONG_FILE_PATH];\r
   UINT64  TokenAddress;\r
   long    StartLocation;\r
 \r
@@ -2202,7 +2202,7 @@ Returns:
   //\r
   // Open the source file\r
   //\r
-  SourceFile = fopen (SourceFileName, "r");\r
+  SourceFile = fopen (LongFilePath (SourceFileName), "r");\r
   if (SourceFile == NULL) {\r
 \r
     //\r
@@ -2221,7 +2221,7 @@ Returns:
   //\r
   // Open the destination file\r
   //\r
-  DestFile = fopen (DestFileName, "a+");\r
+  DestFile = fopen (LongFilePath (DestFileName), "a+");\r
   if (DestFile == NULL) {\r
     fclose (SourceFile);\r
     Error (NULL, 0, 0001, "Error opening file", DestFileName);\r
@@ -2252,7 +2252,7 @@ Returns:
   //\r
   // Read the first line\r
   //\r
-  if (fgets (Buffer, _MAX_PATH, SourceFile) == NULL) {\r
+  if (fgets (Buffer, MAX_LONG_FILE_PATH, SourceFile) == NULL) {\r
     Buffer[0] = 0;\r
   }\r
 \r
@@ -2410,7 +2410,7 @@ Returns:
   //\r
   // Copyright declaration\r
   //\r
-  fprintf (stdout, "Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
   //\r
   // Details Option\r
   //\r
@@ -2546,7 +2546,7 @@ Returns:
       // Get the input VTF file name\r
       //\r
       VtfFileName = argv[Index+1];\r
-      VtfFP = fopen(VtfFileName, "rb");\r
+      VtfFP = fopen (LongFilePath (VtfFileName), "rb");\r
       if (VtfFP == NULL) {\r
         Error (NULL, 0, 0001, "Error opening file", VtfFileName);\r
         goto ERROR;\r