@@ -82,7 +82,7 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
CacheMaintenanceLib|MdePkg/Library/BaseCacheMaintenanceLib/BaseCacheMaintenanceLib.inf
@@ -391,7 +391,7 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
# MemoryAllocationLib|EmulatorPkg/Library/GuardUefiMemoryAllocationLib/GuardUefiMemoryAllocationLib.inf
# SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf
# SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf
new file mode 100644
@@ -0,0 +1,56 @@
+/** @file
+ Provides interface to path manipulation functions.
+
+ Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
+ 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
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#ifndef _PATH_LIB_
+#define _PATH_LIB_
+
+#include <Base.h>
+#include <Library/BaseMemoryLib.h>
+
+/**
+ Removes the last directory or file entry in a path by changing the last
+ L'\' to a CHAR_NULL.
+
+ @param[in, out] Path The pointer to the path to modify.
+
+ @retval FALSE Nothing was found to remove.
+ @retval TRUE A directory or file was removed.
+**/
+BOOLEAN
+EFIAPI
+PathRemoveLastItem(
+ IN OUT CHAR16 *Path
+ );
+
+/**
+ Function to clean up paths.
+
+ - Single periods in the path are removed.
+ - Double periods in the path are removed along with a single parent directory.
+ - Forward slashes L'/' are converted to backward slashes L'\'.
+
+ This will be done inline and the existing buffer may be larger than required
+ upon completion.
+
+ @param[in] Path The pointer to the string containing the path.
+
+ @retval NULL An error occured.
+ @return Path in all other instances.
+**/
+CHAR16*
+EFIAPI
+PathCleanUpDirectories(
+ IN CHAR16 *Path
+ );
+
+#endif //_PATH_LIB_
new file mode 100644
@@ -0,0 +1,123 @@
+/** @file
+ Provides interface to path manipulation functions.
+
+ Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
+ 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
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+**/
+
+#include <Base.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/PathLib.h>
+#include <Library/BaseLib.h>
+#include <Protocol/SimpleTextIn.h>
+
+/**
+ Removes the last directory or file entry in a path by changing the last
+ L'\' to a CHAR_NULL.
+
+ @param[in, out] Path The pointer to the path to modify.
+
+ @retval FALSE Nothing was found to remove.
+ @retval TRUE A directory or file was removed.
+**/
+BOOLEAN
+EFIAPI
+PathRemoveLastItem(
+ IN OUT CHAR16 *Path
+ )
+{
+ CHAR16 *Walker;
+ CHAR16 *LastSlash;
+ //
+ // get directory name from path... ('chop' off extra)
+ //
+ for ( Walker = Path, LastSlash = NULL
+ ; Walker != NULL && *Walker != CHAR_NULL
+ ; Walker++
+ ){
+ if (*Walker == L'\\' && *(Walker + 1) != CHAR_NULL) {
+ LastSlash = Walker+1;
+ }
+ }
+ if (LastSlash != NULL) {
+ *LastSlash = CHAR_NULL;
+ return (TRUE);
+ }
+ return (FALSE);
+}
+
+/**
+ Function to clean up paths.
+
+ - Single periods in the path are removed.
+ - Double periods in the path are removed along with a single parent directory.
+ - Forward slashes L'/' are converted to backward slashes L'\'.
+
+ This will be done inline and the existing buffer may be larger than required
+ upon completion.
+
+ @param[in] Path The pointer to the string containing the path.
+
+ @retval NULL An error occured.
+ @return Path in all other instances.
+**/
+CHAR16*
+EFIAPI
+PathCleanUpDirectories(
+ IN CHAR16 *Path
+ )
+{
+ CHAR16 *TempString;
+ UINTN TempSize;
+ if (Path==NULL) {
+ return(NULL);
+ }
+
+ //
+ // Fix up the '/' vs '\'
+ //
+ for (TempString = Path ; TempString != NULL && *TempString != CHAR_NULL ; TempString++) {
+ if (*TempString == L'/') {
+ *TempString = L'\\';
+ }
+ }
+
+ //
+ // Fix up the ..
+ //
+ while ((TempString = StrStr(Path, L"\\..\\")) != NULL) {
+ *TempString = CHAR_NULL;
+ TempString += 4;
+ PathRemoveLastItem(Path);
+ TempSize = StrSize(TempString);
+ CopyMem(Path+StrLen(Path), TempString, TempSize);
+ }
+ if ((TempString = StrStr(Path, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) {
+ *TempString = CHAR_NULL;
+ PathRemoveLastItem(Path);
+ }
+
+ //
+ // Fix up the .
+ //
+ while ((TempString = StrStr(Path, L"\\.\\")) != NULL) {
+ *TempString = CHAR_NULL;
+ TempString += 2;
+ TempSize = StrSize(TempString);
+ CopyMem(Path+StrLen(Path), TempString, TempSize);
+ }
+ if ((TempString = StrStr(Path, L"\\.")) != NULL && *(TempString + 2) == CHAR_NULL) {
+ *(TempString + 1) = CHAR_NULL;
+ }
+
+
+
+ return (Path);
+}
+
new file mode 100644
@@ -0,0 +1,38 @@
+## @file
+# Provides interface to path manipulation functions.
+#
+# Copyright (c) 2011, Intel Corporation. All rights reserved. <BR>
+#
+# 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
+# http://opensource.org/licenses/bsd-license.php
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+#
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010006
+ BASE_NAME = BasePathLib
+ FILE_GUID = ED244F93-B97A-4a17-83E0-A03CF2A7F7B4
+ MODULE_TYPE = UEFI_DRIVER
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = PathLib|UEFI_APPLICATION UEFI_DRIVER
+
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[Sources.common]
+ BasePathLib.c
+
+[Packages]
+ MdePkg/MdePkg.dec
+ MdeModulePkg/MdeModulePkg.dec
+
+
+[LibraryClasses]
+ BaseMemoryLib
+ BaseLib
\ No newline at end of file
@@ -538,7 +538,7 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
# SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf
# SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf
@@ -545,7 +545,7 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
# SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf
# SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf
@@ -543,7 +543,7 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
PrintLib|MdePkg/Library/BasePrintLib/BasePrintLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
# SafeBlockIoLib|ShellPkg/Library/SafeBlockIoLib/SafeBlockIoLib.inf
# SafeOpenProtocolLib|ShellPkg/Library/SafeOpenProtocolLib/SafeOpenProtocolLib.inf
deleted file mode 100644
@@ -1,56 +0,0 @@
-/** @file
- Provides interface to path manipulation functions.
-
- Copyright (c) 2011, Intel Corporation. All rights reserved.<BR>
- 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
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#ifndef _PATH_LIB_
-#define _PATH_LIB_
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-
-/**
- Removes the last directory or file entry in a path by changing the last
- L'\' to a CHAR_NULL.
-
- @param[in, out] Path The pointer to the path to modify.
-
- @retval FALSE Nothing was found to remove.
- @retval TRUE A directory or file was removed.
-**/
-BOOLEAN
-EFIAPI
-PathRemoveLastItem(
- IN OUT CHAR16 *Path
- );
-
-/**
- Function to clean up paths.
-
- - Single periods in the path are removed.
- - Double periods in the path are removed along with a single parent directory.
- - Forward slashes L'/' are converted to backward slashes L'\'.
-
- This will be done inline and the existing buffer may be larger than required
- upon completion.
-
- @param[in] Path The pointer to the string containing the path.
-
- @retval NULL An error occured.
- @return Path in all other instances.
-**/
-CHAR16*
-EFIAPI
-PathCleanUpDirectories(
- IN CHAR16 *Path
- );
-
-#endif //_PATH_LIB_
deleted file mode 100644
@@ -1,123 +0,0 @@
-/** @file
- Provides interface to path manipulation functions.
-
- Copyright (c) 2011 - 2014, Intel Corporation. All rights reserved.<BR>
- 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
- http://opensource.org/licenses/bsd-license.php.
-
- THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
- WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-**/
-
-#include <Base.h>
-#include <Library/BaseMemoryLib.h>
-#include <Library/PathLib.h>
-#include <Library/BaseLib.h>
-#include <Protocol/SimpleTextIn.h>
-
-/**
- Removes the last directory or file entry in a path by changing the last
- L'\' to a CHAR_NULL.
-
- @param[in, out] Path The pointer to the path to modify.
-
- @retval FALSE Nothing was found to remove.
- @retval TRUE A directory or file was removed.
-**/
-BOOLEAN
-EFIAPI
-PathRemoveLastItem(
- IN OUT CHAR16 *Path
- )
-{
- CHAR16 *Walker;
- CHAR16 *LastSlash;
- //
- // get directory name from path... ('chop' off extra)
- //
- for ( Walker = Path, LastSlash = NULL
- ; Walker != NULL && *Walker != CHAR_NULL
- ; Walker++
- ){
- if (*Walker == L'\\' && *(Walker + 1) != CHAR_NULL) {
- LastSlash = Walker+1;
- }
- }
- if (LastSlash != NULL) {
- *LastSlash = CHAR_NULL;
- return (TRUE);
- }
- return (FALSE);
-}
-
-/**
- Function to clean up paths.
-
- - Single periods in the path are removed.
- - Double periods in the path are removed along with a single parent directory.
- - Forward slashes L'/' are converted to backward slashes L'\'.
-
- This will be done inline and the existing buffer may be larger than required
- upon completion.
-
- @param[in] Path The pointer to the string containing the path.
-
- @retval NULL An error occured.
- @return Path in all other instances.
-**/
-CHAR16*
-EFIAPI
-PathCleanUpDirectories(
- IN CHAR16 *Path
- )
-{
- CHAR16 *TempString;
- UINTN TempSize;
- if (Path==NULL) {
- return(NULL);
- }
-
- //
- // Fix up the '/' vs '\'
- //
- for (TempString = Path ; TempString != NULL && *TempString != CHAR_NULL ; TempString++) {
- if (*TempString == L'/') {
- *TempString = L'\\';
- }
- }
-
- //
- // Fix up the ..
- //
- while ((TempString = StrStr(Path, L"\\..\\")) != NULL) {
- *TempString = CHAR_NULL;
- TempString += 4;
- PathRemoveLastItem(Path);
- TempSize = StrSize(TempString);
- CopyMem(Path+StrLen(Path), TempString, TempSize);
- }
- if ((TempString = StrStr(Path, L"\\..")) != NULL && *(TempString + 3) == CHAR_NULL) {
- *TempString = CHAR_NULL;
- PathRemoveLastItem(Path);
- }
-
- //
- // Fix up the .
- //
- while ((TempString = StrStr(Path, L"\\.\\")) != NULL) {
- *TempString = CHAR_NULL;
- TempString += 2;
- TempSize = StrSize(TempString);
- CopyMem(Path+StrLen(Path), TempString, TempSize);
- }
- if ((TempString = StrStr(Path, L"\\.")) != NULL && *(TempString + 2) == CHAR_NULL) {
- *(TempString + 1) = CHAR_NULL;
- }
-
-
-
- return (Path);
-}
-
deleted file mode 100644
@@ -1,38 +0,0 @@
-## @file
-# Provides interface to path manipulation functions.
-#
-# Copyright (c) 2011, Intel Corporation. All rights reserved. <BR>
-#
-# 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
-# http://opensource.org/licenses/bsd-license.php
-# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-#
-#
-##
-
-[Defines]
- INF_VERSION = 0x00010006
- BASE_NAME = BasePathLib
- FILE_GUID = ED244F93-B97A-4a17-83E0-A03CF2A7F7B4
- MODULE_TYPE = UEFI_DRIVER
- VERSION_STRING = 1.0
- LIBRARY_CLASS = PathLib|UEFI_APPLICATION UEFI_DRIVER
-
-#
-# VALID_ARCHITECTURES = IA32 X64 IPF EBC
-#
-
-[Sources.common]
- BasePathLib.c
-
-[Packages]
- MdePkg/MdePkg.dec
- ShellPkg/ShellPkg.dec
-
-
-[LibraryClasses]
- BaseMemoryLib
- BaseLib
\ No newline at end of file
@@ -48,7 +48,7 @@
HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
PeCoffGetEntryPointLib|MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
[LibraryClasses.ARM]
#
@@ -82,7 +82,7 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
###################################################################################################
#
@@ -28,7 +28,7 @@
ShellLib|ShellPkg/Library/UefiShellLib/UefiShellLib.inf
FileHandleLib|ShellPkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf
SortLib|ShellPkg/Library/UefiSortLib/UefiSortLib.inf
- PathLib|ShellPkg/Library/BasePathLib/BasePathLib.inf
+ PathLib|MdeModulePkg/Library/BasePathLib/BasePathLib.inf
ShellCEntryLib|ShellPkg/Library/UefiShellCEntryLib/UefiShellCEntryLib.inf
#