]> git.proxmox.com Git - mirror_edk2.git/blobdiff - BaseTools/Source/C/GnuGenBootSector/GnuGenBootSector.c
There is a limitation on WINDOWS OS for the length of entire file path can’t be large...
[mirror_edk2.git] / BaseTools / Source / C / GnuGenBootSector / GnuGenBootSector.c
index b0ec271b0522b90301fb4a7579b36d811e1abf7b..f9869c44418199ff30380acc5c4364c5f7df2db9 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
 /** @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
 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
     }  \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
     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
   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
     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
   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
   if (InputFile == NULL) {\r
     return ErrorFileReadWrite;\r
   }\r
@@ -235,9 +235,9 @@ ProcessBsOrMbr (
   } \r
   \r
   //Process Floppy Disk\r
   } \r
   \r
   //Process Floppy Disk\r
-  OutputFile = fopen(OutputInfo->PhysicalPath, "r+");\r
+  OutputFile = fopen (LongFilePath (OutputInfo->PhysicalPath), "r+");\r
   if (OutputFile == NULL) {\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
     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
   )\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
 }\r
 \r
 \r