INT IntValue;
PWCHAR Value;
- if (DoesFileExist(NULL, SourcePath.Buffer, L"unattend.inf") == FALSE)
+ CombinePaths(UnattendInfPath, ARRAYSIZE(UnattendInfPath), 2, SourcePath.Buffer, L"\\unattend.inf");
+
+ if (DoesFileExist(NULL, NULL, UnattendInfPath) == FALSE)
{
- DPRINT("Does not exist: %S\\%S\n", SourcePath.Buffer, L"unattend.inf");
+ DPRINT("Does not exist: %S\n", UnattendInfPath);
return;
}
- wcscpy(UnattendInfPath, SourcePath.Buffer);
- wcscat(UnattendInfPath, L"\\unattend.inf");
-
/* Load 'unattend.inf' from install media. */
UnattendInf = SetupOpenInfFileW(UnattendInfPath,
NULL,
return;
}
- UnattendDestinationPartitionNumber = IntValue;
+ UnattendDestinationPartitionNumber = (LONG)IntValue;
/* Search for 'InstallationDirectory' in the 'Unattend' section */
if (!SetupFindFirstLineW(UnattendInf, L"Unattend", L"InstallationDirectory", &Context))
#endif
/* Load txtsetup.sif from install media. */
- wcscpy(FileNameBuffer, SourcePath.Buffer);
- wcscat(FileNameBuffer, L"\\txtsetup.sif");
-
+ CombinePaths(FileNameBuffer, ARRAYSIZE(FileNameBuffer), 2, SourcePath.Buffer, L"\\txtsetup.sif");
SetupInf = SetupOpenInfFileW(FileNameBuffer,
NULL,
INF_STYLE_WIN4,
return HandleGenericList(&ListUi, DEVICE_SETTINGS_PAGE, Ir);
}
-
-
+
+
/*
* Displays the DisplaySettingsPage.
*
/* Create 'DestinationPath' string */
RtlFreeUnicodeString(&DestinationPath);
- wcscpy(PathBuffer, DestinationRootPath.Buffer);
-
- if (InstallDir[0] != L'\\')
- wcscat(PathBuffer, L"\\");
-
- wcscat(PathBuffer, InstallDir);
+ CombinePaths(PathBuffer, ARRAYSIZE(PathBuffer), 2,
+ DestinationRootPath.Buffer, InstallDir);
RtlCreateUnicodeString(&DestinationPath, PathBuffer);
/* Create 'DestinationArcPath' */
L"multi(0)disk(0)rdisk(%lu)partition(%lu)",
DiskEntry->BiosDiskNumber,
PartEntry->PartitionNumber);
-
- if (InstallDir[0] != L'\\')
- wcscat(PathBuffer, L"\\");
-
- wcscat(PathBuffer, InstallDir);
+ ConcatPaths(PathBuffer, ARRAYSIZE(PathBuffer), 1, InstallDir);
RtlCreateUnicodeString(&DestinationArcPath, PathBuffer);
}
break;
}
- if ((DirKeyValue[0] == 0) || (DirKeyValue[0] == L'\\' && DirKeyValue[1] == 0))
+ if ((DirKeyValue[0] == UNICODE_NULL) || (DirKeyValue[0] == L'\\' && DirKeyValue[1] == UNICODE_NULL))
{
/* Installation path */
wcscpy(CompleteOrigDirName, SourceRootDir.Buffer);
else // if (DirKeyValue[0] != L'\\')
{
/* Path relative to the installation path */
- wcscpy(CompleteOrigDirName, SourceRootDir.Buffer);
- wcscat(CompleteOrigDirName, L"\\");
- wcscat(CompleteOrigDirName, DirKeyValue);
+ CombinePaths(CompleteOrigDirName, ARRAYSIZE(CompleteOrigDirName), 2,
+ SourceRootDir.Buffer, DirKeyValue);
}
/* Remove trailing backslash */
Length = wcslen(CompleteOrigDirName);
if ((Length > 0) && (CompleteOrigDirName[Length - 1] == L'\\'))
{
- CompleteOrigDirName[Length - 1] = 0;
+ CompleteOrigDirName[Length - 1] = UNICODE_NULL;
}
if (!SetupQueueCopy(SetupFileQueue,
Length = wcslen(PathBuffer);
if ((Length > 0) && (PathBuffer[Length - 1] == L'\\'))
{
- PathBuffer[Length - 1] = 0;
+ PathBuffer[Length - 1] = UNICODE_NULL;
}
/* Create the install directory */
break;
}
- if ((DirKeyValue[0] == 0) || (DirKeyValue[0] == L'\\' && DirKeyValue[1] == 0))
+ if ((DirKeyValue[0] == UNICODE_NULL) || (DirKeyValue[0] == L'\\' && DirKeyValue[1] == UNICODE_NULL))
{
/* Installation path */
DPRINT("InstallationPath: '%S'\n", DirKeyValue);
/* Absolute path */
DPRINT("Absolute Path: '%S'\n", DirKeyValue);
- wcscpy(PathBuffer, DestinationRootPath.Buffer);
- wcscat(PathBuffer, DirKeyValue);
+ CombinePaths(PathBuffer, ARRAYSIZE(PathBuffer), 2,
+ DestinationRootPath.Buffer, DirKeyValue);
/* Remove trailing backslash */
Length = wcslen(PathBuffer);
if ((Length > 0) && (PathBuffer[Length - 1] == L'\\'))
{
- PathBuffer[Length - 1] = 0;
+ PathBuffer[Length - 1] = UNICODE_NULL;
}
DPRINT("FullPath: '%S'\n", PathBuffer);
/* Path relative to the installation path */
DPRINT("RelativePath: '%S'\n", DirKeyValue);
- wcscpy(PathBuffer, DestinationPath.Buffer);
- wcscat(PathBuffer, L"\\");
- wcscat(PathBuffer, DirKeyValue);
+ CombinePaths(PathBuffer, ARRAYSIZE(PathBuffer), 2,
+ DestinationPath.Buffer, DirKeyValue);
/* Remove trailing backslash */
Length = wcslen(PathBuffer);
if ((Length > 0) && (PathBuffer[Length - 1] == L'\\'))
{
- PathBuffer[Length - 1] = 0;
+ PathBuffer[Length - 1] = UNICODE_NULL;
}
DPRINT("FullPath: '%S'\n", PathBuffer);
if (!INF_GetData(&CabinetsContext, NULL, &KeyValue))
break;
- wcscpy(PathBuffer, SourcePath.Buffer);
- wcscat(PathBuffer, L"\\");
- wcscat(PathBuffer, KeyValue);
+ CombinePaths(PathBuffer, ARRAYSIZE(PathBuffer), 2,
+ SourcePath.Buffer, KeyValue);
CabinetInitialize();
CabinetSetEventHandlers(NULL, NULL, NULL);
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
- if (DoesFileExist(NULL, L"\\Device\\Floppy0", L"\\") == FALSE)
+ if (DoesPathExist(NULL, L"\\Device\\Floppy0\\") == FALSE)
{
MUIDisplayError(ERROR_NO_FLOPPY, Ir, POPUP_WAIT_ENTER);
return BOOT_LOADER_FLOPPY_PAGE;
L"\\Device\\Harddisk%d\\Partition0",
PartitionList->SystemPartition->DiskEntry->DiskNumber);
- wcscpy(SourceMbrPathBuffer, SourceRootPath.Buffer);
- wcscat(SourceMbrPathBuffer, L"\\loader\\dosmbr.bin");
+ CombinePaths(SourceMbrPathBuffer, ARRAYSIZE(SourceMbrPathBuffer), 2, SourceRootPath.Buffer, L"\\loader\\dosmbr.bin");
if (IsThereAValidBootSector(DestinationDevicePathBuffer))
{
/* Save current MBR */
- wcscpy(DstPath, SystemRootPath.Buffer);
- wcscat(DstPath, L"\\mbr.old");
+ CombinePaths(DstPath, ARRAYSIZE(DstPath), 2, SystemRootPath.Buffer, L"\\mbr.old");
DPRINT1("Save MBR: %S ==> %S\n", DestinationDevicePathBuffer, DstPath);
Status = SaveBootSector(DestinationDevicePathBuffer, DstPath, sizeof(PARTITION_SECTOR));