diff --git a/xtldr/efiutil.c b/xtldr/efiutil.c index 43aa96b..946deaf 100644 --- a/xtldr/efiutil.c +++ b/xtldr/efiutil.c @@ -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 - * 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 */ -VOID -BlEfiDirectorySeparator(IN OUT PUCHAR Path) +PWCHAR +BlEfiDirectorySeparator(IN PWCHAR Path) { + PWCHAR EfiPath = NULL; + while(*Path) { if(*Path == '/') { - *Path = '\\'; + *EfiPath = '\\'; + } + else + { + *EfiPath = *Path; } Path++; + EfiPath++; } + + return EfiPath; } /** diff --git a/xtldr/includes/xtbl.h b/xtldr/includes/xtbl.h index d1a8f58..6ad4961 100644 --- a/xtldr/includes/xtbl.h +++ b/xtldr/includes/xtbl.h @@ -51,8 +51,8 @@ VOID BlDbgPrint(IN PUINT16 Format, IN ...); -VOID -BlEfiDirectorySeparator(IN OUT PUCHAR Path); +PWCHAR +BlEfiDirectorySeparator(IN PWCHAR Path); INT_PTR BlEfiGetSecureBootStatus();