]> git.proxmox.com Git - mirror_edk2.git/commitdiff
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
authorHess Chen <hesheng.chen@intel.com>
Fri, 15 Aug 2014 03:06:48 +0000 (03:06 +0000)
committerhchen30 <hchen30@6f19259b-4bc3-4df7-8a09-765794883524>
Fri, 15 Aug 2014 03:06:48 +0000 (03:06 +0000)
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

109 files changed:
BaseTools/Source/C/BootSectImage/bootsectimage.c
BaseTools/Source/C/Common/CommonLib.c
BaseTools/Source/C/Common/CommonLib.h
BaseTools/Source/C/Common/MemoryFile.h
BaseTools/Source/C/Common/OsPath.c
BaseTools/Source/C/Common/ParseInf.c
BaseTools/Source/C/Common/ParseInf.h
BaseTools/Source/C/Common/SimpleFileParsing.c
BaseTools/Source/C/EfiLdrImage/EfiLdrImage.c
BaseTools/Source/C/EfiRom/EfiRom.c
BaseTools/Source/C/GenBootSector/GenBootSector.c
BaseTools/Source/C/GenCrc32/GenCrc32.c
BaseTools/Source/C/GenFfs/GenFfs.c
BaseTools/Source/C/GenFv/GenFv.c
BaseTools/Source/C/GenFv/GenFvInternalLib.c
BaseTools/Source/C/GenFv/GenFvInternalLib.h
BaseTools/Source/C/GenFw/GenFw.c
BaseTools/Source/C/GenPage/GenPage.c
BaseTools/Source/C/GenSec/GenSec.c
BaseTools/Source/C/GenVtf/GenVtf.c
BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
BaseTools/Source/C/Split/Split.c
BaseTools/Source/C/VfrCompile/VfrCompiler.cpp
BaseTools/Source/C/VfrCompile/VfrUtilityLib.cpp
BaseTools/Source/C/VolInfo/VolInfo.c
BaseTools/Source/Python/AutoGen/AutoGen.py
BaseTools/Source/Python/AutoGen/BuildEngine.py
BaseTools/Source/Python/AutoGen/GenDepex.py
BaseTools/Source/Python/AutoGen/GenMake.py
BaseTools/Source/Python/AutoGen/StrGather.py
BaseTools/Source/Python/AutoGen/UniClassObject.py
BaseTools/Source/Python/BPDG/BPDG.py
BaseTools/Source/Python/BPDG/GenVpd.py
BaseTools/Source/Python/Common/Database.py
BaseTools/Source/Python/Common/DecClassObject.py
BaseTools/Source/Python/Common/Dictionary.py
BaseTools/Source/Python/Common/DscClassObject.py
BaseTools/Source/Python/Common/EdkIIWorkspace.py
BaseTools/Source/Python/Common/EdkIIWorkspaceBuild.py
BaseTools/Source/Python/Common/EdkLogger.py
BaseTools/Source/Python/Common/FdfParserLite.py
BaseTools/Source/Python/Common/InfClassObject.py
BaseTools/Source/Python/Common/LongFilePathOs.py [new file with mode: 0644]
BaseTools/Source/Python/Common/LongFilePathOsPath.py [new file with mode: 0644]
BaseTools/Source/Python/Common/LongFilePathSupport.py [new file with mode: 0644]
BaseTools/Source/Python/Common/MigrationUtilities.py
BaseTools/Source/Python/Common/Misc.py
BaseTools/Source/Python/Common/String.py
BaseTools/Source/Python/Common/TargetTxtClassObject.py
BaseTools/Source/Python/Common/ToolDefClassObject.py
BaseTools/Source/Python/Common/VpdInfoFile.py
BaseTools/Source/Python/Ecc/Check.py
BaseTools/Source/Python/Ecc/CodeFragmentCollector.py
BaseTools/Source/Python/Ecc/Configuration.py
BaseTools/Source/Python/Ecc/Database.py
BaseTools/Source/Python/Ecc/Ecc.py
BaseTools/Source/Python/Ecc/EccGlobalData.py
BaseTools/Source/Python/Ecc/Exception.py
BaseTools/Source/Python/Ecc/FileProfile.py
BaseTools/Source/Python/Ecc/MetaDataParser.py
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaDataTable.py
BaseTools/Source/Python/Ecc/MetaFileWorkspace/MetaFileParser.py
BaseTools/Source/Python/Ecc/Xml/XmlRoutines.py
BaseTools/Source/Python/Ecc/c.py
BaseTools/Source/Python/Eot/CodeFragmentCollector.py
BaseTools/Source/Python/Eot/Database.py
BaseTools/Source/Python/Eot/Eot.py
BaseTools/Source/Python/Eot/EotGlobalData.py
BaseTools/Source/Python/Eot/FileProfile.py
BaseTools/Source/Python/Eot/FvImage.py
BaseTools/Source/Python/Eot/InfParserLite.py
BaseTools/Source/Python/Eot/Parser.py
BaseTools/Source/Python/Eot/Report.py
BaseTools/Source/Python/Eot/c.py
BaseTools/Source/Python/GenFds/AprioriSection.py
BaseTools/Source/Python/GenFds/Capsule.py
BaseTools/Source/Python/GenFds/CompressSection.py
BaseTools/Source/Python/GenFds/DataSection.py
BaseTools/Source/Python/GenFds/DepexSection.py
BaseTools/Source/Python/GenFds/EfiSection.py
BaseTools/Source/Python/GenFds/Fd.py
BaseTools/Source/Python/GenFds/FdfParser.py
BaseTools/Source/Python/GenFds/FfsFileStatement.py
BaseTools/Source/Python/GenFds/FfsInfStatement.py
BaseTools/Source/Python/GenFds/Fv.py
BaseTools/Source/Python/GenFds/FvImageSection.py
BaseTools/Source/Python/GenFds/GenFds.py
BaseTools/Source/Python/GenFds/GenFdsGlobalVariable.py
BaseTools/Source/Python/GenFds/GuidSection.py
BaseTools/Source/Python/GenFds/OptRomFileStatement.py
BaseTools/Source/Python/GenFds/OptionRom.py
BaseTools/Source/Python/GenFds/Region.py
BaseTools/Source/Python/GenFds/Section.py
BaseTools/Source/Python/GenFds/UiSection.py
BaseTools/Source/Python/GenFds/VerSection.py
BaseTools/Source/Python/GenFds/Vtf.py
BaseTools/Source/Python/GenPatchPcdTable/GenPatchPcdTable.py
BaseTools/Source/Python/PatchPcdValue/PatchPcdValue.py
BaseTools/Source/Python/Table/TableEotReport.py
BaseTools/Source/Python/Table/TableFile.py
BaseTools/Source/Python/Table/TableReport.py
BaseTools/Source/Python/TargetTool/TargetTool.py
BaseTools/Source/Python/Trim/Trim.py
BaseTools/Source/Python/Workspace/BuildClassObject.py
BaseTools/Source/Python/Workspace/MetaDataTable.py
BaseTools/Source/Python/Workspace/MetaFileParser.py
BaseTools/Source/Python/Workspace/WorkspaceDatabase.py
BaseTools/Source/Python/build/BuildReport.py
BaseTools/Source/Python/build/build.py

index 36e896e5c4bee0866715711e17587e6f481ff12c..fd367c28b36d100995d762cb3515b51c60ed7144 100644 (file)
@@ -4,7 +4,7 @@ Abstract:
   Patch the BPB information in boot sector image file.\r
   Patch the MBR code in MBR image file.\r
 \r
-Copyright (c) 2006 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -116,7 +116,7 @@ Return:
   FILE *FileHandle;\r
   int  result;\r
 \r
-  FileHandle = fopen (FileName, "r+b");\r
+  FileHandle = fopen (LongFilePath (FileName), "r+b");\r
   if (FileHandle == NULL) {\r
     DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "Open file: %s", FileName);\r
     return 0;\r
@@ -154,7 +154,7 @@ Return:
   FILE *FileHandle;\r
   int  result;\r
 \r
-  FileHandle = fopen (FileName, "rb");\r
+  FileHandle = fopen (LongFilePath (FileName), "rb");\r
   if (FileHandle == NULL) {\r
     DebugMsg (NULL, 0, DEBUG_ERROR, NULL, "ERROR: E0001: Error opening file: %s", FileName);\r
     return 0;\r
index cb72e2723f3a65dc745930bda6f0776a1e0dabfc..981c04f34ba8f1c7ab3e868ba3aa05cc72d350cc 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -23,6 +23,11 @@ Abstract:
 #include <string.h>\r
 #include <stdlib.h>\r
 #include <ctype.h>\r
+#ifdef __GNUC__\r
+#include <unistd.h>\r
+#else\r
+#include <direct.h>\r
+#endif\r
 #include "CommonLib.h"\r
 #include "EfiUtilityMsgs.h"\r
 \r
@@ -196,7 +201,7 @@ Returns:
   //\r
   // Open the file\r
   //\r
-  InputFile = fopen (InputFileName, "rb");\r
+  InputFile = fopen (LongFilePath (InputFileName), "rb");\r
   if (InputFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening the input file", InputFileName);\r
     return EFI_ABORTED;\r
@@ -297,7 +302,7 @@ Returns:
   //\r
   // Open the file\r
   //\r
-  OutputFile = fopen (OutputFileName, "wb");\r
+  OutputFile = fopen (LongFilePath (OutputFileName), "wb");\r
   if (OutputFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening the output file", OutputFileName);\r
     return EFI_ABORTED;\r
@@ -582,3 +587,124 @@ char *strlwr(char *s)
 }\r
 #endif\r
 #endif\r
+\r
+#define WINDOWS_EXTENSION_PATH "\\\\?\\"\r
+#define WINDOWS_UNC_EXTENSION_PATH "\\\\?\\UNC"\r
+\r
+//\r
+// Global data to store full file path. It is not required to be free. \r
+//\r
+CHAR8 mCommonLibFullPath[MAX_LONG_FILE_PATH];\r
+\r
+CHAR8 *\r
+LongFilePath (\r
+ IN CHAR8 *FileName\r
+ )\r
+/*++\r
+\r
+Routine Description:\r
+  Convert FileName to the long file path, which can support larger than 260 length. \r
+\r
+Arguments:\r
+  FileName         - FileName. \r
+\r
+Returns:\r
+  LongFilePath      A pointer to the converted long file path.\r
+  \r
+--*/\r
+{\r
+#ifdef __GNUC__\r
+  //\r
+  // __GNUC__ may not be good way to differentiate unix and windows. Need more investigation here. \r
+  // unix has no limitation on file path. Just return FileName. \r
+  //\r
+  return FileName;\r
+#else\r
+  CHAR8 *RootPath;\r
+  CHAR8 *PathPointer;\r
+  CHAR8 *NextPointer;\r
+  \r
+  PathPointer = (CHAR8 *) FileName;\r
+  \r
+  if (FileName != NULL) {\r
+    //\r
+    // Add the extension string first to support long file path. \r
+    //\r
+    mCommonLibFullPath[0] = 0;\r
+    strcpy (mCommonLibFullPath, WINDOWS_EXTENSION_PATH);\r
+\r
+    if (strlen (FileName) > 1 && FileName[0] == '\\' && FileName[1] == '\\') {\r
+      //\r
+      // network path like \\server\share to \\?\UNC\server\share\r
+      //\r
+      strcpy (mCommonLibFullPath, WINDOWS_UNC_EXTENSION_PATH);\r
+      FileName ++;\r
+    } else if (strlen (FileName) < 3 || FileName[1] != ':' || (FileName[2] != '\\' && FileName[2] != '/')) {\r
+      //\r
+      // Relative file path. Convert it to absolute path. \r
+      //\r
+      RootPath = getcwd (NULL, 0);\r
+      if (RootPath != NULL) {\r
+        strcat (mCommonLibFullPath, RootPath);\r
+        if (FileName[0] != '\\' && FileName[0] != '/') {\r
+          //\r
+          // Attach directory separator\r
+          //\r
+          strcat (mCommonLibFullPath, "\\");\r
+        }\r
+        free (RootPath);\r
+      }\r
+    }\r
+\r
+    //\r
+    // Construct the full file path\r
+    //\r
+    strcat (mCommonLibFullPath, FileName);\r
+    \r
+    //\r
+    // Convert directory separator '/' to '\\'\r
+    //\r
+    PathPointer = (CHAR8 *) mCommonLibFullPath;\r
+    do {\r
+      if (*PathPointer == '/') {\r
+        *PathPointer = '\\';\r
+      }\r
+    } while (*PathPointer ++ != '\0');\r
+    \r
+    //\r
+    // Convert "\\.\\" to "\\", because it doesn't work with WINDOWS_EXTENSION_PATH.\r
+    //\r
+    while ((PathPointer = strstr (mCommonLibFullPath, "\\.\\")) != NULL) {\r
+      *PathPointer = '\0';\r
+      strcat (mCommonLibFullPath, PathPointer + 2);\r
+    }\r
+    \r
+    //\r
+    // Convert "\\..\\" to last directory, because it doesn't work with WINDOWS_EXTENSION_PATH.\r
+    //\r
+    while ((PathPointer = strstr (mCommonLibFullPath, "\\..\\")) != NULL) {\r
+      NextPointer = PathPointer + 3;\r
+      do {\r
+        PathPointer --;\r
+      } while (PathPointer > mCommonLibFullPath && *PathPointer != ':' && *PathPointer != '\\');\r
+\r
+      if (*PathPointer == '\\') {\r
+        //\r
+        // Skip one directory\r
+        //\r
+        *PathPointer = '\0';\r
+        strcat (mCommonLibFullPath, NextPointer);\r
+      } else {\r
+        //\r
+        // No directory is found. Just break.\r
+        //\r
+        break;\r
+      }\r
+    }\r
+    \r
+    PathPointer = mCommonLibFullPath;\r
+  }\r
+  \r
+  return PathPointer;\r
+#endif\r
+}\r
index 0610b21ed08278a401fa34411f810f6796c3417a..2c1db759b0db0e51f0e6ea7857a69d73c4e6626c 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -25,6 +25,12 @@ Abstract:
 #include <Common/UefiBaseTypes.h>\r
 #include <Common/BuildVersion.h>\r
 #define PRINTED_GUID_BUFFER_SIZE  37  // including null-termination\r
+\r
+#define MAX_LONG_FILE_PATH 500\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
 //\r
 // Function declarations\r
 //\r
@@ -145,6 +151,27 @@ PrintGuidToBuffer (
   )\r
 ;\r
 \r
+CHAR8 *\r
+LongFilePath (\r
+ IN CHAR8 *FileName\r
+);\r
+/*++\r
+\r
+Routine Description:\r
+  Convert FileName to the long file path, which can support larger than 260 length. \r
+\r
+Arguments:\r
+  FileName         - FileName. \r
+\r
+Returns:\r
+  LongFilePath      A pointer to the converted long file path.\r
+  \r
+--*/\r
+\r
+#ifdef __cplusplus\r
+}\r
+#endif\r
+\r
 #define ASSERT(x) assert(x)\r
 \r
 #ifdef __GNUC__\r
index baab40baa2c6442aea2ad62615127f8030a58f8b..0568fed5f2e4e95cc52934ad997fc41ef6db09e1 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -26,10 +26,6 @@ Abstract:
 #include <stdlib.h>\r
 #include <Common/UefiBaseTypes.h>\r
 \r
-#ifndef _MAX_PATH\r
-#define _MAX_PATH 500\r
-#endif\r
-\r
 //\r
 // Common data structures\r
 //\r
index 419c8f8b8c4611016aab61db268baa5d1d2567e6..07b47f09b4037be0fdadf7ca418cbde9d4b63cbe 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -22,6 +22,7 @@ Abstract:
 #include <stdio.h>\r
 #include <stdlib.h>\r
 #include <string.h>\r
+#include "CommonLib.h"\r
 #include "OsPath.h"\r
 \r
 //\r
@@ -294,7 +295,7 @@ Returns:
 --*/\r
 {\r
   FILE    *InputFile;\r
-  InputFile = fopen (InputFileName, "rb");\r
+  InputFile = fopen (LongFilePath (InputFileName), "rb");\r
   if (InputFile == NULL) {\r
     return FALSE;\r
   } else {\r
index 385758f8366f5412b8f9a93510e84a9e13f49dde..00ae0e65a10b8aee9fa193689e79dc3c4c746558 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2010, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -25,6 +25,7 @@ Abstract:
 #include <stdlib.h>\r
 #include "EfiUtilityMsgs.h"\r
 #include "ParseInf.h"\r
+#include "CommonLib.h"\r
 \r
 CHAR8 *\r
 ReadLine (\r
@@ -46,7 +47,7 @@ Routine Description:
 Arguments:\r
 \r
   InputFile     Memory file image.\r
-  InputBuffer   Buffer to read into, must be _MAX_PATH size.\r
+  InputBuffer   Buffer to read into, must be MaxLength size.\r
   MaxLength     The maximum size of the input buffer.\r
 \r
 Returns:\r
@@ -165,7 +166,7 @@ Returns:
 \r
 --*/\r
 {\r
-  CHAR8 InputBuffer[_MAX_PATH];\r
+  CHAR8 InputBuffer[MAX_LONG_FILE_PATH];\r
   CHAR8 *CurrentToken;\r
 \r
   //\r
@@ -188,7 +189,7 @@ Returns:
     //\r
     // Read a line\r
     //\r
-    ReadLine (InputFile, InputBuffer, _MAX_PATH);\r
+    ReadLine (InputFile, InputBuffer, MAX_LONG_FILE_PATH);\r
 \r
     //\r
     // Check if the section is found\r
@@ -222,7 +223,7 @@ Arguments:
   Section   The section to search for, a string within [].\r
   Token     The token to search for, e.g. EFI_PEIM_RECOVERY, followed by an = in the INF file.\r
   Instance  The instance of the token to search for.  Zero is the first instance.\r
-  Value     The string that holds the value following the =.  Must be _MAX_PATH in size.\r
+  Value     The string that holds the value following the =.  Must be MAX_LONG_FILE_PATH in size.\r
 \r
 Returns:\r
 \r
@@ -234,7 +235,7 @@ Returns:
 \r
 --*/\r
 {\r
-  CHAR8   InputBuffer[_MAX_PATH];\r
+  CHAR8   InputBuffer[MAX_LONG_FILE_PATH];\r
   CHAR8   *CurrentToken;\r
   CHAR8   *Delimiter;\r
   BOOLEAN ParseError;\r
@@ -274,7 +275,7 @@ Returns:
       //\r
       // Read a line from the file\r
       //\r
-      if (ReadLine (InputFile, InputBuffer, _MAX_PATH) == NULL) {\r
+      if (ReadLine (InputFile, InputBuffer, MAX_LONG_FILE_PATH) == NULL) {\r
         //\r
         // Error reading from input file\r
         //\r
@@ -604,7 +605,7 @@ Routine Description:
 Arguments:\r
 \r
   InputFile     Stream pointer.\r
-  InputBuffer   Buffer to read into, must be _MAX_PATH size.\r
+  InputBuffer   Buffer to read into, must be MAX_LONG_FILE_PATH size.\r
 \r
 Returns:\r
 \r
@@ -624,7 +625,7 @@ Returns:
   //\r
   // Read a line\r
   //\r
-  if (fgets (InputBuffer, _MAX_PATH, InputFile) == NULL) {\r
+  if (fgets (InputBuffer, MAX_LONG_FILE_PATH, InputFile) == NULL) {\r
     return NULL;\r
   }\r
   //\r
@@ -670,7 +671,7 @@ Returns:
 \r
 --*/\r
 {\r
-  CHAR8 InputBuffer[_MAX_PATH];\r
+  CHAR8 InputBuffer[MAX_LONG_FILE_PATH];\r
   CHAR8 *CurrentToken;\r
 \r
   //\r
index dfd180db744f1c1b1eea0c515faf985998ccd855..6215ea2e786817b0b27624e196cdebb555b589c0 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -27,10 +27,6 @@ Abstract:
 #include <Common/UefiBaseTypes.h>\r
 #include <MemoryFile.h>\r
 \r
-#ifndef _MAX_PATH\r
-#define _MAX_PATH 500\r
-#endif\r
-\r
 #ifdef __cplusplus\r
 extern "C" {\r
 #endif\r
@@ -59,7 +55,7 @@ Routine Description:
 Arguments:\r
 \r
   InputFile     Memory file image.\r
-  InputBuffer   Buffer to read into, must be _MAX_PATH size.\r
+  InputBuffer   Buffer to read into, must be MaxLength size.\r
   MaxLength     The maximum size of the input buffer.\r
 \r
 Returns:\r
@@ -115,7 +111,7 @@ Arguments:
   Section   The section to search for, a string within [].\r
   Token     The token to search for, e.g. EFI_PEIM_RECOVERY, followed by an = in the INF file.\r
   Instance  The instance of the token to search for.  Zero is the first instance.\r
-  Value     The string that holds the value following the =.  Must be _MAX_PATH in size.\r
+  Value     The string that holds the value following the =.  Must be MAX_LONG_FILE_PATH in size.\r
 \r
 Returns:\r
 \r
@@ -196,7 +192,7 @@ Routine Description:
 Arguments:\r
 \r
   InputFile     Stream pointer.\r
-  InputBuffer   Buffer to read into, must be _MAX_PATH size.\r
+  InputBuffer   Buffer to read into, must be MAX_LONG_FILE_PATH size.\r
 \r
 Returns:\r
 \r
index 0f6151819c2c792c9e2350bab78970770b3e7378..3978e6ed3c8e1b930e5d235f63c922e1ca3a74c0 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2008, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -24,6 +24,7 @@ Abstract:
 #include <stdlib.h>\r
 #include <ctype.h>\r
 \r
+#include "CommonLib.h"\r
 #include "EfiUtilityMsgs.h"\r
 #include "SimpleFileParsing.h"\r
 \r
@@ -650,7 +651,7 @@ Returns:
   // Try to open the file locally, and if that fails try along our include paths.\r
   //\r
   strcpy (FoundFileName, SourceFile->FileName);\r
-  if ((SourceFile->Fptr = fopen (FoundFileName, "rb")) == NULL) {\r
+  if ((SourceFile->Fptr = fopen (LongFilePath (FoundFileName), "rb")) == NULL) {\r
     return STATUS_ERROR;\r
   }\r
   //\r
index f83c532b25641461987c88f02924c0369085f3a0..a76102cbb3511a529e227e9fbb1822a6b05bd5ff 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -84,7 +84,7 @@ Returns:
 --*/\r
 {\r
   printf ("%s v%d.%d %s -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");\r
+  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights reserved.\n");\r
 }\r
 \r
 VOID\r
@@ -270,7 +270,7 @@ Returns:
     return STATUS_ERROR;\r
   }\r
 \r
-  fpOut = fopen(OutputFileName, "w+b");\r
+  fpOut = fopen (LongFilePath (OutputFileName), "w+b");\r
   if (!fpOut) {\r
     Error (NULL, 0, 0001, "Could not open output file", OutputFileName);\r
     return STATUS_ERROR;\r
@@ -294,7 +294,7 @@ Returns:
     //\r
     // Copy the content of PeImage file to output file\r
     //\r
-    fpIn = fopen (InputFileNames[i], "rb");\r
+    fpIn = fopen (LongFilePath (InputFileNames[i]), "rb");\r
     if (!fpIn) {\r
       Error (NULL, 0, 0001, "Could not open input file", InputFileNames[i]);\r
       fclose (fpOut);\r
index 9f7da8017ca98efc5b6feee891720ebd63d79089..838ee25cba74c9212342cb7a5f65105a090eb1c9 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 1999 - 2013, 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
@@ -135,7 +135,7 @@ Returns:
   //\r
   // Now open our output file\r
   //\r
-  if ((FptrOut = fopen (mOptions.OutFileName, "wb")) == NULL) {\r
+  if ((FptrOut = fopen (LongFilePath (mOptions.OutFileName), "wb")) == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", "Error opening file %s", mOptions.OutFileName);\r
     goto BailOut;\r
   }\r
@@ -246,7 +246,7 @@ Returns:
   //\r
   // Try to open the input file\r
   //\r
-  if ((InFptr = fopen (InFile->FileName, "rb")) == NULL) {\r
+  if ((InFptr = fopen (LongFilePath (InFile->FileName), "rb")) == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", InFile->FileName);\r
     return STATUS_ERROR;\r
   }\r
@@ -460,7 +460,7 @@ Returns:
   //\r
   // Try to open the input file\r
   //\r
-  if ((InFptr = fopen (InFile->FileName, "rb")) == NULL) {\r
+  if ((InFptr = fopen (LongFilePath (InFile->FileName), "rb")) == NULL) {\r
     Error (NULL, 0, 0001, "Open file error", "Error opening file: %s", InFile->FileName);\r
     return STATUS_ERROR;\r
   }\r
@@ -1230,7 +1230,7 @@ Returns:
   //\r
   // Copyright declaration\r
   // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -1300,7 +1300,7 @@ Returns:
   //\r
   // Open the input file\r
   //\r
-  if ((InFptr = fopen (InFile->FileName, "rb")) == NULL) {\r
+  if ((InFptr = fopen (LongFilePath (InFile->FileName), "rb")) == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", InFile->FileName);\r
     return ;\r
   }\r
index f102ee139af4d1004ecedb479c375e93d061dd35..6ca86ae555cb28febb91efbe572e0b008d666a6a 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -632,7 +632,7 @@ GetPathInfo (
     //\r
     // If path is file path, check whether file is valid.\r
     //\r
-    f = fopen (PathInfo->Path, "r");\r
+    f = fopen (LongFilePath (PathInfo->Path), "r");\r
     if (f == NULL) {\r
       fprintf (stderr, "error E2003: File was not provided!\n");\r
       return ErrorPath;\r
index 8ece9a841268cd3bc18ee71504d45332b47940f1..a2ff5880d5510fb7cb0d6755839c8b7b71fe3420 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -282,7 +282,7 @@ Returns:
   //\r
   // Open Input file and read file data.\r
   //\r
-  InFile = fopen (InputFileName, "rb");\r
+  InFile = fopen (LongFilePath (InputFileName), "rb");\r
   if (InFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", InputFileName);\r
     return STATUS_ERROR;\r
@@ -305,7 +305,7 @@ Returns:
   //\r
   // Open output file\r
   //\r
-  OutFile = fopen (OutputFileName, "wb");\r
+  OutFile = fopen (LongFilePath (OutputFileName), "wb");\r
   if (OutFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", OutputFileName);\r
     goto Finish;\r
index 6f4804e90a0aa554e0d3f6011b728f42b8f6eabe..765c0b27da73606908a9d50e8438a659cdb37ed2 100644 (file)
@@ -1,6 +1,6 @@
 /**\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -119,7 +119,7 @@ Returns:
   //\r
   // Copyright declaration\r
   // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -317,7 +317,7 @@ Returns:
     // \r
     // Open file and read contents\r
     //\r
-    InFile = fopen (InputFileName[Index], "rb");\r
+    InFile = fopen (LongFilePath (InputFileName[Index]), "rb");\r
     if (InFile == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", InputFileName[Index]);\r
       return EFI_ABORTED;\r
index 8f837d2695f593ebaebd0dcc7184ee6e81704a74..56c52b850f646c050383ba59d4d1b59848088364 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2007 - 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
@@ -97,7 +97,7 @@ Returns:
   //\r
   // Copyright declaration\r
   // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -603,7 +603,7 @@ Returns:
     if (OutFileName == NULL) {\r
       FpFile = stdout;\r
     } else {\r
-      FpFile = fopen (OutFileName, "w");\r
+      FpFile = fopen (LongFilePath (OutFileName), "w");\r
       if (FpFile == NULL) {\r
         Error (NULL, 0, 0001, "Error opening file", OutFileName);\r
         return STATUS_ERROR;\r
@@ -672,7 +672,7 @@ Returns:
   //  update boot driver address and runtime driver address in address file\r
   //\r
   if (Status == EFI_SUCCESS && AddrFileName != NULL && mFvBaseAddressNumber > 0) {\r
-    FpFile = fopen (AddrFileName, "w");\r
+    FpFile = fopen (LongFilePath (AddrFileName), "w");\r
     if (FpFile == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", AddrFileName);\r
       return STATUS_ERROR;\r
index 0522cf4254368dba995a7edc97225b0346f8d175..6ac542d6c0f2e6bb69de85f9ad80364faa96cb1e 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 2014, Intel Corporation. All rights reserved.<BR>\r
 Portions Copyright (c) 2011 - 2013, ARM Ltd. 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
@@ -187,7 +187,7 @@ Returns:
   EFI_NOT_FOUND     A required string was not found in the INF file.\r
 --*/\r
 {\r
-  CHAR8       Value[_MAX_PATH];\r
+  CHAR8       Value[MAX_LONG_FILE_PATH];\r
   UINT64      Value64;\r
   UINTN       Index;\r
   UINTN       Number;\r
@@ -730,7 +730,7 @@ Returns:
 \r
 --*/\r
 {\r
-  CHAR8                               PeMapFileName [_MAX_PATH];\r
+  CHAR8                               PeMapFileName [MAX_LONG_FILE_PATH];\r
   CHAR8                               *Cptr, *Cptr2;\r
   CHAR8                               FileGuidName [MAX_LINE_LEN];\r
   FILE                                *PeMapFile;\r
@@ -866,7 +866,7 @@ Returns:
   //\r
   // Open PeMapFile\r
   //\r
-  PeMapFile = fopen (PeMapFileName, "r");\r
+  PeMapFile = fopen (LongFilePath (PeMapFileName), "r");\r
   if (PeMapFile == NULL) {\r
     // fprintf (stdout, "can't open %s file to reading\n", PeMapFileName);\r
     return EFI_ABORTED;\r
@@ -992,7 +992,7 @@ Returns:
   //\r
   // Read the file to add\r
   //\r
-  NewFile = fopen (FvInfo->FvFiles[Index], "rb");\r
+  NewFile = fopen (LongFilePath (FvInfo->FvFiles[Index]), "rb");\r
 \r
   if (NewFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", FvInfo->FvFiles[Index]);\r
@@ -2077,12 +2077,12 @@ Returns:
   UINT8                           *FvImage;\r
   UINTN                           FvImageSize;\r
   FILE                            *FvFile;\r
-  CHAR8                           FvMapName [_MAX_PATH];\r
+  CHAR8                           FvMapName [MAX_LONG_FILE_PATH];\r
   FILE                            *FvMapFile;\r
   EFI_FIRMWARE_VOLUME_EXT_HEADER  *FvExtHeader;\r
   FILE                            *FvExtHeaderFile;\r
   UINTN                           FileSize;\r
-  CHAR8                           FvReportName[_MAX_PATH];\r
+  CHAR8                           FvReportName[MAX_LONG_FILE_PATH];\r
   FILE                            *FvReportFile;\r
 \r
   FvBufferHeader = NULL;\r
@@ -2152,7 +2152,7 @@ Returns:
     //\r
     // Open the FV Extension Header file\r
     //\r
-    FvExtHeaderFile = fopen (mFvDataInfo.FvExtHeaderFile, "rb");\r
+    FvExtHeaderFile = fopen (LongFilePath (mFvDataInfo.FvExtHeaderFile), "rb");\r
 \r
     //\r
     // Get the file size\r
@@ -2343,7 +2343,7 @@ Returns:
   //\r
   // Open FvMap file\r
   //\r
-  FvMapFile = fopen (FvMapName, "w");\r
+  FvMapFile = fopen (LongFilePath (FvMapName), "w");\r
   if (FvMapFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", FvMapName);\r
     return EFI_ABORTED;\r
@@ -2352,7 +2352,7 @@ Returns:
   //\r
   // Open FvReport file\r
   //\r
-  FvReportFile = fopen(FvReportName, "w");\r
+  FvReportFile = fopen (LongFilePath (FvReportName), "w");\r
   if (FvReportFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", FvReportName);\r
     return EFI_ABORTED;\r
@@ -2484,7 +2484,7 @@ WriteFile:
   //\r
   // Write fv file\r
   //\r
-  FvFile = fopen (FvFileName, "wb");\r
+  FvFile = fopen (LongFilePath (FvFileName), "wb");\r
   if (FvFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", FvFileName);\r
     Status = EFI_ABORTED;\r
@@ -2651,7 +2651,7 @@ Returns:
   // Calculate PI extension header\r
   //\r
   if (mFvDataInfo.FvExtHeaderFile[0] != '\0') {\r
-    fpin = fopen (mFvDataInfo.FvExtHeaderFile, "rb");\r
+    fpin = fopen (LongFilePath (mFvDataInfo.FvExtHeaderFile), "rb");\r
     if (fpin == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", mFvDataInfo.FvExtHeaderFile);\r
       return EFI_ABORTED;\r
@@ -2678,7 +2678,7 @@ Returns:
     // Open FFS file\r
     //\r
     fpin = NULL;\r
-    fpin = fopen (FvInfoPtr->FvFiles[Index], "rb");\r
+    fpin = fopen (LongFilePath (FvInfoPtr->FvFiles[Index]), "rb");\r
     if (fpin == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", FvInfoPtr->FvFiles[Index]);\r
       return EFI_ABORTED;\r
@@ -2915,7 +2915,7 @@ Returns:
   EFI_TE_IMAGE_HEADER                   *TEImageHeader;\r
   UINT8                                 *MemoryImagePointer;\r
   EFI_IMAGE_SECTION_HEADER              *SectionHeader;\r
-  CHAR8                                 PeFileName [_MAX_PATH];\r
+  CHAR8                                 PeFileName [MAX_LONG_FILE_PATH];\r
   CHAR8                                 *Cptr;\r
   FILE                                  *PeFile;\r
   UINT8                                 *PeFileBuffer;\r
@@ -3066,7 +3066,7 @@ Returns:
             *(Cptr + 3) = 'i';\r
             *(Cptr + 4) = '\0';\r
           }\r
-          PeFile = fopen (PeFileName, "rb");\r
+          PeFile = fopen (LongFilePath (PeFileName), "rb");\r
           if (PeFile == NULL) {\r
             Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);\r
             //Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);\r
@@ -3322,7 +3322,7 @@ Returns:
         *(Cptr + 4) = '\0';\r
       }\r
 \r
-      PeFile = fopen (PeFileName, "rb");\r
+      PeFile = fopen (LongFilePath (PeFileName), "rb");\r
       if (PeFile == NULL) {\r
         Warning (NULL, 0, 0, "Invalid", "The file %s has no .reloc section.", FileName);\r
         //Error (NULL, 0, 3000, "Invalid", "The file %s has no .reloc section.", FileName);\r
@@ -3567,7 +3567,7 @@ Returns:
   EFI_NOT_FOUND     A required string was not found in the INF file.\r
 --*/\r
 {\r
-  CHAR8       Value[_MAX_PATH];\r
+  CHAR8       Value[MAX_LONG_FILE_PATH];\r
   UINT64      Value64;\r
   UINTN       Index, Number;\r
   EFI_STATUS  Status;\r
@@ -3773,7 +3773,7 @@ Returns:
   FileSize = 0;\r
   CapSize  = mCapDataInfo.HeaderSize;\r
   while (mCapDataInfo.CapFiles [Index][0] != '\0') {\r
-    fpin = fopen (mCapDataInfo.CapFiles[Index], "rb");\r
+    fpin = fopen (LongFilePath (mCapDataInfo.CapFiles[Index]), "rb");\r
     if (fpin == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", mCapDataInfo.CapFiles[Index]);\r
       return EFI_ABORTED;\r
@@ -3811,7 +3811,7 @@ Returns:
   FileSize = 0;\r
   CapSize  = CapsuleHeader->HeaderSize;\r
   while (mCapDataInfo.CapFiles [Index][0] != '\0') {\r
-    fpin = fopen (mCapDataInfo.CapFiles[Index], "rb");\r
+    fpin = fopen (LongFilePath (mCapDataInfo.CapFiles[Index]), "rb");\r
     if (fpin == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", mCapDataInfo.CapFiles[Index]);\r
       free (CapBuffer);\r
@@ -3827,7 +3827,7 @@ Returns:
   //\r
   // write capsule data into the output file\r
   //\r
-  fpout = fopen (CapFileName, "wb");\r
+  fpout = fopen (LongFilePath (CapFileName), "wb");\r
   if (fpout == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", CapFileName);\r
     free (CapBuffer);\r
index a9a00ec02838f0a9a278edefc8e12ee96c547d8a..f8eecbade184fd5cdaceb8ef03a84a1cf2a2ecbf 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -214,7 +214,7 @@ Abstract:
 //\r
 typedef struct {\r
   UINTN Size;\r
-  CHAR8 ComponentName[_MAX_PATH];\r
+  CHAR8 ComponentName[MAX_LONG_FILE_PATH];\r
 } COMPONENT_INFO;\r
 \r
 //\r
@@ -227,12 +227,12 @@ typedef struct {
   BOOLEAN                 FvFileSystemGuidSet;\r
   EFI_GUID                FvNameGuid;\r
   BOOLEAN                 FvNameGuidSet;\r
-  CHAR8                   FvExtHeaderFile[_MAX_PATH];\r
+  CHAR8                   FvExtHeaderFile[MAX_LONG_FILE_PATH];\r
   UINTN                   Size;\r
   EFI_FVB_ATTRIBUTES_2    FvAttributes;\r
-  CHAR8                   FvName[_MAX_PATH];\r
+  CHAR8                   FvName[MAX_LONG_FILE_PATH];\r
   EFI_FV_BLOCK_MAP_ENTRY  FvBlocks[MAX_NUMBER_OF_FV_BLOCKS];\r
-  CHAR8                   FvFiles[MAX_NUMBER_OF_FILES_IN_FV][_MAX_PATH];\r
+  CHAR8                   FvFiles[MAX_NUMBER_OF_FILES_IN_FV][MAX_LONG_FILE_PATH];\r
   UINT32                  SizeofFvFiles[MAX_NUMBER_OF_FILES_IN_FV];\r
   BOOLEAN                 IsPiFvImage;\r
   INT8                    ForceRebase;\r
@@ -242,8 +242,8 @@ typedef struct {
   EFI_GUID                CapGuid;\r
   UINT32                  HeaderSize;\r
   UINT32                  Flags;\r
-  CHAR8                   CapName[_MAX_PATH];\r
-  CHAR8                   CapFiles[MAX_NUMBER_OF_FILES_IN_CAP][_MAX_PATH];\r
+  CHAR8                   CapName[MAX_LONG_FILE_PATH];\r
+  CHAR8                   CapFiles[MAX_NUMBER_OF_FILES_IN_CAP][MAX_LONG_FILE_PATH];\r
 } CAP_INFO;\r
 \r
 #pragma pack(1)\r
index d511834fc0aaaa7d1ff4cf62397eeef261299d19..56543b411b76d49be54beb982afa1eb91a4240bd 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -66,10 +66,6 @@ Abstract:
 #define DEFAULT_MC_PAD_BYTE_VALUE  0xFF\r
 #define DEFAULT_MC_ALIGNMENT       16\r
 \r
-#ifndef _MAX_PATH\r
-#define _MAX_PATH 500\r
-#endif\r
-\r
 #define STATUS_IGNORE 0xA\r
 //\r
 // Structure definition for a microcode header\r
@@ -179,7 +175,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
   //\r
   // Details Option\r
@@ -1559,7 +1555,7 @@ Returns:
   // Open output file and Write image into the output file.\r
   //\r
   if (OutImageName != NULL) {\r
-    fpOut = fopen (OutImageName, "rb");\r
+    fpOut = fopen (LongFilePath (OutImageName), "rb");\r
     if (fpOut != NULL) {\r
       //\r
       // Get Output file time stamp\r
@@ -1590,7 +1586,7 @@ Returns:
   //\r
   // Open input file and read file data into file buffer.\r
   //\r
-  fpIn = fopen (mInImageName, "rb");\r
+  fpIn = fopen (LongFilePath (mInImageName), "rb");\r
   if (fpIn == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", mInImageName);\r
     goto Finish;\r
@@ -1621,7 +1617,7 @@ Returns:
     //\r
     // Open output file handle.\r
     //\r
-    fpOut = fopen (OutImageName, "wb");\r
+    fpOut = fopen (LongFilePath (OutImageName), "wb");\r
     if (!fpOut) {\r
       Error (NULL, 0, 0001, "Error opening output file", OutImageName);\r
       goto Finish;\r
@@ -1631,7 +1627,7 @@ Returns:
     //\r
     HiiPackageListHeader.PackageLength = sizeof (EFI_HII_PACKAGE_LIST_HEADER);\r
     for (Index = 0; Index < InputFileNum; Index ++) {\r
-      fpIn = fopen (InputFileName [Index], "rb");\r
+      fpIn = fopen (LongFilePath (InputFileName [Index]), "rb");\r
       if (fpIn == NULL) {\r
         Error (NULL, 0, 0001, "Error opening file", InputFileName [Index]);\r
         goto Finish;\r
@@ -1677,7 +1673,7 @@ Returns:
     memcpy (HiiPackageListBuffer, &HiiPackageListHeader, sizeof (HiiPackageListHeader));\r
     HiiPackageDataPointer = HiiPackageListBuffer + sizeof (HiiPackageListHeader);\r
     for (Index = 0; Index < InputFileNum; Index ++) {\r
-      fpIn = fopen (InputFileName [Index], "rb");\r
+      fpIn = fopen (LongFilePath (InputFileName [Index]), "rb");\r
       if (fpIn == NULL) {\r
         Error (NULL, 0, 0001, "Error opening file", InputFileName [Index]);\r
         free (HiiPackageListBuffer);\r
@@ -1757,13 +1753,13 @@ Returns:
     //\r
     // Open output file handle.\r
     //\r
-    fpOut = fopen (OutImageName, "wb");\r
+    fpOut = fopen (LongFilePath (OutImageName), "wb");\r
     if (!fpOut) {\r
       Error (NULL, 0, 0001, "Error opening output file", OutImageName);\r
       goto Finish;\r
     }\r
     for (Index = 0; Index < InputFileNum; Index ++) {\r
-      fpIn = fopen (InputFileName [Index], "rb");\r
+      fpIn = fopen (LongFilePath (InputFileName [Index]), "rb");\r
       if (!fpIn) {\r
         Error (NULL, 0, 0001, "Error opening file", InputFileName [Index]);\r
         goto Finish;\r
@@ -1805,7 +1801,7 @@ Returns:
   // Convert MicroCode.txt file to MicroCode.bin file\r
   //\r
   if (mOutImageType == FW_MCI_IMAGE) {\r
-    fpIn = fopen (mInImageName, "r");\r
+    fpIn = fopen (LongFilePath (mInImageName), "r");\r
     if (fpIn == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", mInImageName);\r
       goto Finish;\r
@@ -1928,14 +1924,14 @@ Returns:
     // Open the output file handle.\r
     //\r
     if (ReplaceFlag) {\r
-      fpInOut = fopen (mInImageName, "wb");\r
+      fpInOut = fopen (LongFilePath (mInImageName), "wb");\r
       if (fpInOut == NULL) {\r
         Error (NULL, 0, 0001, "Error opening file", mInImageName);\r
         goto Finish;\r
       }\r
     } else {\r
       if (OutImageName != NULL) {\r
-        fpOut = fopen (OutImageName, "wb");\r
+        fpOut = fopen (LongFilePath (OutImageName), "wb");\r
       } else {\r
         fpOut = stdout;\r
       }\r
@@ -2641,7 +2637,7 @@ WriteFile:
       //\r
       // Update File when File is changed.\r
       //\r
-      fpInOut = fopen (mInImageName, "wb");\r
+      fpInOut = fopen (LongFilePath (mInImageName), "wb");\r
       if (fpInOut == NULL) {\r
         Error (NULL, 0, 0001, "Error opening file", mInImageName);\r
         goto Finish;\r
@@ -2654,7 +2650,7 @@ WriteFile:
       //\r
       // Update File when File is changed or File is old.\r
       //\r
-      fpOut = fopen (OutImageName, "wb");\r
+      fpOut = fopen (LongFilePath (OutImageName), "wb");\r
       if (fpOut == NULL) {\r
         Error (NULL, 0, 0001, "Error opening output file", OutImageName);\r
         goto Finish;\r
@@ -2696,7 +2692,7 @@ Finish:
       if (OutputFileBuffer == NULL) {\r
         remove (OutImageName);\r
       } else {\r
-        fpOut = fopen (OutImageName, "wb");\r
+        fpOut = fopen (LongFilePath (OutImageName), "wb");\r
         fwrite (OutputFileBuffer, 1, OutputFileLength, fpOut);\r
         fclose (fpOut);\r
       }\r
@@ -2722,7 +2718,7 @@ Finish:
     if (ReportFileName != NULL) {\r
       strcpy (ReportFileName, OutImageName);\r
       strcpy (ReportFileName + (FileLen - 4), ".txt"); \r
-      ReportFile = fopen (ReportFileName, "w+");\r
+      ReportFile = fopen (LongFilePath (ReportFileName), "w+");\r
       if (ReportFile != NULL) {\r
         fprintf (ReportFile, "MODULE_SIZE = %u\n", (unsigned) mImageSize);\r
         fprintf (ReportFile, "TIME_STAMP = %u\n", (unsigned) mImageTimeStamp);\r
index 78047ba9bee5184b0a755354c8cc95e9922486f7..b6a5d01e3ea0e20f6ef347daec5276a86422ae70 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -243,13 +243,13 @@ return:
   //\r
   // Open files\r
   //\r
-  PageFile = fopen (PageFileName, "w+b");\r
+  PageFile = fopen (LongFilePath (PageFileName), "w+b");\r
   if (PageFile == NULL) {\r
     Error (NoPageFileName, 0, 0x4002, "Invalid parameter option", "Output File %s open failure", PageFileName);\r
     return -1;\r
   }\r
 \r
-  NoPageFile = fopen (NoPageFileName, "r+b");\r
+  NoPageFile = fopen (LongFilePath (NoPageFileName), "r+b");\r
   if (NoPageFile == NULL) {\r
     Error (NoPageFileName, 0, 0x4002, "Invalid parameter option", "Input File %s open failure", NoPageFileName);\r
     fclose (PageFile);\r
index 63e8e13e8fc53da1e2146ff842859e6cc2e6d226..f9370d35645f6019f6c5116e9d7b27c8fb3d8a64 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -153,7 +153,7 @@ Returns:
   //\r
   // Copyright declaration\r
   // \r
-  fprintf (stdout, "Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.\n\n");\r
+  fprintf (stdout, "Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.\n\n");\r
 \r
   //\r
   // Details Option\r
@@ -283,7 +283,7 @@ Returns:
   //\r
   // Open the input file\r
   //\r
-  InFile = fopen (InputFileName[0], "rb");\r
+  InFile = fopen (LongFilePath (InputFileName[0]), "rb");\r
   if (InFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file", InputFileName[0]);\r
     return STATUS_ERROR;\r
@@ -473,7 +473,7 @@ Returns:
     // \r
     // Open file and read contents\r
     //\r
-    InFile = fopen (InputFileName[Index], "rb");\r
+    InFile = fopen (LongFilePath (InputFileName[Index]), "rb");\r
     if (InFile == NULL) {\r
       Error (NULL, 0, 0001, "Error opening file", InputFileName[Index]);\r
       return EFI_ABORTED;\r
@@ -1553,7 +1553,7 @@ Returns:
   //\r
   // Write the output file\r
   //\r
-  OutFile = fopen (OutputFileName, "wb");\r
+  OutFile = fopen (LongFilePath (OutputFileName), "wb");\r
   if (OutFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening file for writing", OutputFileName);\r
     goto Finish;\r
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
index b0ec271b0522b90301fb4a7579b36d811e1abf7b..f9869c44418199ff30380acc5c4364c5f7df2db9 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-Copyright (c) 2006 - 2011, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2006 - 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
@@ -153,7 +153,7 @@ GetPathInfo (
     }  \r
      \r
     // Try to open the device.   \r
-    f = fopen(PathInfo->Path,"r");\r
+    f = fopen (LongFilePath (PathInfo->Path),"r");\r
     if (f == NULL) {\r
       printf ("error :open device failed!\n");\r
       return ErrorPath;\r
@@ -167,7 +167,7 @@ GetPathInfo (
   if (PathInfo->Input) {\r
     // If path is file path, check whether file is valid.\r
     printf("Path = %s\n",PathInfo->Path);\r
-    f = fopen (PathInfo->Path, "r");\r
+    f = fopen (LongFilePath (PathInfo->Path), "r");\r
     if (f == NULL) {\r
       fprintf (stderr, "Test error E2003: File was not provided!\n");\r
       return ErrorPath;\r
@@ -211,7 +211,7 @@ ProcessBsOrMbr (
   FILE *OutputFile;\r
   \r
   \r
-  InputFile = fopen(InputInfo->PhysicalPath, "r");\r
+  InputFile = fopen (LongFilePath (InputInfo->PhysicalPath), "r");\r
   if (InputFile == NULL) {\r
     return ErrorFileReadWrite;\r
   }\r
@@ -235,9 +235,9 @@ ProcessBsOrMbr (
   } \r
   \r
   //Process Floppy Disk\r
-  OutputFile = fopen(OutputInfo->PhysicalPath, "r+");\r
+  OutputFile = fopen (LongFilePath (OutputInfo->PhysicalPath), "r+");\r
   if (OutputFile == NULL) {\r
-    OutputFile = fopen(OutputInfo->PhysicalPath, "w");\r
+    OutputFile = fopen (LongFilePath (OutputInfo->PhysicalPath), "w");\r
     if (OutputFile == NULL) {\r
       return ErrorFileReadWrite;\r
     }\r
@@ -276,7 +276,7 @@ Version (
   )\r
 {\r
   printf ("%s v%d.%d %s-Utility to retrieve and update the boot sector or MBR.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 2007-2010 Intel Corporation. All rights reserved.\n");\r
+  printf ("Copyright (c) 2007-2014 Intel Corporation. All rights reserved.\n");\r
 }\r
 \r
 \r
index 544da91f4b039241978235872bf6775a404bd455..e8fea63510ed00213125a8ef33d0ee32568f08b0 100644 (file)
@@ -2,7 +2,7 @@
 \r
   Split a file into two pieces at the request offset.\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
@@ -58,7 +58,7 @@ Returns:
 --*/\r
 {\r
   printf ("%s v%d.%d %s -Utility to break a file into two pieces at the request offset.\n", UTILITY_NAME, UTILITY_MAJOR_VERSION, UTILITY_MINOR_VERSION, __BUILD_VERSION);\r
-  printf ("Copyright (c) 1999-2010 Intel Corporation. All rights reserved.\n");\r
+  printf ("Copyright (c) 1999-2014 Intel Corporation. All rights reserved.\n");\r
 }\r
 \r
 void\r
@@ -348,7 +348,7 @@ Returns:
     return STATUS_ERROR;\r
   }\r
 \r
-  In = fopen (InputFileName, "rb");\r
+  In = fopen (LongFilePath (InputFileName), "rb");\r
   if (In == NULL) {\r
     // ("Unable to open file \"%s\"\n", InputFileName);\r
     Error (InputFileName, 0, 1, "File open failure", NULL);\r
@@ -400,14 +400,14 @@ Returns:
   chdir(CurrentDir);\r
   free(CurrentDir);\r
 \r
-  Out1 = fopen (OutFileName1, "wb");\r
+  Out1 = fopen (LongFilePath (OutFileName1), "wb");\r
   if (Out1 == NULL) {\r
     // ("Unable to open file \"%s\"\n", OutFileName1);\r
     Error (OutFileName1, 0, 1, "File open failure", NULL);\r
     return STATUS_ERROR;\r
   }\r
 \r
-  Out2 = fopen (OutFileName2, "wb");\r
+  Out2 = fopen (LongFilePath (OutFileName2), "wb");\r
   if (Out2 == NULL) {\r
     // ("Unable to open file \"%s\"\n", OutFileName2);\r
     Error (OutFileName2, 0, 1, "File open failure", NULL);\r
index bb2df3ed39d3716e68ce50254db988e77781809e..063266a91fa5f85146ab72a4339b387beb9f323a 100644 (file)
@@ -2,7 +2,7 @@
   \r
   VfrCompiler main class and main function.\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -413,7 +413,7 @@ CVfrCompiler::Usage (
   CONST  CHAR8 *Help[] = {\r
     " ", \r
     "VfrCompile version " VFR_COMPILER_VERSION __BUILD_VERSION,\r
-    "Copyright (c) 2004-2013 Intel Corporation. All rights reserved.",\r
+    "Copyright (c) 2004-2014 Intel Corporation. All rights reserved.",\r
     " ",\r
     "Usage: VfrCompile [options] VfrFile",\r
     " ",\r
@@ -476,7 +476,7 @@ CVfrCompiler::PreProcess (
     goto Out;\r
   }\r
 \r
-  if ((pVfrFile = fopen (mOptions.VfrFileName, "r")) == NULL) {\r
+  if ((pVfrFile = fopen (LongFilePath (mOptions.VfrFileName), "r")) == NULL) {\r
     DebugError (NULL, 0, 0001, "Error opening the input VFR file", mOptions.VfrFileName);\r
     goto Fail;\r
   }\r
@@ -545,7 +545,7 @@ CVfrCompiler::Compile (
   gCVfrErrorHandle.SetInputFile (InFileName);\r
   gCVfrErrorHandle.SetWarningAsError(mOptions.WarningAsError);\r
 \r
-  if ((pInFile = fopen (InFileName, "r")) == NULL) {\r
+  if ((pInFile = fopen (LongFilePath (InFileName), "r")) == NULL) {\r
     DebugError (NULL, 0, 0001, "Error opening the input file", InFileName);\r
     goto Fail;\r
   }\r
@@ -699,7 +699,7 @@ CVfrCompiler::GenBinary (
   }\r
 \r
   if (mOptions.CreateIfrPkgFile == TRUE) {\r
-    if ((pFile = fopen (mOptions.PkgOutputFileName, "wb")) == NULL) {\r
+    if ((pFile = fopen (LongFilePath (mOptions.PkgOutputFileName), "wb")) == NULL) {\r
       DebugError (NULL, 0, 0001, "Error opening file", mOptions.PkgOutputFileName);\r
       goto Fail;\r
     }\r
@@ -742,7 +742,7 @@ CVfrCompiler::GenCFile (
   }\r
   \r
   if (!mOptions.CreateIfrPkgFile || mOptions.CompatibleMode) {\r
-    if ((pFile = fopen (mOptions.COutputFileName, "w")) == NULL) {\r
+    if ((pFile = fopen (LongFilePath (mOptions.COutputFileName), "w")) == NULL) {\r
       DebugError (NULL, 0, 0001, "Error opening output C file", mOptions.COutputFileName);\r
       goto Fail;\r
     }\r
@@ -789,12 +789,12 @@ CVfrCompiler::GenRecordListFile (
       return;\r
     }\r
 \r
-    if ((pInFile = fopen (InFileName, "r")) == NULL) {\r
+    if ((pInFile = fopen (LongFilePath (InFileName), "r")) == NULL) {\r
       DebugError (NULL, 0, 0001, "Error opening the input VFR preprocessor output file", InFileName);\r
       return;\r
     }\r
 \r
-    if ((pOutFile = fopen (mOptions.RecordListFile, "w")) == NULL) {\r
+    if ((pOutFile = fopen (LongFilePath (mOptions.RecordListFile), "w")) == NULL) {\r
       DebugError (NULL, 0, 0001, "Error opening the record list file", mOptions.RecordListFile);\r
       goto Err1;\r
     }\r
index 7c1383eb7a89170852c2d82a21dccb928dfcc2a0..246820a08a2c331c9ffb7ba06a0317cc41b119a3 100644 (file)
@@ -2,7 +2,7 @@
   \r
   Vfr common library functions.\r
 \r
-Copyright (c) 2004 - 2013, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2004 - 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
@@ -15,6 +15,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 \r
 #include "stdio.h"\r
 #include "stdlib.h"\r
+#include "CommonLib.h"\r
 #include "VfrUtilityLib.h"\r
 #include "VfrFormPkg.h"\r
 \r
@@ -3283,7 +3284,7 @@ CVfrStringDB::GetVarStoreNameFormStringId (
     return NULL;\r
   }\r
 \r
-  if ((pInFile = fopen (mStringFileName, "rb")) == NULL) {\r
+  if ((pInFile = fopen (LongFilePath (mStringFileName), "rb")) == NULL) {\r
     return NULL;\r
   }\r
 \r
index 21d70199cba9a2a93a1aa8dd9bcdb9d06ab67cfc..537cea3cfe56d95656d4c601308f18deb243abff 100644 (file)
@@ -249,7 +249,7 @@ Returns:
   //\r
   // Open the file containing the FV\r
   //\r
-  InputFile = fopen (argv[0], "rb");\r
+  InputFile = fopen (LongFilePath (argv[0]), "rb");\r
   if (InputFile == NULL) {\r
     Error (NULL, 0, 0001, "Error opening the input file", argv[0]);\r
     return GetUtilityStatus ();\r
index 11cf8b2f18deb0c6f7b27a3357a42e4fb3d50110..c4662572a0386898f795b51e0dcb5377ad7632a4 100644 (file)
@@ -13,7 +13,7 @@
 \r
 ## Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import os.path as path\r
 import copy\r
@@ -26,6 +26,7 @@ from StringIO import StringIO
 from StrGather import *\r
 from BuildEngine import BuildRule\r
 \r
+from Common.LongFilePathSupport import CopyLongFilePath\r
 from Common.BuildToolError import *\r
 from Common.DataType import *\r
 from Common.Misc import *\r
index b3083d0395f3f692e27f2156302029112b605108..d15ccc06d55808a9e12a5306951f551d3ad6e62d 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # The engine for building files\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import copy\r
 import string\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 from Common.GlobalData import *\r
 from Common.BuildToolError import *\r
index 37ba7bc72cd25bcc1284ab1ac28aae40e17abf51..a390d560fc1a7db8834b7de4926aebee2f15a555 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to generate DEPEX file for module's dependency expression\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 ## Import Modules\r
 #\r
 import sys\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import traceback\r
-\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 from StringIO import StringIO\r
 from struct import pack\r
 from Common.BuildToolError import *\r
index 00d0af0cb775a3827605df6e0e1e9bf25227f6b5..64eedfaa1223dbdc562573613cec8ee3c09260c7 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Create makefile for MS nmake and GNU make\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 ## Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 import string\r
 import re\r
 import os.path as path\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 from Common.BuildToolError import *\r
 from Common.Misc import *\r
index b84d9f90aaec59e003d65fa3adb3252622c85714..20af015bcf254c7e1d0e0ddf9766fc8c2365d21a 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -20,6 +20,7 @@ from Common.BuildToolError import *
 from UniClassObject import *\r
 from StringIO import StringIO\r
 from struct import pack\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ##\r
 # Static definitions\r
index 7b1ce72ea7c0b64b902d15cf6c5ca0704d4dcfcd..e676ad6ec87302ef064d8997d7c00aea1e08a050 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 # Import Modules\r
 #\r
-import os, codecs, re\r
+import Common.LongFilePathOs as os, codecs, re\r
 import distutils.util\r
 import Common.EdkLogger as EdkLogger\r
 from Common.BuildToolError import *\r
 from Common.String import GetLineNo\r
 from Common.Misc import PathClass\r
-\r
+from Common.LongFilePathSupport import LongFilePath\r
 ##\r
 # Static definitions\r
 #\r
@@ -210,7 +210,7 @@ class UniFileClassObject(object):
         Lang = distutils.util.split_quoted((Line.split(u"//")[0]))\r
         if len(Lang) != 3:\r
             try:\r
-                FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').read()\r
+                FileIn = codecs.open(LongFilePath(File.Path), mode='rb', encoding='utf-16').read()\r
             except UnicodeError, X:\r
                 EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File);\r
             except:\r
@@ -292,7 +292,7 @@ class UniFileClassObject(object):
             EdkLogger.error("Unicode File Parser", FILE_NOT_FOUND, ExtraData=File.Path)\r
 \r
         try:\r
-            FileIn = codecs.open(File.Path, mode='rb', encoding='utf-16').readlines()\r
+            FileIn = codecs.open(LongFilePath(File.Path), mode='rb', encoding='utf-16').readlines()\r
         except UnicodeError, X:\r
             EdkLogger.error("build", FILE_READ_FAILURE, "File read failure: %s" % str(X), ExtraData=File.Path);\r
         except:\r
index 284eed65c743548bad48d5aba78087334b72351c..b12403139df0589b8929cd5d3ca41883b6c3c707 100644 (file)
@@ -6,7 +6,7 @@
 #  file of PCD layout for use during the build when the platform integrator selects to use \r
 #  automatic offset calculation.\r
 #\r
-#  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -20,7 +20,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 import encodings.ascii\r
 \r
index 3564571787551b47ef608f94a87594b5afdbdae1..76d30fa6ff497c165187c3aad98450465489dc21 100644 (file)
@@ -2,7 +2,7 @@
 #  This file include GenVpd class for fix the Vpd type PCD offset, and PcdEntry for describe\r
 #  and process each entry of vpd type PCD.\r
 #\r
-#  Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2010 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-import os\r
+import Common.LongFilePathOs as os\r
 import StringIO\r
 import StringTable as st\r
 import array\r
 import re\r
-\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 from struct import *\r
 import Common.EdkLogger as EdkLogger\r
 import Common.BuildToolError as BuildToolError\r
index 5c0a79f2910f0c5eaf44e35e56c87c467c83a625..a81a44731f03539e4e6dccd544650ff3a7c1ecb4 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create a database used by ECC tool\r
 #\r
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -15,7 +15,7 @@
 # Import Modules\r
 #\r
 import sqlite3\r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
 import EdkLogger as EdkLogger\r
 from CommonDataClass.DataClass import *\r
index 5b39bcd4cee8fa7058a0bad2b65ae5258e9654b6..d7c70a7336a01f8a3d97894ccc1b066880a54583 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define each component of DEC file\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 from String import *\r
 from DataType import *\r
 from Identification import *\r
@@ -26,6 +26,7 @@ from Table.TableDec import TableDec
 import Database\r
 from Parsing import *\r
 import GlobalData\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 #\r
 # Global variable\r
index de3556b8929a7c94322478c711d70d240596a27f..5300a5456c1e3b81119a253d38c25dd3214cc20e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Define a dictionary structure\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -16,6 +16,7 @@
 #\r
 import EdkLogger\r
 from DataType import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Convert a text file to a dictionary\r
 #\r
index 3d06288e9a026e61e06e017599c97ed311b0cb98..788a75e26777397465a8ac6f88ac758b21bc6591 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define each component of DSC file\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import EdkLogger as EdkLogger\r
 import Database\r
 from String import *\r
@@ -28,6 +28,7 @@ from BuildToolError import *
 from Misc import sdict\r
 import GlobalData\r
 from Table.TableDsc import TableDsc\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 #\r
 # Global variable\r
index d041b35411f20c85d2d2d32cca1e97b682776cf1..84d89b6c2ef8092ced61a38538782e6bf0b707f9 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This is the base class for applications that operate on an EDK II Workspace \r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -14,8 +14,9 @@
 ##\r
 # Import Modules\r
 #\r
-import os, sys, time\r
+import Common.LongFilePathOs as os, sys, time\r
 from DataType import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## EdkIIWorkspace\r
 #\r
index 2b5990ebe713f102959ded6fcb27af8b03dbea2a..d6df01d4ce0654e8a671c4f1f3a041bfae044e4c 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define each component of the build database\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os, string, copy, pdb, copy\r
+import Common.LongFilePathOs as os, string, copy, pdb, copy\r
 import EdkLogger\r
 import DataType\r
 from InfClassObject import *\r
index 10e7222b3d10f5fa1d8bae6a57e7e66477531463..f048b619e403170953d0cf9335cad8307d1a8320 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file implements the log mechanism for Python tools.\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -12,7 +12,7 @@
 #\r
 \r
 ## Import modules\r
-import sys, os, logging\r
+import Common.LongFilePathOs as os, sys, logging\r
 import traceback\r
 from  BuildToolError import *\r
 \r
index 031dc15bc7665b8cab3de77b574a999202ffb098..54a60a7e8f81c1655c434b29f776edb88ad74b77 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # parse FDF file\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 # Import Modules\r
 #\r
 import re\r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
 import CommonDataClass.FdfClass\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ##define T_CHAR_SPACE                ' '\r
 ##define T_CHAR_NULL                 '\0'\r
index 7ea0c39297693506f3c80460ec89eab4ca1c7502..f24e4e41a0c1e36e5679cd54c9218a588a64a933 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define each component of INF file\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import EdkLogger\r
 from CommonDataClass.CommonClass import LibraryClassClass\r
@@ -29,6 +29,7 @@ import GlobalData
 from Table.TableInf import TableInf\r
 import Database\r
 from Parsing import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 #\r
 # Global variable\r
diff --git a/BaseTools/Source/Python/Common/LongFilePathOs.py b/BaseTools/Source/Python/Common/LongFilePathOs.py
new file mode 100644 (file)
index 0000000..66d93d2
--- /dev/null
@@ -0,0 +1,73 @@
+## @file\r
+# Override built in module os to provide support for long file path\r
+#\r
+# Copyright (c) 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
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+\r
+import os\r
+import LongFilePathOsPath\r
+from Common.LongFilePathSupport import LongFilePath\r
+from Common.LongFilePathSupport import UniToStr\r
+\r
+path = LongFilePathOsPath\r
+\r
+def access(path, mode):\r
+    return os.access(LongFilePath(path), mode)\r
+\r
+def remove(path):\r
+    return os.remove(LongFilePath(path))\r
+\r
+def removedirs(name):\r
+    return os.removedirs(LongFilePath(name))\r
+\r
+def rmdir(path):\r
+    return os.rmdir(LongFilePath(path))\r
+\r
+def mkdir(path):\r
+    return os.mkdir(LongFilePath(path))\r
+\r
+def makedirs(name, mode=0777):\r
+    return os.makedirs(LongFilePath(name), mode)\r
+\r
+def rename(old, new):\r
+    return os.rename(LongFilePath(old), LongFilePath(new))\r
+\r
+def chdir(path):\r
+    return os.chdir(LongFilePath(path))\r
+\r
+def chmod(path, mode):\r
+    return os.chmod(LongFilePath(path), mode)\r
+\r
+def stat(path):\r
+    return os.stat(LongFilePath(path))\r
+\r
+def utime(path):\r
+    return os.utime(LongFilePath(path), None)\r
+\r
+def listdir(path):\r
+    List = []\r
+    uList = os.listdir(u"%s" % LongFilePath(path))\r
+    for Item in uList:\r
+        List.append(UniToStr(Item))\r
+    return List\r
+\r
+environ = os.environ\r
+getcwd = os.getcwd\r
+chdir = os.chdir\r
+walk = os.walk\r
+W_OK = os.W_OK\r
+F_OK = os.F_OK\r
+sep = os.sep\r
+linesep = os.linesep\r
+getenv = os.getenv\r
+pathsep = os.pathsep\r
+name = os.name\r
+SEEK_SET = os.SEEK_SET\r
+SEEK_END = os.SEEK_END\r
diff --git a/BaseTools/Source/Python/Common/LongFilePathOsPath.py b/BaseTools/Source/Python/Common/LongFilePathOsPath.py
new file mode 100644 (file)
index 0000000..cb89b1b
--- /dev/null
@@ -0,0 +1,51 @@
+## @file\r
+# Override built in module os.path to provide support for long file path\r
+#\r
+# Copyright (c) 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
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+\r
+import os\r
+from Common.LongFilePathSupport import LongFilePath\r
+\r
+def isfile(path):\r
+    return os.path.isfile(LongFilePath(path))\r
+\r
+def isdir(path):\r
+    return os.path.isdir(LongFilePath(path))\r
+\r
+def exists(path):\r
+    return os.path.exists(LongFilePath(path))\r
+\r
+def getsize(filename):\r
+    return os.path.getsize(LongFilePath(filename))\r
+\r
+def getmtime(filename):\r
+    return os.path.getmtime(LongFilePath(filename))\r
+\r
+def getatime(filename):\r
+    return os.path.getatime(LongFilePath(filename))\r
+\r
+def getctime(filename):\r
+    return os.path.getctime(LongFilePath(filename))\r
+\r
+join = os.path.join\r
+splitext = os.path.splitext\r
+splitdrive = os.path.splitdrive\r
+split = os.path.split\r
+abspath = os.path.abspath\r
+basename = os.path.basename\r
+commonprefix = os.path.commonprefix\r
+sep = os.path.sep\r
+normpath = os.path.normpath\r
+normcase = os.path.normcase\r
+dirname = os.path.dirname\r
+islink = os.path.islink\r
+isabs = os.path.isabs\r
+realpath = os.path.realpath\r
diff --git a/BaseTools/Source/Python/Common/LongFilePathSupport.py b/BaseTools/Source/Python/Common/LongFilePathSupport.py
new file mode 100644 (file)
index 0000000..72dde20
--- /dev/null
@@ -0,0 +1,59 @@
+## @file\r
+# Override built in function file.open to provide support for long file path\r
+#\r
+# Copyright (c) 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
+# http://opensource.org/licenses/bsd-license.php\r
+#\r
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
+#\r
+\r
+import os\r
+import platform\r
+import shutil\r
+\r
+##\r
+# OpenLongPath\r
+# Convert a file path to a long file path\r
+#\r
+def LongFilePath(FileName):\r
+    FileName = os.path.normpath(FileName)\r
+    if platform.system() == 'Windows':\r
+        if FileName.startswith('\\\\?\\'):\r
+            return FileName\r
+        if FileName.startswith('\\\\'):\r
+            return '\\\\?\\UNC\\' + FileName[2:]\r
+        if os.path.isabs(FileName):\r
+            return '\\\\?\\' + FileName\r
+    return FileName\r
+\r
+##\r
+# OpenLongFilePath\r
+# wrap open to support opening a long file path\r
+#\r
+def OpenLongFilePath(FileName, Mode='r', Buffer= -1):\r
+    return open(LongFilePath(FileName), Mode, Buffer)\r
+\r
+##\r
+# CopyLongFilePath\r
+# wrap copyfile to support copy a long file path\r
+#\r
+def CopyLongFilePath(src, dst):\r
+    with open(LongFilePath(src), 'rb') as fsrc:\r
+        with open(LongFilePath(dst), 'wb') as fdst:\r
+            shutil.copyfileobj(fsrc, fdst)\r
+\r
+## Convert a python unicode string to a normal string\r
+#\r
+# Convert a python unicode string to a normal string\r
+# UniToStr(u'I am a string') is 'I am a string'\r
+#\r
+# @param Uni:  The python unicode string\r
+#\r
+# @retval:     The formatted normal string\r
+#\r
+def UniToStr(Uni):\r
+    return repr(Uni)[2:-1]\r
index 7c69704596333faf5909cc1da6b738bd140c7fbd..6d6669d7ae570a7dd18fc25ca7f179d264e02094 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Contains several utilitities shared by migration tools.\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import EdkLogger\r
 from optparse import OptionParser\r
 from Common.BuildToolError import *\r
 from XmlRoutines import *\r
 from CommonDataClass.CommonClass import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Set all fields of CommonClass object.\r
 #\r
index 7b568dc3e5c18ff56464ca781a52793c5b615640..e9e41de02e8e1a322c6be1876dfe22c750a486b9 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Common routines used by all tools\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 import string\r
 import thread\r
@@ -32,6 +32,7 @@ from DataType import *
 from BuildToolError import *\r
 from CommonDataClass.DataClass import *\r
 from Parsing import GetSplitValueList\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Regular expression used to find out place holders in string template\r
 gPlaceholderPattern = re.compile("\$\{([^$()\s]+)\}", re.MULTILINE|re.UNICODE)\r
index 04b45a0b83d1b12a990b8e18f9de0870f6d1ad2c..4dc8e9b1168eb495bef4dfc4fca2faa97db9570a 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define common string related functions used in parsing process\r
 #\r
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 import re\r
 import DataType\r
-import os.path\r
+import Common.LongFilePathOs as os\r
 import string\r
 import EdkLogger as EdkLogger\r
 \r
 import GlobalData\r
 from BuildToolError import *\r
 from CommonDataClass.Exceptions import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 gHexVerPatt = re.compile('0x[a-f0-9]{4}[a-f0-9]{4}$', re.IGNORECASE)\r
 gHumanReadableVerPatt = re.compile(r'([1-9][0-9]*|0)\.[0-9]{1,2}$')\r
index a7dec65a2530dc66a2942dd4af34b9db17907781..89e393708625a7eb4a019db1a0ecdc8f6a8edc08 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define each component of Target.txt file\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import EdkLogger\r
 import DataType\r
 from BuildToolError import *\r
 import GlobalData\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 gDefaultTargetTxtFile = "Conf/target.txt"\r
 \r
index 0f49457449cd698d1e972ab38ca5f04d86066204..583d51b51306a74eca0d0ed772e265c0099fac71 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define each component of tools_def.txt file\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import EdkLogger\r
 \r
 from Dictionary import *\r
 from BuildToolError import *\r
 from TargetTxtClassObject import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ##\r
 # Static variables used for pattern\r
index 18f6f5663c51d4386269988ade67e0e00c1a270e..1a68e9bee1725c658ae9b533ef882e248ca9b5cd 100644 (file)
@@ -6,7 +6,7 @@
 # is pointed by *_*_*_VPD_TOOL_GUID in conf/tools_def.txt \r
 #\r
 #\r
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 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
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import Common.EdkLogger as EdkLogger\r
 import Common.BuildToolError as BuildToolError\r
 import subprocess\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 FILE_COMMENT_TEMPLATE = \\r
 """\r
index c1ac07e852f6d7321abfcb62e16876fc0f8db2c4..4e7ffe7aca979536bbc24e75e83ecd56dc0833f1 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define checkpoints used by ECC tool\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -10,7 +10,7 @@
 # THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,\r
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 from CommonDataClass.DataClass import *\r
 from Common.DataType import SUP_MODULE_LIST_STRING, TAB_VALUE_SPLIT\r
index 134b15f81e7e07fed2b136b28b43541b1713863b..171600feebf9f978b6c1c74857fafd98399e02f5 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # preprocess source file\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,7 +17,7 @@
 #\r
 \r
 import re\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 \r
 import antlr3\r
index 4f93d79661b412094632db3ece1a8912a80eee9c..72bfbc709befb0a210195f0870dfa5f5fbdc3ed3 100644 (file)
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import Common.EdkLogger as EdkLogger\r
 from Common.DataType import *\r
 from Common.String import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Configuration\r
 #\r
index f3e2b5934ad0fb77f82ccb5772b5e1f501b6f85d..204117512452b4d0d2d4c1cb8fdc50b2e9cf30b1 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create a database used by ECC tool\r
 #\r
-# Copyright (c) 2007 - 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -15,7 +15,7 @@
 # Import Modules\r
 #\r
 import sqlite3\r
-import os, time\r
+import Common.LongFilePathOs as os, time\r
 \r
 import Common.EdkLogger as EdkLogger\r
 import CommonDataClass.DataClass as DataClass\r
index b5d733e48e2e5917dd63f7295967d9c66726d689..72f22d5b22514b96464f27fb37d5ae67bc83cc2d 100644 (file)
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os, time, glob, sys\r
+import Common.LongFilePathOs as os, time, glob, sys\r
 import Common.EdkLogger as EdkLogger\r
 import Database\r
 import EccGlobalData\r
@@ -37,6 +37,7 @@ from MetaFileWorkspace.MetaFileTable import MetaFileStorage
 import c\r
 import re, string\r
 from Exception import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Ecc\r
 #\r
index 5226e4a7d174cbfd00a073415389cc7ab4c0b179..a20d6ead4886a44bf1526abc6164969e17f8f89f 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to save global datas used by ECC tool\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
 gWorkspace = ''\r
 gTarget = ''\r
index ffbb62b3b0298d160707cc17a553a50d7f03f17f..fffbf30a98e6a3c1634274a13f1685217310b5f3 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to parse exception items found by ECC tool\r
 #\r
-# Copyright (c) 2009, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 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
@@ -15,7 +15,7 @@
 # Import Modules\r
 #\r
 from Xml.XmlRoutines import *\r
-import os.path\r
+import Common.LongFilePathOs as os\r
 \r
 # ExceptionXml to parse Exception Node of XML file\r
 class ExceptionXml(object):\r
index 689aee0975312c80bb32cc8ee3ae403ac10ce277..f31d37ff9683c9865215fb1c4657639134016350 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # fragments of source file\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,8 +17,9 @@
 #\r
 \r
 import re\r
-import os\r
+import Common.LongFilePathOs as os\r
 from ParserWarning import Warning\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 CommentList = []\r
 PPDirectiveList = []\r
index bbafa00dddd127e0660c40d824a830d97afe87f3..98b16a0e5c4446ac694aa314d13b39558fb7eb62 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define common parser functions for meta-data\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -11,7 +11,7 @@
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.DataClass import *\r
 from EccToolError import *\r
 import EccGlobalData\r
index 643c228665e6a62d834b8e271086311cf595422a..0d53f05d8bc11a1d9fd9806cadcb1dd8f3b37600 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create/update/query/erase table for files\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
 import Common.EdkLogger as EdkLogger\r
 from CommonDataClass import DataClass\r
index 405c5b5b031ff00c4cafabf83d39634dcc386f72..949d067945554cfc60951533056428bf0c0a8235 100644 (file)
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import time\r
 import copy\r
@@ -31,7 +31,8 @@ from Common.Expression import *
 from CommonDataClass.Exceptions import *\r
 \r
 from MetaFileTable import MetaFileStorage\r
-from GenFds.FdfParser import FdfParser  \r
+from GenFds.FdfParser import FdfParser\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## A decorator used to parse macro definition\r
 def ParseMacro(Parser):\r
index 58230670568391e9c6f2d93b810f628212933cdf..b93588eea61a12c099ee2e57a7a1127bca5b8cd8 100644 (file)
@@ -2,7 +2,7 @@
 # This is an XML API that uses a syntax similar to XPath, but it is written in\r
 # standard python so that no extra python packages are required to use it.\r
 #\r
-# Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -16,6 +16,7 @@
 # Import Modules\r
 #\r
 import xml.dom.minidom\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Create a element of XML\r
 #\r
index ea7d99fecd22186bf7fd27118dee2b18845755c1..6c20f6c9a3ff3d9d5288b6f0d56d23e7fad1ad1a 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to be the c coding style checking of ECC tool\r
 #\r
-# Copyright (c) 2009 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2009 - 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
@@ -12,7 +12,7 @@
 #\r
 \r
 import sys\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import string\r
 import CodeFragmentCollector\r
index 4e8cef2c4222ea1d4ba86e8e1d17c2c30753075e..bb78a0f882d539e7269981f66126ef8e461016ba 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # preprocess source file\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,7 +16,7 @@
 # Import Modules\r
 #\r
 import re\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 \r
 import antlr3\r
index ce38a0fa929e9ec68346c90275dd1ad6e4a5ea02..65bac9c127cb01d5942d2c24372c10c1532497bc 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create a database used by EOT tool\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -15,7 +15,7 @@
 # Import Modules\r
 #\r
 import sqlite3\r
-import os, time\r
+import Common.LongFilePathOs as os, time\r
 \r
 import Common.EdkLogger as EdkLogger\r
 import CommonDataClass.DataClass as DataClass\r
index 029caedabcf4f8f085e376dda02d487729473e14..5029f7369d4aa838bc5712e53a136c1cdca54da9 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to be the main entrance of EOT tool\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os, time, glob\r
+import Common.LongFilePathOs as os, time, glob\r
 import Common.EdkLogger as EdkLogger\r
 import EotGlobalData\r
 from optparse import OptionParser\r
@@ -30,6 +30,7 @@ from Report import Report
 from Common.Misc import ParseConsoleLog\r
 from Common.BuildVersion import gBUILD_VERSION\r
 from Parser import ConvertGuid\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Class Eot\r
 #\r
index 43fd57a8de05b6c4bbe911332d5b30ba433e62b1..dd4ff4cf5eb681a7ab948f87bf65d7575d88f5d8 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to save global datas\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -12,6 +12,7 @@
 #\r
 \r
 from Common.Misc import sdict\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 gEFI_SOURCE = ''\r
 gEDK_SOURCE = ''\r
index b377ef6f4137aebc722291f84b01da505c0b76e7..0544c0d55b44fd07c63a73ef8701d692840841a5 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # fragments of source file\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,8 +17,9 @@
 #\r
 \r
 import re\r
-import os\r
+import Common.LongFilePathOs as os\r
 from ParserWarning import Warning\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 # Profile contents of a file\r
 PPDirectiveList = []\r
index f668a17c09c819ed96730d2625765b10e794643f..f2a9bc68016e50a82ae4af7d00148cdb603d2355 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Parse FV image\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -13,7 +13,7 @@
 \r
 ## Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import sys\r
 import uuid\r
@@ -24,7 +24,7 @@ import copy
 from UserDict import IterableUserDict\r
 from cStringIO import StringIO\r
 from array import array\r
-\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 from CommonDataClass import *\r
 from Common.Misc import sdict, GuidStructureStringToGuidString\r
 \r
index 6750f5a0c9673d63b665f695d123cd347a948b7c..6bb2c5f9f1d63b05266fec7f3e6795d96cf3dbca 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to parse INF file of EDK project\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import Common.EdkLogger as EdkLogger\r
 from Common.DataType import *\r
 from CommonDataClass.DataClass import *\r
index d5419d0e06618b3e8c1a93aef31cd3389b5b6306..ab19e30b69aa1c0749a4d160c27ae94c5918761b 100644 (file)
@@ -2,7 +2,7 @@
 # This file is used to define common parsing related functions used in parsing\r
 # Inf/Dsc/Makefile process\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -15,7 +15,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os, re\r
+import Common.LongFilePathOs as os, re\r
 import Common.EdkLogger as EdkLogger\r
 from Common.DataType import *\r
 from CommonDataClass.DataClass import *\r
@@ -23,6 +23,7 @@ from Common.String import CleanString, GetSplitValueList, ReplaceMacro
 import EotGlobalData\r
 from Common.Misc import sdict\r
 from Common.String import GetSplitList\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## PreProcess() method\r
 #\r
index 024f6d87bea3b86c1a424595889814ebcc1b6839..386e3eb8ec05d747d6ead55c3e0ff26bd3421616 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create report for Eot tool\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -14,8 +14,9 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import EotGlobalData\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Report() class\r
 #\r
index 02ff95995846e5cf4c5add289964387af02a5661..8199ce5ee73edefdef65649f66c082fd318305cd 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # preprocess source file\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,7 +16,7 @@
 # Import Modules\r
 #\r
 import sys\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import CodeFragmentCollector\r
 import FileProfile\r
index a6dace82a628de908c35ddd83608572ffeda4a32..a2306d062d2dea61eb1564baa3b972e81ced42cc 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process APRIORI file data and generate PEI/DXE APRIORI file\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,7 +16,7 @@
 # Import Modules\r
 #\r
 from struct import *\r
-import os\r
+import Common.LongFilePathOs as os\r
 import StringIO\r
 import FfsFileStatement\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
index fb9213b467b383cd5719b3bcaed94422e9799b1d..85f95a69c1f050036dd2daf3bca052187cd56613 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # generate capsule\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,7 +17,7 @@
 #\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 from CommonDataClass.FdfClass import CapsuleClassObject\r
-import os\r
+import Common.LongFilePathOs as os\r
 import subprocess\r
 import StringIO\r
 from Common.Misc import SaveFileOnChange\r
index 4bcf286c23f0e854b046874152c4180720ac02a4..9d9c9cfdf7ea0b1a9a596c30f6d70a19bdcbe1b6 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process compress section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
index 0f41953ad42f6c2ba1a8fd825ed2f2c5b5c569c5..ba3677ed89db77ad558166a24f1dac74eaaf78df 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process data section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -19,10 +19,10 @@ import Section
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import subprocess\r
 from Ffs import Ffs\r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.FdfClass import DataSectionClassObject\r
 from Common.Misc import PeImageClass\r
-import shutil\r
+from Common.LongFilePathSupport import CopyLongFilePath\r
 \r
 ## generate data section\r
 #\r
@@ -71,9 +71,8 @@ class DataSection (DataSectionClassObject):
             MapFile = Filename.replace('.efi', '.map')\r
             if os.path.exists(MapFile):\r
                 CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
-                if not os.path.exists(CopyMapFile) or \\r
-                    (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
-                    shutil.copyfile(MapFile, CopyMapFile)\r
+                if not os.path.exists(CopyMapFile) or (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
+                    CopyLongFilePath(MapFile, CopyMapFile)\r
 \r
         #Get PE Section alignment when align is set to AUTO\r
         if self.Alignment == 'Auto' and self.SecType in ('TE', 'PE32'):\r
@@ -92,7 +91,7 @@ class DataSection (DataSectionClassObject):
             FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
             if not os.path.exists(FileBeforeStrip) or \\r
                 (os.path.getmtime(self.SectFileName) > os.path.getmtime(FileBeforeStrip)):\r
-                shutil.copyfile(self.SectFileName, FileBeforeStrip)\r
+                CopyLongFilePath(self.SectFileName, FileBeforeStrip)\r
             StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
             GenFdsGlobalVariable.GenerateFirmwareImage(\r
                                     StrippedFile,\r
index b7b1ae7d93afdb61c93b2fc892d1002f1d92c9da..c048efe47801bd65667e8b254f8f411cd4ef8620 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process depex section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -19,10 +19,9 @@ import Section
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import subprocess\r
 from Ffs import Ffs\r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.FdfClass import DepexSectionClassObject\r
 from AutoGen.GenDepex import DependencyExpression\r
-import shutil\r
 from Common import EdkLogger\r
 from Common.BuildToolError import *\r
 \r
index 3eb4e23842f45d518c485374932f21eab3fa2f0e..15ebac5705d6b0bf20750cba71168e8f6d88686e 100644 (file)
@@ -20,12 +20,13 @@ import Section
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import subprocess\r
 from Ffs import Ffs\r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.FdfClass import EfiSectionClassObject\r
-import shutil\r
 from Common import EdkLogger\r
 from Common.BuildToolError import *\r
 from Common.Misc import PeImageClass\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
+from Common.LongFilePathSupport import CopyLongFilePath\r
 \r
 ## generate rule section\r
 #\r
@@ -237,14 +238,14 @@ class EfiSection (EfiSectionClassObject):
                         if os.path.exists(MapFile):\r
                             CopyMapFile = os.path.join(OutputPath, ModuleName + '.map')\r
                             if not os.path.exists(CopyMapFile) or \\r
-                                (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
-                                shutil.copyfile(MapFile, CopyMapFile)\r
+                                   (os.path.getmtime(MapFile) > os.path.getmtime(CopyMapFile)):\r
+                                CopyLongFilePath(MapFile, CopyMapFile)\r
 \r
                     if not NoStrip:\r
                         FileBeforeStrip = os.path.join(OutputPath, ModuleName + '.efi')\r
                         if not os.path.exists(FileBeforeStrip) or \\r
                             (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):\r
-                            shutil.copyfile(File, FileBeforeStrip)\r
+                            CopyLongFilePath(File, FileBeforeStrip)\r
                         StrippedFile = os.path.join(OutputPath, ModuleName + '.stripped')\r
                         GenFdsGlobalVariable.GenerateFirmwareImage(\r
                                                 StrippedFile,\r
index 3716549cbadafbe55a0c56c54193420b7f75a26b..0c06ff57dc319f532ca187187a763ec91a206341 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FD generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,7 +17,7 @@
 #\r
 import Region\r
 import Fv\r
-import os\r
+import Common.LongFilePathOs as os\r
 import StringIO\r
 import sys\r
 from struct import *\r
index f1e03f4c3f7820e519bcf05dd741fc0ca7c1256e..01dab7bdabac4075688fbddfb19ae264548fea0a 100644 (file)
@@ -55,7 +55,8 @@ from Common.String import ReplaceMacro
 from Common.Misc import tdict\r
 \r
 import re\r
-import os\r
+import Common.LongFilePathOs as os\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ##define T_CHAR_SPACE                ' '\r
 ##define T_CHAR_NULL                 '\0'\r
index d0dec380fb8e17735d7f7d0b01f9d73a37514127..a765f9e04af8540e92babb90b3689d419e46c853 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FFS generation from FILE statement\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,7 +17,7 @@
 #\r
 import Ffs\r
 import Rule\r
-import os\r
+import Common.LongFilePathOs as os\r
 import StringIO\r
 import subprocess\r
 \r
index feab8c84a097f326c0157dbd861b3df08879c8a2..a7a65919d7cd977d6f3c12f5769e01cb66f362e1 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FFS generation from INF statement\r
 #\r
-#  Copyright (c) 2007 - 2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,8 +16,7 @@
 # Import Modules\r
 #\r
 import Rule\r
-import os\r
-import shutil\r
+import Common.LongFilePathOs as os\r
 import StringIO\r
 from struct import *\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
@@ -38,6 +37,8 @@ from FvImageSection import FvImageSection
 from Common.Misc import PeImageClass\r
 from AutoGen.GenDepex import DependencyExpression\r
 from PatchPcdValue.PatchPcdValue import PatchBinaryFile\r
+from Common.LongFilePathSupport import CopyLongFilePath\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## generate FFS from INF\r
 #\r
@@ -322,7 +323,7 @@ class FfsInfStatement(FfsInfStatementClassObject):
             return EfiFile\r
         Basename = os.path.basename(EfiFile)\r
         Output = os.path.join(self.OutputPath, Basename)\r
-        shutil.copy(EfiFile, Output)\r
+        CopyLongFilePath(EfiFile, Output)\r
         for Pcd in self.PatchPcds:\r
             RetVal, RetStr = PatchBinaryFile(Output, int(Pcd.Offset, 0), Pcd.DatumType, Pcd.DefaultValue, Pcd.MaxDatumSize)\r
             if RetVal:\r
@@ -648,8 +649,8 @@ class FfsInfStatement(FfsInfStatementClassObject):
                 if not NoStrip:\r
                     FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
                     if not os.path.exists(FileBeforeStrip) or \\r
-                        (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):\r
-                        shutil.copyfile(File, FileBeforeStrip)\r
+                           (os.path.getmtime(File) > os.path.getmtime(FileBeforeStrip)):\r
+                        CopyLongFilePath(File, FileBeforeStrip)\r
                     StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')\r
                     GenFdsGlobalVariable.GenerateFirmwareImage(\r
                                             StrippedFile,\r
@@ -687,8 +688,9 @@ class FfsInfStatement(FfsInfStatementClassObject):
             if not NoStrip:\r
                 FileBeforeStrip = os.path.join(self.OutputPath, ModuleName + '.reloc')\r
                 if not os.path.exists(FileBeforeStrip) or \\r
-                    (os.path.getmtime(GenSecInputFile) > os.path.getmtime(FileBeforeStrip)):\r
-                    shutil.copyfile(GenSecInputFile, FileBeforeStrip)\r
+                       (os.path.getmtime(GenSecInputFile) > os.path.getmtime(FileBeforeStrip)):\r
+                    CopyLongFilePath(GenSecInputFile, FileBeforeStrip)\r
+\r
                 StrippedFile = os.path.join(self.OutputPath, ModuleName + '.stipped')\r
                 GenFdsGlobalVariable.GenerateFirmwareImage(\r
                                         StrippedFile,\r
index 781c1a045d0ed38eb72f1c1ba3362e388327363d..03a742696fa169721854491b1efc87a69f4fc146 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FV generation\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -15,8 +15,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
-import shutil\r
+import Common.LongFilePathOs as os\r
 import subprocess\r
 import StringIO\r
 from struct import *\r
@@ -27,6 +26,8 @@ from GenFdsGlobalVariable import GenFdsGlobalVariable
 from GenFds import GenFds\r
 from CommonDataClass.FdfClass import FvClassObject\r
 from Common.Misc import SaveFileOnChange\r
+from Common.LongFilePathSupport import CopyLongFilePath\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 T_CHAR_LF = '\n'\r
 \r
@@ -128,7 +129,7 @@ class FV (FvClassObject):
             FvOutputFile = self.CreateFileName\r
 \r
         FvInfoFileName = os.path.join(GenFdsGlobalVariable.FfsDir, self.UiFvName + '.inf')\r
-        shutil.copy(GenFdsGlobalVariable.FvAddressFileName, FvInfoFileName)\r
+        CopyLongFilePath(GenFdsGlobalVariable.FvAddressFileName, FvInfoFileName)\r
         OrigFvInfo = None\r
         if os.path.exists (FvInfoFileName):\r
             OrigFvInfo = open(FvInfoFileName, 'r').read()\r
index f5d3f4f9a536b48f3a4457b473efcfc9ff228933..caf8de11e5ba2cae6d44f2e90b53d5650c5cd99e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FV image section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -20,7 +20,7 @@ import StringIO
 from Ffs import Ffs\r
 import subprocess\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.FdfClass import FvImageSectionClassObject\r
 from Common import EdkLogger\r
 from Common.BuildToolError import *\r
index c0762edf228f875ca0e8c5aad60667d3ff16f450..087f7ab3560887ddabb6cfc2ca553aac28209e41 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # generate flash image\r
 #\r
-#  Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,7 +17,7 @@
 #\r
 from optparse import OptionParser\r
 import sys\r
-import os\r
+import Common.LongFilePathOs as os\r
 import linecache\r
 import FdfParser\r
 import Common.BuildToolError as BuildToolError\r
@@ -42,7 +42,7 @@ from Common.BuildVersion import gBUILD_VERSION
 ## Version and Copyright\r
 versionNumber = "1.0" + ' ' + gBUILD_VERSION\r
 __version__ = "%prog Version " + versionNumber\r
-__copyright__ = "Copyright (c) 2007 - 2013, Intel Corporation  All rights reserved."\r
+__copyright__ = "Copyright (c) 2007 - 2014, Intel Corporation  All rights reserved."\r
 \r
 ## Tool entrance method\r
 #\r
index cbf3d980a87309dd17a4de567c71bc600617cf75..f97b41b834eb6da24077319ca2a15ecb7aa4e050 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Global variables for GenFds\r
 #\r
-#  Copyright (c) 2007 - 2012, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -15,7 +15,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 import subprocess\r
 import struct\r
@@ -30,6 +30,7 @@ from Common.ToolDefClassObject import ToolDefClassObject
 from AutoGen.BuildEngine import BuildRule\r
 import Common.DataType as DataType\r
 from Common.Misc import PathClass\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Global variables\r
 #\r
index 36ad4f58ef8189f2cb13b2308179baea08b18138..97d8ba8f76704b78acbc8cff506c2fbac717258e 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process GUIDed section generation\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -18,7 +18,7 @@
 import Section\r
 import subprocess\r
 from Ffs import Ffs\r
-import os\r
+import Common.LongFilePathOs as os\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 from CommonDataClass.FdfClass import GuidSectionClassObject\r
 from Common import ToolDefClassObject\r
@@ -26,6 +26,7 @@ import sys
 from Common import EdkLogger\r
 from Common.BuildToolError import *\r
 from FvImageSection import FvImageSection\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## generate GUIDed section\r
 #\r
index a98d208e1d75e22604ab28b9f32cac3e2fd9179e..5e3273d0f8512cb2ed1d74a6978d796d69f1a9c6 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process OptionROM generation from FILE statement\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -15,7 +15,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 ## \r
index ce46413bf65159d6c87d9f815d6cf8f96d2a94f0..94f77f60e8fb8030085d2c70d17cb0af3df6c5d0 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process OptionROM generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -15,8 +15,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
-import shutil\r
+import Common.LongFilePathOs as os\r
 import subprocess\r
 import StringIO\r
 \r
index 7879a9e29cdb63f88bbbb318ca194415014fec63..15b2ecba906aff51a3c2c6eb31d3eec366785867 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process FD Region generation\r
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -19,10 +19,11 @@ from struct import *
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 import StringIO\r
 from CommonDataClass.FdfClass import RegionClassObject\r
-import os\r
+import Common.LongFilePathOs as os\r
 from stat import *\r
 from Common import EdkLogger\r
 from Common.BuildToolError import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## generate Region\r
 #\r
index 819bb51a7879d7430576e19fc419dfc794e30cc4..e32041d6a5fadf943a06fee93afe07c499815d38 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # section base class\r
 #\r
-#  Copyright (c) 2007-2011, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007-2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -17,7 +17,7 @@
 #\r
 from CommonDataClass.FdfClass import SectionClassObject\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
-import os, glob\r
+import Common.LongFilePathOs as os, glob\r
 from Common import EdkLogger\r
 from Common.BuildToolError import *\r
 \r
index e1b69ed13356ea28f323c247858a0efa8cb2abde..e4f3647f1323b2c16cbd89648a4449252963b170 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process UI section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 import Section\r
 from Ffs import Ffs\r
 import subprocess\r
-import os\r
+import Common.LongFilePathOs as os\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 from CommonDataClass.FdfClass import UiSectionClassObject\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## generate UI section\r
 #\r
index 8f6da9624f1ed87c7b5f6f2408b3c7461439256d..657ebd9d166e328bcf0d642f999441f038c1cf02 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process Version section generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
 #\r
 from Ffs import Ffs\r
 import Section\r
-import os\r
+import Common.LongFilePathOs as os\r
 import subprocess\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
 from CommonDataClass.FdfClass import VerSectionClassObject\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## generate version section\r
 #\r
index e7e36491db60fbe24f01de4fd734617c0502b13e..64b5d771382d4b07c51d0f97cd09c7b5e70628d9 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # process VTF generation\r
 #\r
-#  Copyright (c) 2007, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -16,8 +16,9 @@
 # Import Modules\r
 #\r
 from GenFdsGlobalVariable import GenFdsGlobalVariable\r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.FdfClass import VtfClassObject\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 T_CHAR_LF = '\n'\r
 \r
 ## generate VTF\r
index 9cfdad3171a4127a18118ff549e8d4652944f365..50d99f7267a381b26ce333d20f0e20f792ca1776 100644 (file)
@@ -5,7 +5,7 @@
 #    PCD Name    Offset in binary\r
 #    ========    ================\r
 #\r
-# Copyright (c) 2008 - 2013, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -18,7 +18,7 @@
 \r
 #======================================  External Libraries ========================================\r
 import optparse\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import array\r
 \r
@@ -26,6 +26,7 @@ from Common.BuildToolError import *
 import Common.EdkLogger as EdkLogger\r
 from Common.Misc import PeImageClass\r
 from Common.BuildVersion import gBUILD_VERSION\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 # Version and Copyright\r
 __version_number__ = ("0.10" + " " + gBUILD_VERSION)\r
index 01b87012cd24a3d6a446cca973cf3a80db5bc6d9..1b3a0ec93d62c1b503e1020082519bb31ff96c88 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Patch value into the binary file.\r
 #\r
-# Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 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
@@ -14,7 +14,8 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 import sys\r
 import re\r
 \r
index dd465b68b2f6502db89a754974ff3f4cc1250b00..740105c8f99d721fc68923e71b303757a5869e00 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create/update/query/erase table for ECC reports\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -15,7 +15,7 @@
 # Import Modules\r
 #\r
 import Common.EdkLogger as EdkLogger\r
-import os, time\r
+import Common.LongFilePathOs as os, time\r
 from Table import Table\r
 from Common.String import ConvertToSqlString2\r
 import Eot.EotToolError as EotToolError\r
index e43802ef25dfdcd8f73d03a094fc7f18ca93f12d..caf749e9d3c5348422771dd37b19914cf0dffc9c 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create/update/query/erase table for files\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -17,7 +17,7 @@
 import Common.EdkLogger as EdkLogger\r
 from Table import Table\r
 from Common.String import ConvertToSqlString\r
-import os\r
+import Common.LongFilePathOs as os\r
 from CommonDataClass.DataClass import FileClass\r
 \r
 ## TableFile\r
index 2e7fd539f7ee7a8d3538585a39de8d77aa941938..4065a43c5b55a4df81a61341bafcdc8d9a8fc90c 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create/update/query/erase table for ECC reports\r
 #\r
-# Copyright (c) 2008 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
 # Import Modules\r
 #\r
 import Common.EdkLogger as EdkLogger\r
-import os, time\r
+import Common.LongFilePathOs as os, time\r
 from Table import Table\r
 from Common.String import ConvertToSqlString2\r
 import EccToolError as EccToolError\r
 import EccGlobalData as EccGlobalData\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## TableReport\r
 #\r
index 8126aac59c09ee61e1c5ca5bd56d4953032406d4..7a366db5fb5693fadbbd989d0ebf0d6721165ec7 100644 (file)
@@ -1,5 +1,5 @@
 #\r
-#  Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -10,7 +10,7 @@
 #  WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 import traceback\r
 from optparse import OptionParser\r
@@ -19,6 +19,7 @@ import Common.EdkLogger as EdkLogger
 import Common.BuildToolError as BuildToolError\r
 from Common.DataType import *\r
 from Common.BuildVersion import gBUILD_VERSION\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 # To Do 1.set clean, 2. add item, if the line is disabled.\r
 \r
index c0ede0335993690727bfef6b4d3fd0edcc96511e..13485c72da51c22e6c12deb51777addcec2da3ae 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # Trim files preprocessed by compiler\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import sys\r
 import re\r
 \r
@@ -24,6 +24,7 @@ from Common.BuildToolError import *
 from Common.Misc import *\r
 from Common.BuildVersion import gBUILD_VERSION\r
 import Common.EdkLogger as EdkLogger\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 # Version and Copyright\r
 __version_number__ = ("0.10" + " " + gBUILD_VERSION)\r
index 7d709d3f0bb7acf60874fc4c07d488794fd43c2b..a95e3f39ab34efe3bf04a36e2ea40bbf8ff9688d 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to define each component of the build database\r
 #\r
-# Copyright (c) 2007 - 2010, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2007 - 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
@@ -11,7 +11,7 @@
 # WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
 #\r
 \r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
 from Common.Misc import sdict\r
 from Common.Misc import RealPath2\r
index 34ef4903df16625d49178a2e11fd52c883e87384..ee4ba6869f8034a8d2cc6b2e2d0ebbc1092865ee 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to create/update/query/erase table for files\r
 #\r
-# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 \r
 import Common.EdkLogger as EdkLogger\r
 from CommonDataClass import DataClass\r
index bc45a66e49e5126d12e1383331351e65d090a1f2..7e6e2db40d3ea66962de4d9974b224ebb2d02732 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # This file is used to parse meta files\r
 #\r
-# Copyright (c) 2008 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2008 - 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
@@ -14,7 +14,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import time\r
 import copy\r
@@ -28,6 +28,7 @@ from Common.String import *
 from Common.Misc import GuidStructureStringToGuidString, CheckPcdDatum, PathClass, AnalyzePcdData, AnalyzeDscPcd\r
 from Common.Expression import *\r
 from CommonDataClass.Exceptions import *\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 from MetaFileTable import MetaFileStorage\r
 \r
index 6ebb7ee87d5e4ed3d264a1da13de76323b341f25..b4109155a63a32d4d8e49786fa2697183227763c 100644 (file)
@@ -15,8 +15,7 @@
 # Import Modules\r
 #\r
 import sqlite3\r
-import os\r
-import os.path\r
+import Common.LongFilePathOs as os\r
 import pickle\r
 import uuid\r
 \r
index 945ee1b573e406ad9960946d7e331ed3ac836546..327d5a53479cf0369316ff3d46042c2cb75759d9 100644 (file)
@@ -4,7 +4,7 @@
 # This module contains the functionality to generate build report after\r
 # build all target completes successfully.\r
 #\r
-# Copyright (c) 2010 - 2012, Intel Corporation. All rights reserved.<BR>\r
+# Copyright (c) 2010 - 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
@@ -16,7 +16,7 @@
 \r
 ## Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import platform\r
 import textwrap\r
@@ -40,6 +40,7 @@ from Common.DataType import TAB_SPACE_SPLIT
 from Common.DataType import TAB_BRG_PCD\r
 from Common.DataType import TAB_BRG_LIBRARY\r
 from Common.DataType import TAB_BACK_SLASH\r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
 \r
 ## Pattern to extract contents in EDK DXS files\r
 gDxsDependencyPattern = re.compile(r"DEPENDENCY_START(.+)DEPENDENCY_END", re.DOTALL)\r
index fca36d18076e0b6db4bf8a382e543c13c54c45e3..bd43f2cff1c73b4a9ea4caa9ad2b9c3aa9083765 100644 (file)
@@ -1,7 +1,7 @@
 ## @file\r
 # build a platform or a module\r
 #\r
-#  Copyright (c) 2007 - 2013, Intel Corporation. All rights reserved.<BR>\r
+#  Copyright (c) 2007 - 2014, Intel Corporation. All rights reserved.<BR>\r
 #\r
 #  This program and the accompanying materials\r
 #  are licensed and made available under the terms and conditions of the BSD License\r
@@ -15,7 +15,7 @@
 ##\r
 # Import Modules\r
 #\r
-import os\r
+import Common.LongFilePathOs as os\r
 import re\r
 import StringIO\r
 import sys\r
@@ -31,6 +31,8 @@ from optparse import OptionParser
 from subprocess import *\r
 from Common import Misc as Utils\r
 \r
+from Common.LongFilePathSupport import OpenLongFilePath as open\r
+from Common.LongFilePathSupport import LongFilePath\r
 from Common.TargetTxtClassObject import *\r
 from Common.ToolDefClassObject import *\r
 from Common.DataType import *\r
@@ -49,7 +51,7 @@ import Common.GlobalData as GlobalData
 # Version and Copyright\r
 VersionNumber = "0.51" + ' ' + gBUILD_VERSION\r
 __version__ = "%prog Version " + VersionNumber\r
-__copyright__ = "Copyright (c) 2007 - 2013, Intel Corporation  All rights reserved."\r
+__copyright__ = "Copyright (c) 2007 - 2014, Intel Corporation  All rights reserved."\r
 \r
 ## standard targets of build command\r
 gSupportedTarget = ['all', 'genc', 'genmake', 'modules', 'libraries', 'fds', 'clean', 'cleanall', 'cleanlib', 'run']\r
@@ -1028,7 +1030,7 @@ class Build():
                 FvMapBuffer = os.path.join(Wa.FvDir, FvName + '.Fv.map')\r
                 if not os.path.exists(FvMapBuffer):\r
                     continue\r
-                FvMap = open (FvMapBuffer, 'r')\r
+                FvMap = open(FvMapBuffer, 'r')\r
                 #skip FV size information\r
                 FvMap.readline()\r
                 FvMap.readline()\r