Rework BlEfiDirectorySeparator(), now it operates on wide strings

This commit is contained in:
Rafal Kupiec 2022-10-26 22:11:42 +02:00
parent 30bc0c3cb7
commit c09b121178
Signed by: belliash
GPG Key ID: 4E829243E0CFE6B4
2 changed files with 17 additions and 8 deletions

View File

@ -163,26 +163,35 @@ BlDbgPrint(IN PUINT16 Format,
} }
/** /**
* Replaces slashes (/) with backslashes (\) in the input string. * Replaces slashes (/) with backslashes (\) in the string containing on-disk path.
* *
* @param Path * @param Path
* A pointer to the string containing a system path, where directory separator will get replaced. * A pointer to the string containing an original system path.
* *
* @return This routine does not return any value. * @return A pointer to converted string with EFI supported path separators.
* *
* @since XT 1.0 * @since XT 1.0
*/ */
VOID PWCHAR
BlEfiDirectorySeparator(IN OUT PUCHAR Path) BlEfiDirectorySeparator(IN PWCHAR Path)
{ {
PWCHAR EfiPath = NULL;
while(*Path) while(*Path)
{ {
if(*Path == '/') if(*Path == '/')
{ {
*Path = '\\'; *EfiPath = '\\';
}
else
{
*EfiPath = *Path;
} }
Path++; Path++;
EfiPath++;
} }
return EfiPath;
} }
/** /**

View File

@ -51,8 +51,8 @@ VOID
BlDbgPrint(IN PUINT16 Format, BlDbgPrint(IN PUINT16 Format,
IN ...); IN ...);
VOID PWCHAR
BlEfiDirectorySeparator(IN OUT PUCHAR Path); BlEfiDirectorySeparator(IN PWCHAR Path);
INT_PTR INT_PTR
BlEfiGetSecureBootStatus(); BlEfiGetSecureBootStatus();