Author: hbelusca
Date: Thu Aug 31 18:27:07 2017
New Revision: 75720
URL:
http://svn.reactos.org/svn/reactos?rev=75720&view=rev
Log:
[SETUPLIB]: Change some function prototypes so that the usetup-specific
"SelectedLanguageId" variable is not used in the library. Also, make
AddEntriesFromInfSection(), DefaultProcessEntry() and the typedef PPROCESS_ENTRY_ROUTINE
private again.
Modified:
branches/setup_improvements/base/setup/lib/settings.c
branches/setup_improvements/base/setup/lib/settings.h
Modified: branches/setup_improvements/base/setup/lib/settings.c
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/settings.c [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/settings.c [iso-8859-1] Thu Aug 31 18:27:07
2017
@@ -212,8 +212,8 @@
static
BOOLEAN
GetComputerIdentifier(
- PWSTR Identifier,
- ULONG IdentifierLength)
+ OUT PWSTR Identifier,
+ IN ULONG IdentifierLength)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
@@ -314,7 +314,23 @@
}
-LONG
+/*
+ * Return values:
+ * 0x00: Failure, stop the enumeration;
+ * 0x01: Add the entry and continue the enumeration;
+ * 0x02: Skip the entry but continue the enumeration.
+ */
+typedef UCHAR
+(NTAPI *PPROCESS_ENTRY_ROUTINE)(
+ IN PWCHAR KeyName,
+ IN PWCHAR KeyValue,
+ IN PCHAR DisplayText,
+ IN SIZE_T DisplayTextSize,
+ OUT PVOID* UserData,
+ OUT PBOOLEAN Current,
+ IN PVOID Parameter OPTIONAL);
+
+static LONG
AddEntriesFromInfSection(
IN OUT PGENERIC_LIST List,
IN HINF InfFile,
@@ -384,7 +400,7 @@
return TotalCount;
}
-UCHAR
+static UCHAR
NTAPI
DefaultProcessEntry(
IN PWCHAR KeyName,
@@ -418,7 +434,7 @@
PGENERIC_LIST
CreateComputerTypeList(
- HINF InfFile)
+ IN HINF InfFile)
{
PGENERIC_LIST List;
INFCONTEXT Context;
@@ -493,8 +509,8 @@
static
BOOLEAN
GetDisplayIdentifier(
- PWSTR Identifier,
- ULONG IdentifierLength)
+ OUT PWSTR Identifier,
+ IN ULONG IdentifierLength)
{
OBJECT_ATTRIBUTES ObjectAttributes;
UNICODE_STRING KeyName;
@@ -654,7 +670,7 @@
PGENERIC_LIST
CreateDisplayDriverList(
- HINF InfFile)
+ IN HINF InfFile)
{
PGENERIC_LIST List;
INFCONTEXT Context;
@@ -733,9 +749,9 @@
BOOLEAN
ProcessComputerFiles(
- HINF InfFile,
- PGENERIC_LIST List,
- PWCHAR *AdditionalSectionName)
+ IN HINF InfFile,
+ IN PGENERIC_LIST List,
+ OUT PWSTR* AdditionalSectionName)
{
PGENERIC_LIST_ENTRY Entry;
static WCHAR SectionName[128];
@@ -758,8 +774,8 @@
BOOLEAN
ProcessDisplayRegistry(
- HINF InfFile,
- PGENERIC_LIST List)
+ IN HINF InfFile,
+ IN PGENERIC_LIST List)
{
NTSTATUS Status;
PGENERIC_LIST_ENTRY Entry;
@@ -916,7 +932,7 @@
BOOLEAN
ProcessLocaleRegistry(
- PGENERIC_LIST List)
+ IN PGENERIC_LIST List)
{
PGENERIC_LIST_ENTRY Entry;
PWCHAR LanguageId;
@@ -1030,7 +1046,7 @@
PGENERIC_LIST
CreateKeyboardDriverList(
- HINF InfFile)
+ IN HINF InfFile)
{
PGENERIC_LIST List;
INFCONTEXT Context;
@@ -1110,8 +1126,8 @@
PGENERIC_LIST
CreateLanguageList(
- HINF InfFile,
- WCHAR *DefaultLanguage)
+ IN HINF InfFile,
+ OUT PWSTR DefaultLanguage)
{
PGENERIC_LIST List;
INFCONTEXT Context;
@@ -1130,7 +1146,6 @@
return NULL;
wcscpy(DefaultLanguage, KeyValue);
- SelectedLanguageId = KeyValue;
List = CreateGenericList();
if (List == NULL)
@@ -1161,13 +1176,14 @@
PGENERIC_LIST
CreateKeyboardLayoutList(
- HINF InfFile,
- WCHAR *DefaultKBLayout)
+ IN HINF InfFile,
+ IN PCWSTR LanguageId,
+ OUT PWCHAR DefaultKBLayout)
{
PGENERIC_LIST List;
INFCONTEXT Context;
PWCHAR KeyValue;
- const MUI_LAYOUTS * LayoutsList;
+ const MUI_LAYOUTS* LayoutsList;
ULONG uIndex = 0;
/* Get default layout id */
@@ -1183,7 +1199,7 @@
if (List == NULL)
return NULL;
- LayoutsList = MUIGetLayoutsList();
+ LayoutsList = MUIGetLayoutsList(LanguageId);
do
{
@@ -1218,11 +1234,12 @@
BOOLEAN
ProcessKeyboardLayoutRegistry(
- PGENERIC_LIST List)
+ IN PGENERIC_LIST List,
+ IN PCWSTR LanguageId)
{
PGENERIC_LIST_ENTRY Entry;
PWCHAR LayoutId;
- const MUI_LAYOUTS * LayoutsList;
+ const MUI_LAYOUTS* LayoutsList;
MUI_LAYOUTS NewLayoutsList[20];
ULONG uIndex;
ULONG uOldPos = 0;
@@ -1235,39 +1252,37 @@
if (LayoutId == NULL)
return FALSE;
- LayoutsList = MUIGetLayoutsList();
-
- if (_wcsicmp(LayoutsList[0].LayoutID, LayoutId) != 0)
- {
- for (uIndex = 1; LayoutsList[uIndex].LangID != NULL; uIndex++)
- {
- if (_wcsicmp(LayoutsList[uIndex].LayoutID, LayoutId) == 0)
- {
- uOldPos = uIndex;
- continue;
- }
-
- NewLayoutsList[uIndex].LangID = LayoutsList[uIndex].LangID;
- NewLayoutsList[uIndex].LayoutID = LayoutsList[uIndex].LayoutID;
- }
-
- NewLayoutsList[uIndex].LangID = NULL;
- NewLayoutsList[uIndex].LayoutID = NULL;
- NewLayoutsList[uOldPos].LangID = LayoutsList[0].LangID;
- NewLayoutsList[uOldPos].LayoutID = LayoutsList[0].LayoutID;
- NewLayoutsList[0].LangID = LayoutsList[uOldPos].LangID;
- NewLayoutsList[0].LayoutID = LayoutsList[uOldPos].LayoutID;
-
- return AddKbLayoutsToRegistry(NewLayoutsList);
- }
-
- return TRUE;
+ LayoutsList = MUIGetLayoutsList(LanguageId);
+
+ if (_wcsicmp(LayoutsList[0].LayoutID, LayoutId) == 0)
+ return TRUE;
+
+ for (uIndex = 1; LayoutsList[uIndex].LangID != NULL; uIndex++)
+ {
+ if (_wcsicmp(LayoutsList[uIndex].LayoutID, LayoutId) == 0)
+ {
+ uOldPos = uIndex;
+ continue;
+ }
+
+ NewLayoutsList[uIndex].LangID = LayoutsList[uIndex].LangID;
+ NewLayoutsList[uIndex].LayoutID = LayoutsList[uIndex].LayoutID;
+ }
+
+ NewLayoutsList[uIndex].LangID = NULL;
+ NewLayoutsList[uIndex].LayoutID = NULL;
+ NewLayoutsList[uOldPos].LangID = LayoutsList[0].LangID;
+ NewLayoutsList[uOldPos].LayoutID = LayoutsList[0].LayoutID;
+ NewLayoutsList[0].LangID = LayoutsList[uOldPos].LangID;
+ NewLayoutsList[0].LayoutID = LayoutsList[uOldPos].LayoutID;
+
+ return AddKbLayoutsToRegistry(NewLayoutsList);
}
#if 0
BOOLEAN
ProcessKeyboardLayoutFiles(
- PGENERIC_LIST List)
+ IN PGENERIC_LIST List)
{
return TRUE;
}
@@ -1275,7 +1290,7 @@
BOOLEAN
SetGeoID(
- PWCHAR Id)
+ IN PCWSTR Id)
{
NTSTATUS Status;
OBJECT_ATTRIBUTES ObjectAttributes;
@@ -1318,7 +1333,7 @@
BOOLEAN
SetDefaultPagefile(
- WCHAR Drive)
+ IN WCHAR Drive)
{
NTSTATUS Status;
HANDLE KeyHandle;
Modified: branches/setup_improvements/base/setup/lib/settings.h
URL:
http://svn.reactos.org/svn/reactos/branches/setup_improvements/base/setup/l…
==============================================================================
--- branches/setup_improvements/base/setup/lib/settings.h [iso-8859-1] (original)
+++ branches/setup_improvements/base/setup/lib/settings.h [iso-8859-1] Thu Aug 31 18:27:07
2017
@@ -27,97 +27,62 @@
#pragma once
-/*
- * Return values:
- * 0x00: Failure, stop the enumeration;
- * 0x01: Add the entry and continue the enumeration;
- * 0x02: Skip the entry but continue the enumeration.
- */
-typedef UCHAR
-(NTAPI *PPROCESS_ENTRY_ROUTINE)(
- IN PWCHAR KeyName,
- IN PWCHAR KeyValue,
- IN PCHAR DisplayText,
- IN SIZE_T DisplayTextSize,
- OUT PVOID* UserData,
- OUT PBOOLEAN Current,
- IN PVOID Parameter OPTIONAL);
-
-LONG
-AddEntriesFromInfSection(
- IN OUT PGENERIC_LIST List,
- IN HINF InfFile,
- IN PCWSTR SectionName,
- IN PINFCONTEXT pContext,
- IN PPROCESS_ENTRY_ROUTINE ProcessEntry,
- IN PVOID Parameter OPTIONAL);
-
-UCHAR
-NTAPI
-DefaultProcessEntry(
- IN PWCHAR KeyName,
- IN PWCHAR KeyValue,
- IN PCHAR DisplayText,
- IN SIZE_T DisplayTextSize,
- OUT PVOID* UserData,
- OUT PBOOLEAN Current,
- IN PVOID Parameter OPTIONAL);
-
-
PGENERIC_LIST
CreateComputerTypeList(
- HINF InfFile);
+ IN HINF InfFile);
PGENERIC_LIST
CreateDisplayDriverList(
- HINF InfFile);
+ IN HINF InfFile);
BOOLEAN
ProcessComputerFiles(
- HINF InfFile,
- PGENERIC_LIST List,
- PWCHAR *AdditionalSectionName);
+ IN HINF InfFile,
+ IN PGENERIC_LIST List,
+ OUT PWSTR* AdditionalSectionName);
BOOLEAN
ProcessDisplayRegistry(
- HINF InfFile,
- PGENERIC_LIST List);
+ IN HINF InfFile,
+ IN PGENERIC_LIST List);
PGENERIC_LIST
CreateKeyboardDriverList(
- HINF InfFile);
+ IN HINF InfFile);
PGENERIC_LIST
CreateKeyboardLayoutList(
- HINF InfFile,
- WCHAR *DefaultKBLayout);
+ IN HINF InfFile,
+ IN PCWSTR LanguageId,
+ OUT PWCHAR DefaultKBLayout);
PGENERIC_LIST
CreateLanguageList(
- HINF InfFile,
- WCHAR *DefaultLanguage);
+ IN HINF InfFile,
+ OUT PWSTR DefaultLanguage);
ULONG
GetDefaultLanguageIndex(VOID);
BOOLEAN
ProcessKeyboardLayoutRegistry(
- PGENERIC_LIST List);
+ IN PGENERIC_LIST List,
+ IN PCWSTR LanguageId);
BOOLEAN
ProcessKeyboardLayoutFiles(
- PGENERIC_LIST List);
+ IN PGENERIC_LIST List);
BOOLEAN
ProcessLocaleRegistry(
- PGENERIC_LIST List);
+ IN PGENERIC_LIST List);
BOOLEAN
SetGeoID(
- PWCHAR Id);
+ IN PCWSTR Id);
BOOLEAN
SetDefaultPagefile(
- WCHAR Drive);
+ IN WCHAR Drive);
/* EOF */