#define NDEBUG
#include <debug.h>
-// HACK!
-#include <strsafe.h>
-
/* GLOBALS & LOCALS *********************************************************/
DeviceSettingsPage(PINPUT_RECORD Ir)
{
static ULONG Line = 16;
+ CHAR CurrentItemText[256];
/* Initialize the computer settings list */
if (ComputerList == NULL)
MUIDisplayPage(DEVICE_SETTINGS_PAGE);
- CONSOLE_SetTextXY(25, 11, GetListEntryText(GetCurrentListEntry(ComputerList)));
- CONSOLE_SetTextXY(25, 12, GetListEntryText(GetCurrentListEntry(DisplayList)));
- CONSOLE_SetTextXY(25, 13, GetListEntryText(GetCurrentListEntry(KeyboardList)));
- CONSOLE_SetTextXY(25, 14, GetListEntryText(GetCurrentListEntry(LayoutList)));
+ sprintf(CurrentItemText, "%S", GetListEntryText(GetCurrentListEntry(ComputerList)));
+ CONSOLE_SetTextXY(25, 11, CurrentItemText);
+ sprintf(CurrentItemText, "%S", GetListEntryText(GetCurrentListEntry(DisplayList)));
+ CONSOLE_SetTextXY(25, 12, CurrentItemText);
+ sprintf(CurrentItemText, "%S", GetListEntryText(GetCurrentListEntry(KeyboardList)));
+ CONSOLE_SetTextXY(25, 13, CurrentItemText);
+ sprintf(CurrentItemText, "%S", GetListEntryText(GetCurrentListEntry(LayoutList)));
+ CONSOLE_SetTextXY(25, 14, CurrentItemText);
CONSOLE_InvertTextXY(24, Line, 48, 1);
return SELECT_PARTITION_PAGE;
}
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
L"\\Device\\Harddisk%lu\\Partition%lu\\",
PartitionList->CurrentDisk->DiskNumber,
PartitionList->CurrentPartition->PartitionNumber);
}
/* Set PartitionRootPath */
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
L"\\Device\\Harddisk%lu\\Partition%lu",
DiskEntry->DiskNumber,
PartEntry->PartitionNumber);
}
/* Set PartitionRootPath */
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
L"\\Device\\Harddisk%lu\\Partition%lu",
DiskEntry->DiskNumber,
PartEntry->PartitionNumber);
/* Create 'USetupData.DestinationRootPath' string */
RtlFreeUnicodeString(&USetupData.DestinationRootPath);
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
L"\\Device\\Harddisk%lu\\Partition%lu\\",
DiskEntry->DiskNumber,
PartEntry->PartitionNumber);
/** Equivalent of 'NTOS_INSTALLATION::SystemArcPath' **/
/* Create 'USetupData.DestinationArcPath' */
RtlFreeUnicodeString(&USetupData.DestinationArcPath);
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
L"multi(0)disk(0)rdisk(%lu)partition(%lu)\\",
DiskEntry->BiosDiskNumber,
PartEntry->PartitionNumber);
/* Installation path */
DPRINT("InstallationPath: '%S'\n", DirKeyValue);
- StringCchCopyW(CompleteOrigDirName, ARRAYSIZE(CompleteOrigDirName),
- USetupData.SourceRootDir.Buffer);
+ RtlStringCchCopyW(CompleteOrigDirName, ARRAYSIZE(CompleteOrigDirName),
+ USetupData.SourceRootDir.Buffer);
DPRINT("InstallationPath(2): '%S'\n", CompleteOrigDirName);
}
/* Absolute path */
DPRINT("AbsolutePath: '%S'\n", DirKeyValue);
- StringCchCopyW(CompleteOrigDirName, ARRAYSIZE(CompleteOrigDirName),
- DirKeyValue);
+ RtlStringCchCopyW(CompleteOrigDirName, ARRAYSIZE(CompleteOrigDirName),
+ DirKeyValue);
DPRINT("AbsolutePath(2): '%S'\n", CompleteOrigDirName);
}
*/
/* Get destination path */
- StringCchCopyW(PathBuffer, ARRAYSIZE(PathBuffer), USetupData.DestinationPath.Buffer);
+ RtlStringCchCopyW(PathBuffer, ARRAYSIZE(PathBuffer), USetupData.DestinationPath.Buffer);
DPRINT("FullPath(1): '%S'\n", PathBuffer);
/* Installation path */
DPRINT("InstallationPath: '%S'\n", DirKeyValue);
- StringCchCopyW(PathBuffer, ARRAYSIZE(PathBuffer),
- USetupData.DestinationPath.Buffer);
+ RtlStringCchCopyW(PathBuffer, ARRAYSIZE(PathBuffer),
+ USetupData.DestinationPath.Buffer);
DPRINT("InstallationPath(2): '%S'\n", PathBuffer);
}
/* See the explanation for this test above */
/* Update display registry settings */
- CONSOLE_SetStatusText(MUIGetString(STRING_DISPLAYETTINGSUPDATE));
+ CONSOLE_SetStatusText(MUIGetString(STRING_DISPLAYSETTINGSUPDATE));
if (!ProcessDisplayRegistry(SetupInf, DisplayList))
{
MUIDisplayError(ERROR_UPDATE_DISPLAY_SETTINGS, Ir, POPUP_WAIT_ENTER);
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
RtlFreeUnicodeString(&USetupData.SystemRootPath);
- StringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
+ RtlStringCchPrintfW(PathBuffer, ARRAYSIZE(PathBuffer),
L"\\Device\\Harddisk%lu\\Partition%lu\\",
PartitionList->SystemPartition->DiskEntry->DiskNumber,
PartitionList->SystemPartition->PartitionNumber);
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
- if (DoesDirExist(NULL, L"\\Device\\Floppy0\\") == FALSE)
- {
- MUIDisplayError(ERROR_NO_FLOPPY, Ir, POPUP_WAIT_ENTER);
- return BOOT_LOADER_FLOPPY_PAGE;
- }
-
- Status = InstallFatBootcodeToFloppy(&USetupData.SourceRootPath, &USetupData.DestinationArcPath);
+ Status = InstallFatBootcodeToFloppy(&USetupData.SourceRootPath,
+ &USetupData.DestinationArcPath);
if (!NT_SUCCESS(Status))
{
- /* Print error message */
+ if (Status == STATUS_DEVICE_NOT_READY)
+ MUIDisplayError(ERROR_NO_FLOPPY, Ir, POPUP_WAIT_ENTER);
+
+ /* TODO: Print error message */
return BOOT_LOADER_FLOPPY_PAGE;
}
}
/* Step 2: Write the MBR */
- StringCchPrintfW(DestinationDevicePathBuffer, ARRAYSIZE(DestinationDevicePathBuffer),
+ RtlStringCchPrintfW(DestinationDevicePathBuffer, ARRAYSIZE(DestinationDevicePathBuffer),
L"\\Device\\Harddisk%d\\Partition0",
PartitionList->SystemPartition->DiskEntry->DiskNumber);
Status = InstallMbrBootCodeToDisk(&USetupData.SystemRootPath,
DestinationDevicePathBuffer);
if (!NT_SUCCESS(Status))
{
- DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n",
- Status);
+ DPRINT1("InstallMbrBootCodeToDisk() failed (Status %lx)\n", Status);
MUIDisplayError(ERROR_INSTALL_BOOTCODE, Ir, POPUP_WAIT_ENTER);
return QUIT_PAGE;
}