*/
typedef UCHAR
(NTAPI *PPROCESS_ENTRY_ROUTINE)(
- IN PWCHAR KeyName,
- IN PWCHAR KeyValue,
- OUT PWCHAR DisplayText,
- IN SIZE_T DisplayTextSize,
+ IN PCWSTR KeyName,
+ IN PCWSTR KeyValue,
OUT PVOID* UserData,
OUT PBOOLEAN Current,
IN PVOID Parameter OPTIONAL);
PVOID UserData;
BOOLEAN Current;
UCHAR RetVal;
- WCHAR DisplayText[128];
if (!SetupFindFirstLineW(InfFile, SectionName, NULL, pContext))
return -1;
Current = FALSE;
RetVal = ProcessEntry(KeyName,
KeyValue,
- DisplayText,
- sizeof(DisplayText),
&UserData,
&Current,
Parameter);
}
else if (RetVal == 1)
{
- AppendGenericListEntry(List, DisplayText, UserData, Current);
+ AppendGenericListEntry(List, UserData, Current);
++TotalCount;
}
// else if (RetVal == 2), skip the entry.
static UCHAR
NTAPI
DefaultProcessEntry(
- IN PWCHAR KeyName,
- IN PWCHAR KeyValue,
- OUT PWCHAR DisplayText,
- IN SIZE_T DisplayTextSize,
+ IN PCWSTR KeyName,
+ IN PCWSTR KeyValue,
OUT PVOID* UserData,
OUT PBOOLEAN Current,
IN PVOID Parameter OPTIONAL)
{
PWSTR CompareKey = (PWSTR)Parameter;
- *UserData = RtlAllocateHeap(ProcessHeap, 0,
- (wcslen(KeyName) + 1) * sizeof(WCHAR));
- if (*UserData == NULL)
+ PGENENTRY GenEntry;
+ SIZE_T IdSize, ValueSize;
+
+ IdSize = (wcslen(KeyName) + 1) * sizeof(WCHAR);
+ ValueSize = (wcslen(KeyValue) + 1) * sizeof(WCHAR);
+
+ GenEntry = RtlAllocateHeap(ProcessHeap, 0,
+ sizeof(*GenEntry) + IdSize + ValueSize);
+ if (GenEntry == NULL)
{
/* Failure, stop enumeration */
DPRINT1("RtlAllocateHeap() failed\n");
return 0;
}
- wcscpy((PWCHAR)*UserData, KeyName);
- RtlStringCbCopyW(DisplayText, DisplayTextSize, KeyValue);
+ GenEntry->Id = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry));
+ GenEntry->Value = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry) + IdSize);
+ RtlStringCbCopyW((PWSTR)GenEntry->Id, IdSize, KeyName);
+ RtlStringCbCopyW((PWSTR)GenEntry->Value, ValueSize, KeyValue);
- *Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE);
+ *UserData = GenEntry;
+ *Current = (CompareKey ? !_wcsicmp(KeyName, CompareKey) : FALSE);
/* Add the entry */
return 1;
}
RtlStringCchPrintfW(SectionName, ARRAYSIZE(SectionName),
- L"Files.%s", (PCWSTR)GetListEntryUserData(Entry));
+ L"Files.%s", ((PGENENTRY)GetListEntryData(Entry))->Id);
*AdditionalSectionName = SectionName;
return TRUE;
return FALSE;
}
- if (!SetupFindFirstLineW(InfFile, L"Display", (WCHAR*)GetListEntryUserData(Entry), &Context))
+ if (!SetupFindFirstLineW(InfFile, L"Display",
+ ((PGENENTRY)GetListEntryData(Entry))->Id,
+ &Context))
{
DPRINT1("SetupFindFirstLineW() failed\n");
return FALSE;
IN PGENERIC_LIST List)
{
PGENERIC_LIST_ENTRY Entry;
- PWCHAR LanguageId;
+ PCWSTR LanguageId;
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
UNICODE_STRING ValueName;
if (Entry == NULL)
return FALSE;
- LanguageId = (PWCHAR)GetListEntryUserData(Entry);
+ LanguageId = ((PGENENTRY)GetListEntryData(Entry))->Id;
if (LanguageId == NULL)
return FALSE;
static UCHAR
NTAPI
ProcessLangEntry(
- IN PWCHAR KeyName,
- IN PWCHAR KeyValue,
- OUT PWCHAR DisplayText,
- IN SIZE_T DisplayTextSize,
+ IN PCWSTR KeyName,
+ IN PCWSTR KeyValue,
OUT PVOID* UserData,
OUT PBOOLEAN Current,
IN PVOID Parameter OPTIONAL)
{
PLANG_ENTRY_PARAM LangEntryParam = (PLANG_ENTRY_PARAM)Parameter;
+ PGENENTRY GenEntry;
+ SIZE_T IdSize, ValueSize;
+
if (!IsLanguageAvailable(KeyName))
{
/* The specified language is unavailable, skip the entry */
return 2;
}
- *UserData = RtlAllocateHeap(ProcessHeap, 0,
- (wcslen(KeyName) + 1) * sizeof(WCHAR));
- if (*UserData == NULL)
+ IdSize = (wcslen(KeyName) + 1) * sizeof(WCHAR);
+ ValueSize = (wcslen(KeyValue) + 1) * sizeof(WCHAR);
+
+ GenEntry = RtlAllocateHeap(ProcessHeap, 0,
+ sizeof(*GenEntry) + IdSize + ValueSize);
+ if (GenEntry == NULL)
{
/* Failure, stop enumeration */
DPRINT1("RtlAllocateHeap() failed\n");
return 0;
}
- wcscpy((PWCHAR)*UserData, KeyName);
- RtlStringCbCopyW(DisplayText, DisplayTextSize, KeyValue);
+ GenEntry->Id = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry));
+ GenEntry->Value = (PCWSTR)((ULONG_PTR)GenEntry + sizeof(*GenEntry) + IdSize);
+ RtlStringCbCopyW((PWSTR)GenEntry->Id, IdSize, KeyName);
+ RtlStringCbCopyW((PWSTR)GenEntry->Value, ValueSize, KeyValue);
- *Current = FALSE;
+ *UserData = GenEntry;
+ *Current = FALSE;
if (!_wcsicmp(KeyName, LangEntryParam->DefaultLanguage))
DefaultLanguageIndex = LangEntryParam->uIndex;
{
DefaultLanguageIndex = 0;
wcscpy(DefaultLanguage,
- (PWSTR)GetListEntryUserData(GetFirstListEntry(List)));
+ ((PGENENTRY)GetListEntryData(GetFirstListEntry(List)))->Id);
}
return List;
IN PCWSTR LanguageId)
{
PGENERIC_LIST_ENTRY Entry;
- PWCHAR LayoutId;
+ PCWSTR LayoutId;
const MUI_LAYOUTS* LayoutsList;
MUI_LAYOUTS NewLayoutsList[20];
ULONG uIndex;
if (Entry == NULL)
return FALSE;
- LayoutId = (PWCHAR)GetListEntryUserData(Entry);
+ LayoutId = ((PGENENTRY)GetListEntryData(Entry))->Id;
if (LayoutId == NULL)
return FALSE;
#pragma once
+/* Settings entries with simple 1:1 mapping */
+typedef struct _GENENTRY
+{
+ PCWSTR Id;
+ PCWSTR Value;
+} GENENTRY, *PGENENTRY;
+
PGENERIC_LIST
CreateComputerTypeList(
IN HINF InfFile);
*SetupInf = SetupOpenInfFileExW(FileNameBuffer,
NULL,
- INF_STYLE_WIN4 | INF_STYLE_OLDNT,
+ /* INF_STYLE_WIN4 | */ INF_STYLE_OLDNT,
pSetupData->LanguageId,
&ErrorLine);
InitializeListHead(&List->ListHead);
List->NumOfEntries = 0;
-
List->CurrentEntry = NULL;
- List->BackupEntry = NULL;
return List;
}
VOID
DestroyGenericList(
IN OUT PGENERIC_LIST List,
- IN BOOLEAN FreeUserData)
+ IN BOOLEAN FreeData)
{
PGENERIC_LIST_ENTRY ListEntry;
PLIST_ENTRY Entry;
ListEntry = CONTAINING_RECORD(Entry, GENERIC_LIST_ENTRY, Entry);
/* Release user data */
- if (FreeUserData && ListEntry->UserData != NULL)
- RtlFreeHeap(ProcessHeap, 0, ListEntry->UserData);
+ if (FreeData && ListEntry->Data != NULL)
+ RtlFreeHeap(ProcessHeap, 0, ListEntry->Data);
/* Release list entry */
RtlFreeHeap(ProcessHeap, 0, ListEntry);
BOOLEAN
AppendGenericListEntry(
IN OUT PGENERIC_LIST List,
- IN PCWSTR Text,
- IN PVOID UserData,
+ IN PVOID Data,
IN BOOLEAN Current)
{
PGENERIC_LIST_ENTRY Entry;
- SIZE_T TextSize;
- TextSize = (wcslen(Text) + 1) * sizeof(WCHAR);
- Entry = RtlAllocateHeap(ProcessHeap, 0,
- sizeof(GENERIC_LIST_ENTRY) + TextSize);
+ Entry = RtlAllocateHeap(ProcessHeap, 0, sizeof(GENERIC_LIST_ENTRY));
if (Entry == NULL)
return FALSE;
- RtlStringCbCopyW(Entry->Text, TextSize, Text);
Entry->List = List;
- Entry->UserData = UserData;
+ Entry->Data = Data;
+ Entry->UiData = 0;
InsertTailList(&List->ListHead, &Entry->Entry);
- List->NumOfEntries++;
+ ++List->NumOfEntries;
if (Current || List->CurrentEntry == NULL)
- {
List->CurrentEntry = Entry;
- }
return TRUE;
}
GetFirstListEntry(
IN PGENERIC_LIST List)
{
- PLIST_ENTRY Entry = List->ListHead.Flink;
-
- if (Entry == &List->ListHead)
+ if (IsListEmpty(&List->ListHead))
return NULL;
- return CONTAINING_RECORD(Entry, GENERIC_LIST_ENTRY, Entry);
+
+ return CONTAINING_RECORD(List->ListHead.Flink, GENERIC_LIST_ENTRY, Entry);
}
PGENERIC_LIST_ENTRY
if (Next == &Entry->List->ListHead)
return NULL;
+
return CONTAINING_RECORD(Next, GENERIC_LIST_ENTRY, Entry);
}
PVOID
-GetListEntryUserData(
+GetListEntryData(
IN PGENERIC_LIST_ENTRY Entry)
{
- return Entry->UserData;
+ return Entry->Data;
}
-PCWSTR
-GetListEntryText(
+ULONG_PTR
+GetListEntryUiData(
IN PGENERIC_LIST_ENTRY Entry)
{
- return Entry->Text;
+ return Entry->UiData;
}
ULONG
return List->NumOfEntries;
}
-VOID
-SaveGenericListState(
- IN PGENERIC_LIST List)
-{
- List->BackupEntry = List->CurrentEntry;
-}
-
-VOID
-RestoreGenericListState(
- IN PGENERIC_LIST List)
-{
- List->CurrentEntry = List->BackupEntry;
-}
-
BOOLEAN
GenericListHasSingleEntry(
IN PGENERIC_LIST List)
{
- if (!IsListEmpty(&List->ListHead) && List->ListHead.Flink == List->ListHead.Blink)
- return TRUE;
-
- /* if both list head pointers (which normally point to the first and last list member, respectively)
- point to the same entry then it means that there's just a single thing in there, otherwise... false! */
- return FALSE;
+ /*
+ * If both list head pointers (which normally point to the first and last
+ * list member, respectively) point to the same entry then it means that
+ * there is just a single thing in there, otherwise... false!
+ */
+ return (!IsListEmpty(&List->ListHead) && (List->ListHead.Flink == List->ListHead.Blink));
}
/* EOF */
{
LIST_ENTRY Entry;
struct _GENERIC_LIST* List;
- PVOID UserData;
- WCHAR Text[1]; // FIXME: UI stuff
-
+ PVOID Data;
+ ULONG_PTR UiData; // Cache variable for any UI list that displays these items
} GENERIC_LIST_ENTRY, *PGENERIC_LIST_ENTRY;
typedef struct _GENERIC_LIST
{
LIST_ENTRY ListHead;
ULONG NumOfEntries;
-
PGENERIC_LIST_ENTRY CurrentEntry;
- PGENERIC_LIST_ENTRY BackupEntry;
-
} GENERIC_LIST, *PGENERIC_LIST;
VOID
DestroyGenericList(
IN OUT PGENERIC_LIST List,
- IN BOOLEAN FreeUserData);
+ IN BOOLEAN FreeData);
BOOLEAN
AppendGenericListEntry(
IN OUT PGENERIC_LIST List,
- IN PCWSTR Text,
- IN PVOID UserData,
+ IN PVOID Data,
IN BOOLEAN Current);
VOID
IN PGENERIC_LIST_ENTRY Entry);
PVOID
-GetListEntryUserData(
+GetListEntryData(
IN PGENERIC_LIST_ENTRY Entry);
-PCWSTR
-GetListEntryText(
+ULONG_PTR
+GetListEntryUiData(
IN PGENERIC_LIST_ENTRY Entry);
ULONG
GetNumberOfListEntries(
IN PGENERIC_LIST List);
-VOID
-SaveGenericListState(
- IN PGENERIC_LIST List);
-
-VOID
-RestoreGenericListState(
- IN PGENERIC_LIST List);
-
BOOLEAN
GenericListHasSingleEntry(
IN PGENERIC_LIST List);
UnicodeString.Length = nLength * sizeof(WCHAR);
UnicodeString.MaximumLength = nLength * sizeof(WCHAR);
- UnicodeString.Buffer = (LPWSTR)lpCharacter;
+ UnicodeString.Buffer = (PWSTR)lpCharacter;
OemLength = RtlUnicodeStringToOemSize(&UnicodeString);
VOID
InitGenericListUi(
IN OUT PGENERIC_LIST_UI ListUi,
- IN PGENERIC_LIST List)
+ IN PGENERIC_LIST List,
+ IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc)
{
ListUi->List = List;
ListUi->FirstShown = NULL;
ListUi->LastShown = NULL;
+ ListUi->BackupEntry = NULL;
+
+ ListUi->GetEntryDescriptionProc = GetEntryDescriptionProc;
ListUi->Left = 0;
ListUi->Top = 0;
ListUi->Redraw = TRUE;
ListUi->CurrentItemText[0] = ANSI_NULL;
+
+ /* SaveGenericListUiState(ListUi); */
+ ListUi->BackupEntry = ListUi->List->CurrentEntry;
+}
+
+VOID
+RestoreGenericListUiState(
+ IN PGENERIC_LIST_UI ListUi)
+{
+ ListUi->List->CurrentEntry = ListUi->BackupEntry;
}
static
break;
ListUi->LastShown = Entry;
- sprintf(ListUi->CurrentItemText, "%S", ListEntry->Text);
+ ListUi->CurrentItemText[0] = ANSI_NULL;
+ if (ListUi->GetEntryDescriptionProc)
+ {
+ ListUi->GetEntryDescriptionProc(ListEntry,
+ ListUi->CurrentItemText,
+ ARRAYSIZE(ListUi->CurrentItemText));
+ }
FillConsoleOutputAttribute(StdOutput,
(List->CurrentEntry == ListEntry) ?
DrawScrollBarGenericList(ListUi);
}
+VOID
+DrawGenericListCurrentItem(
+ IN PGENERIC_LIST List,
+ IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc,
+ IN SHORT Left,
+ IN SHORT Top)
+{
+ //
+ // FIXME: That stuff crashes when the list is empty!!
+ //
+ CHAR CurrentItemText[256];
+ if (GetEntryDescriptionProc)
+ {
+ GetEntryDescriptionProc(GetCurrentListEntry(List),
+ CurrentItemText,
+ ARRAYSIZE(CurrentItemText));
+ CONSOLE_SetTextXY(Left, Top, CurrentItemText);
+ }
+}
+
VOID
ScrollDownGenericList(
IN PGENERIC_LIST_UI ListUi)
ListUi->Redraw = FALSE;
- sprintf(ListUi->CurrentItemText, "%S", ListEntry->Text);
+ ListUi->CurrentItemText[0] = ANSI_NULL;
+ if (ListUi->GetEntryDescriptionProc)
+ {
+ ListUi->GetEntryDescriptionProc(ListEntry,
+ ListUi->CurrentItemText,
+ ARRAYSIZE(ListUi->CurrentItemText));
+ }
if ((strlen(ListUi->CurrentItemText) > 0) && (tolower(ListUi->CurrentItemText[0]) == AsciiChar) &&
(List->CurrentEntry->Entry.Flink != &List->ListHead))
ScrollDownGenericList(ListUi);
ListEntry = List->CurrentEntry;
- sprintf(ListUi->CurrentItemText, "%S", ListEntry->Text);
+ ListUi->CurrentItemText[0] = ANSI_NULL;
+ if (ListUi->GetEntryDescriptionProc)
+ {
+ ListUi->GetEntryDescriptionProc(ListEntry,
+ ListUi->CurrentItemText,
+ ARRAYSIZE(ListUi->CurrentItemText));
+ }
if ((strlen(ListUi->CurrentItemText) > 0) && (tolower(ListUi->CurrentItemText[0]) == AsciiChar))
goto End;
for (;;)
{
- sprintf(ListUi->CurrentItemText, "%S", ListEntry->Text);
+ ListUi->CurrentItemText[0] = ANSI_NULL;
+ if (ListUi->GetEntryDescriptionProc)
+ {
+ ListUi->GetEntryDescriptionProc(ListEntry,
+ ListUi->CurrentItemText,
+ ARRAYSIZE(ListUi->CurrentItemText));
+ }
if ((strlen(ListUi->CurrentItemText) > 0) && (tolower(ListUi->CurrentItemText[0]) == AsciiChar))
{
// #include "../lib/utils/genlist.h"
+typedef NTSTATUS
+(NTAPI *PGET_ENTRY_DESCRIPTION)(
+ IN PGENERIC_LIST_ENTRY Entry,
+ OUT PSTR Buffer,
+ IN SIZE_T cchBufferSize);
+
typedef struct _GENERIC_LIST_UI
{
PGENERIC_LIST List;
PLIST_ENTRY FirstShown;
PLIST_ENTRY LastShown;
+ PGENERIC_LIST_ENTRY BackupEntry;
+
+ PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc;
SHORT Left;
SHORT Top;
VOID
InitGenericListUi(
IN OUT PGENERIC_LIST_UI ListUi,
- IN PGENERIC_LIST List);
+ IN PGENERIC_LIST List,
+ IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc);
+
+VOID
+RestoreGenericListUiState(
+ IN PGENERIC_LIST_UI ListUi);
VOID
DrawGenericList(
IN SHORT Right,
IN SHORT Bottom);
+VOID
+DrawGenericListCurrentItem(
+ IN PGENERIC_LIST List,
+ IN PGET_ENTRY_DESCRIPTION GetEntryDescriptionProc,
+ IN SHORT Left,
+ IN SHORT Top);
+
VOID
ScrollDownGenericList(
IN PGENERIC_LIST_UI ListUi);
/* OTHER Stuff *****/
-PWCHAR SelectedLanguageId;
+PCWSTR SelectedLanguageId;
static WCHAR DefaultLanguage[20]; // Copy of string inside LanguageList
static WCHAR DefaultKBLayout[20]; // Copy of string inside KeyboardList
}
}
- ListEntry = GetFirstListEntry(LayoutList);
-
/* Search for default layout (if provided) */
if (pszNewLayout != NULL)
{
- while (ListEntry != NULL)
+ for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
+ ListEntry = GetNextListEntry(ListEntry))
{
- if (!wcscmp(pszNewLayout, GetListEntryUserData(ListEntry)))
+ if (!wcscmp(pszNewLayout, ((PGENENTRY)GetListEntryData(ListEntry))->Id))
{
SetCurrentListEntry(LayoutList, ListEntry);
break;
}
-
- ListEntry = GetNextListEntry(ListEntry);
}
}
}
+static NTSTATUS
+NTAPI
+GetSettingDescription(
+ IN PGENERIC_LIST_ENTRY Entry,
+ OUT PSTR Buffer,
+ IN SIZE_T cchBufferSize)
+{
+ return RtlStringCchPrintfA(Buffer, cchBufferSize, "%S",
+ ((PGENENTRY)GetListEntryData(Entry))->Value);
+}
+
+static NTSTATUS
+NTAPI
+GetNTOSInstallationName(
+ IN PGENERIC_LIST_ENTRY Entry,
+ OUT PSTR Buffer,
+ IN SIZE_T cchBufferSize)
+{
+ PNTOS_INSTALLATION NtOsInstall = (PNTOS_INSTALLATION)GetListEntryData(Entry);
+ PPARTENTRY PartEntry = NtOsInstall->PartEntry;
+
+ if (PartEntry && PartEntry->DriveLetter)
+ {
+ /* We have retrieved a partition that is mounted */
+ return RtlStringCchPrintfA(Buffer, cchBufferSize,
+ "%c:%S \"%S\"",
+ PartEntry->DriveLetter,
+ NtOsInstall->PathComponent,
+ NtOsInstall->InstallationName);
+ }
+ else
+ {
+ /* We failed somewhere, just show the NT path */
+ return RtlStringCchPrintfA(Buffer, cchBufferSize,
+ "%wZ \"%S\"",
+ &NtOsInstall->SystemNtPath,
+ NtOsInstall->InstallationName);
+ }
+}
+
+
/*
* Displays the LanguagePage.
*
LanguagePage(PINPUT_RECORD Ir)
{
GENERIC_LIST_UI ListUi;
- PWCHAR NewLanguageId;
+ PCWSTR NewLanguageId;
BOOL RefreshPage = FALSE;
/* Initialize the computer settings list */
return WELCOME_PAGE;
}
- InitGenericListUi(&ListUi, LanguageList);
+ InitGenericListUi(&ListUi, LanguageList, GetSettingDescription);
DrawGenericList(&ListUi,
- 2,
- 18,
+ 2, 18,
xScreen - 3,
yScreen - 3);
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
{
- SelectedLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
+ //
+ // FIXME: That stuff crashes when the list is empty!!
+ //
+ SelectedLanguageId =
+ ((PGENENTRY)GetListEntryData(GetCurrentListEntry(LanguageList)))->Id;
USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
if (RefreshPage)
{
- NewLanguageId = (PWCHAR)GetListEntryUserData(GetCurrentListEntry(LanguageList));
+ //
+ // FIXME: That stuff crashes when the list is empty!!
+ //
+ NewLanguageId =
+ ((PGENENTRY)GetListEntryData(GetCurrentListEntry(LanguageList)))->Id;
if (wcscmp(SelectedLanguageId, NewLanguageId))
{
NTSTATUS Status;
ULONG Error;
PGENERIC_LIST_ENTRY ListEntry;
+ PCWSTR LocaleId;
CONSOLE_SetStatusText(MUIGetString(STRING_PLEASEWAIT));
if (IsUnattendedSetup)
{
// TODO: Read options from inf
+ /* Load the hardware, language and keyboard layout lists */
+
ComputerList = CreateComputerTypeList(SetupInf);
DisplayList = CreateDisplayDriverList(SetupInf);
KeyboardList = CreateKeyboardDriverList(SetupInf);
/* new part */
SelectedLanguageId = DefaultLanguage;
- wcscpy(SelectedLanguageId, USetupData.LocaleID);
+ wcscpy(DefaultLanguage, USetupData.LocaleID);
USetupData.LanguageId = (LANGID)(wcstol(SelectedLanguageId, NULL, 16) & 0xFFFF);
LayoutList = CreateKeyboardLayoutList(SetupInf, SelectedLanguageId, DefaultKBLayout);
/* first we hack LanguageList */
- ListEntry = GetFirstListEntry(LanguageList);
- while (ListEntry != NULL)
+ for (ListEntry = GetFirstListEntry(LanguageList); ListEntry;
+ ListEntry = GetNextListEntry(ListEntry))
{
- if (!wcsicmp(USetupData.LocaleID, GetListEntryUserData(ListEntry)))
+ LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
+ if (!wcsicmp(USetupData.LocaleID, LocaleId))
{
- DPRINT("found %S in LanguageList\n",GetListEntryUserData(ListEntry));
+ DPRINT("found %S in LanguageList\n", LocaleId);
SetCurrentListEntry(LanguageList, ListEntry);
break;
}
-
- ListEntry = GetNextListEntry(ListEntry);
}
/* now LayoutList */
- ListEntry = GetFirstListEntry(LayoutList);
- while (ListEntry != NULL)
+ for (ListEntry = GetFirstListEntry(LayoutList); ListEntry;
+ ListEntry = GetNextListEntry(ListEntry))
{
- if (!wcsicmp(USetupData.LocaleID, GetListEntryUserData(ListEntry)))
+ LocaleId = ((PGENENTRY)GetListEntryData(ListEntry))->Id;
+ if (!wcsicmp(USetupData.LocaleID, LocaleId))
{
- DPRINT("found %S in LayoutList\n",GetListEntryUserData(ListEntry));
+ DPRINT("found %S in LayoutList\n", LocaleId);
SetCurrentListEntry(LayoutList, ListEntry);
break;
}
-
- ListEntry = GetNextListEntry(ListEntry);
}
SetConsoleCodePage();
MUIDisplayPage(UPGRADE_REPAIR_PAGE);
- InitGenericListUi(&ListUi, NtOsInstallsList);
+ InitGenericListUi(&ListUi, NtOsInstallsList, GetNTOSInstallationName);
DrawGenericList(&ListUi,
2, 23,
xScreen - 3,
yScreen - 3);
- SaveGenericListState(NtOsInstallsList);
-
// return HandleGenericList(&ListUi, DEVICE_SETTINGS_PAGE, Ir);
while (TRUE)
{
}
case VK_ESCAPE: /* ESC */
{
- RestoreGenericListState(NtOsInstallsList);
+ RestoreGenericListUiState(&ListUi);
// return nextPage; // prevPage;
// return INSTALL_INTRO_PAGE;
if (toupper(Ir->Event.KeyEvent.uChar.AsciiChar) == 'U') /* U */
{
/* Retrieve the current installation */
- CurrentInstallation = (PNTOS_INSTALLATION)GetListEntryUserData(GetCurrentListEntry(NtOsInstallsList));
+ //
+ // FIXME: That stuff crashes when the list is empty!!
+ //
+ CurrentInstallation =
+ (PNTOS_INSTALLATION)GetListEntryData(GetCurrentListEntry(NtOsInstallsList));
+
DPRINT1("Selected installation for repair: \"%S\" ; DiskNumber = %d , PartitionNumber = %d\n",
CurrentInstallation->InstallationName, CurrentInstallation->DiskNumber, CurrentInstallation->PartitionNumber);
DeviceSettingsPage(PINPUT_RECORD Ir)
{
static ULONG Line = 16;
- CHAR CurrentItemText[256];
/* Initialize the computer settings list */
if (ComputerList == NULL)
MUIDisplayPage(DEVICE_SETTINGS_PAGE);
- 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);
+ DrawGenericListCurrentItem(ComputerList, GetSettingDescription, 25, 11);
+ DrawGenericListCurrentItem(DisplayList , GetSettingDescription, 25, 12);
+ DrawGenericListCurrentItem(KeyboardList, GetSettingDescription, 25, 13);
+ DrawGenericListCurrentItem(LayoutList , GetSettingDescription, 25, 14);
CONSOLE_InvertTextXY(24, Line, 48, 1);
else if ((Ir->Event.KeyEvent.uChar.AsciiChar == 0x00) &&
(Ir->Event.KeyEvent.wVirtualKeyCode == VK_ESCAPE)) /* ESC */
{
- RestoreGenericListState(ListUi->List);
+ RestoreGenericListUiState(ListUi);
return nextPage; // Use some "prevPage;" instead?
}
else if (Ir->Event.KeyEvent.uChar.AsciiChar == 0x0D) /* ENTER */
GENERIC_LIST_UI ListUi;
MUIDisplayPage(COMPUTER_SETTINGS_PAGE);
- InitGenericListUi(&ListUi, ComputerList);
+ InitGenericListUi(&ListUi, ComputerList, GetSettingDescription);
DrawGenericList(&ListUi,
- 2,
- 18,
+ 2, 18,
xScreen - 3,
yScreen - 3);
- SaveGenericListState(ComputerList);
-
return HandleGenericList(&ListUi, DEVICE_SETTINGS_PAGE, Ir);
}
GENERIC_LIST_UI ListUi;
MUIDisplayPage(DISPLAY_SETTINGS_PAGE);
- InitGenericListUi(&ListUi, DisplayList);
+ InitGenericListUi(&ListUi, DisplayList, GetSettingDescription);
DrawGenericList(&ListUi,
- 2,
- 18,
+ 2, 18,
xScreen - 3,
yScreen - 3);
- SaveGenericListState(DisplayList);
-
return HandleGenericList(&ListUi, DEVICE_SETTINGS_PAGE, Ir);
}
GENERIC_LIST_UI ListUi;
MUIDisplayPage(KEYBOARD_SETTINGS_PAGE);
- InitGenericListUi(&ListUi, KeyboardList);
+ InitGenericListUi(&ListUi, KeyboardList, GetSettingDescription);
DrawGenericList(&ListUi,
- 2,
- 18,
+ 2, 18,
xScreen - 3,
yScreen - 3);
- SaveGenericListState(KeyboardList);
-
return HandleGenericList(&ListUi, DEVICE_SETTINGS_PAGE, Ir);
}
GENERIC_LIST_UI ListUi;
MUIDisplayPage(LAYOUT_SETTINGS_PAGE);
- InitGenericListUi(&ListUi, LayoutList);
+ InitGenericListUi(&ListUi, LayoutList, GetSettingDescription);
DrawGenericList(&ListUi,
- 2,
- 18,
+ 2, 18,
xScreen - 3,
yScreen - 3);
- SaveGenericListState(LayoutList);
-
return HandleGenericList(&ListUi, DEVICE_SETTINGS_PAGE, Ir);
}
extern HANDLE ProcessHeap;
extern BOOLEAN IsUnattendedSetup;
-extern PWCHAR SelectedLanguageId;
+extern PCWSTR SelectedLanguageId;
typedef enum _PAGE_NUMBER
{