X-Git-Url: https://git.proxmox.com/?p=mirror_edk2.git;a=blobdiff_plain;f=Nt32Pkg%2FWinNtSimpleFileSystemDxe%2FWinNtSimpleFileSystem.c;fp=Nt32Pkg%2FWinNtSimpleFileSystemDxe%2FWinNtSimpleFileSystem.c;h=6cff2df0530ec0cfcc09c63a4d8a73f981439030;hp=feef184edb2b02d3d5a45811147093e75c9b160e;hb=3643e8e70d3053476aeecd01b3053918f7c74b61;hpb=87c04781d5a7d13ba3cae87daedd52fe71280f3f diff --git a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c index feef184edb..6cff2df053 100644 --- a/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c +++ b/Nt32Pkg/WinNtSimpleFileSystemDxe/WinNtSimpleFileSystem.c @@ -1,6 +1,6 @@ /**@file -Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BSD License which accompanies this distribution. The full text of the license may be found at @@ -1987,8 +1987,19 @@ Returns: CHAR16 *TempPointer; Size = SIZE_OF_EFI_FILE_INFO; - NameSize = StrSize (PrivateFile->FileName); - ResultSize = Size + NameSize; + + RealFileName = PrivateFile->FileName; + TempPointer = RealFileName; + while (*TempPointer) { + if (*TempPointer == '\\') { + RealFileName = TempPointer + 1; + } + + TempPointer++; + } + NameSize = StrSize (RealFileName); + + ResultSize = Size + NameSize; Status = EFI_BUFFER_TOO_SMALL; if (*BufferSize >= ResultSize) { @@ -2056,17 +2067,6 @@ Returns: Info->Attribute |= EFI_FILE_DIRECTORY; } - RealFileName = PrivateFile->FileName; - TempPointer = RealFileName; - - while (*TempPointer) { - if (*TempPointer == '\\') { - RealFileName = TempPointer + 1; - } - - TempPointer++; - } - if (PrivateFile->IsRootDirectory) { *((CHAR8 *) Buffer + Size) = 0; } else {