ReactOS 0.4.15-dev-5672-gf73ac17
settings.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _GENENTRY
 

Typedefs

typedef struct _GENENTRY GENENTRY
 
typedef struct _GENENTRYPGENENTRY
 

Functions

PGENERIC_LIST CreateComputerTypeList (IN HINF InfFile)
 
PGENERIC_LIST CreateDisplayDriverList (IN HINF InfFile)
 
BOOLEAN ProcessComputerFiles (IN HINF InfFile, IN PGENERIC_LIST List, OUT PWSTR *AdditionalSectionName)
 
BOOLEAN ProcessDisplayRegistry (IN HINF InfFile, IN PGENERIC_LIST List)
 
PGENERIC_LIST CreateKeyboardDriverList (IN HINF InfFile)
 
PGENERIC_LIST CreateKeyboardLayoutList (IN HINF InfFile, IN PCWSTR LanguageId, OUT PWSTR DefaultKBLayout)
 
PGENERIC_LIST CreateLanguageList (IN HINF InfFile, OUT PWSTR DefaultLanguage)
 
ULONG GetDefaultLanguageIndex (VOID)
 
BOOLEAN ProcessKeyboardLayoutRegistry (IN PGENERIC_LIST List, IN PCWSTR LanguageId)
 
BOOLEAN ProcessKeyboardLayoutFiles (IN PGENERIC_LIST List)
 
BOOLEAN ProcessLocaleRegistry (IN PGENERIC_LIST List)
 
BOOLEAN SetGeoID (IN PCWSTR Id)
 
BOOLEAN SetDefaultPagefile (IN WCHAR Drive)
 

Typedef Documentation

◆ GENENTRY

◆ PGENENTRY

Function Documentation

◆ CreateComputerTypeList()

PGENERIC_LIST CreateComputerTypeList ( IN HINF  InfFile)

Definition at line 524 of file settings.c.

526{
529
531 if (List == NULL)
532 return NULL;
533
534 Success = AddComputerTypeEntries(InfFile, List, L"Map.Computer");
535 Success |= AddComputerTypeEntries(InfFile, List, L"Map.Computer.NT" INF_ARCH);
536 if (!Success)
537 {
539 return NULL;
540 }
541
542 return List;
543}
unsigned char BOOLEAN
BOOLEAN AddComputerTypeEntries(_In_ HINF InfFile, PGENERIC_LIST List, _In_ PWSTR SectionName)
Definition: settings.c:446
#define NULL
Definition: types.h:112
#define TRUE
Definition: types.h:120
@ Success
Definition: eventcreate.c:712
PGENERIC_LIST CreateGenericList(VOID)
Definition: genlist.c:20
VOID DestroyGenericList(IN OUT PGENERIC_LIST List, IN BOOLEAN FreeData)
Definition: genlist.c:36
#define L(x)
Definition: ntvdm.h:50
_Must_inspect_result_ _In_ WDFCMRESLIST List
Definition: wdfresource.h:550

Referenced by DeviceSettingsPage(), LoadSetupData(), and SetupStartPage().

◆ CreateDisplayDriverList()

PGENERIC_LIST CreateDisplayDriverList ( IN HINF  InfFile)

Definition at line 708 of file settings.c.

710{
714 PCWSTR KeyValue;
715 WCHAR DisplayIdentifier[128];
716 WCHAR DisplayKey[32];
717
718 /* Get the display identification */
719 if (!GetDisplayIdentifier(DisplayIdentifier, 128))
720 {
721 DisplayIdentifier[0] = 0;
722 }
723
724 DPRINT("Display identifier: '%S'\n", DisplayIdentifier);
725
726 /* Search for matching device identifier */
727 if (!SpInfFindFirstLine(InfFile, L"Map.Display", NULL, &Context))
728 {
729 /* FIXME: error message */
730 return NULL;
731 }
732
733 do
734 {
735 BOOLEAN FoundId;
736
737 if (!INF_GetDataField(&Context, 1, &KeyValue))
738 {
739 /* FIXME: Handle error! */
740 DPRINT("INF_GetDataField() failed\n");
741 return NULL;
742 }
743
744 DPRINT("KeyValue: %S\n", KeyValue);
745 FoundId = !!wcsstr(DisplayIdentifier, KeyValue);
746 INF_FreeData(KeyValue);
747
748 if (!FoundId)
749 continue;
750
751 if (!INF_GetDataField(&Context, 0, &KeyName))
752 {
753 /* FIXME: Handle error! */
754 DPRINT("INF_GetDataField() failed\n");
755 return NULL;
756 }
757
758 DPRINT("Display key: %S\n", KeyName);
759 RtlStringCchCopyW(DisplayKey, ARRAYSIZE(DisplayKey), KeyName);
761 } while (SpInfFindNextLine(&Context, &Context));
762
764 if (List == NULL)
765 return NULL;
766
768 InfFile,
769 L"Display",
770 &Context,
772 DisplayKey) == -1)
773 {
775 return NULL;
776 }
777
778#if 0
779 AppendGenericListEntry(List, L"Other display driver", NULL, TRUE);
780#endif
781
782 return List;
783}
static 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)
Definition: settings.c:340
static BOOLEAN GetDisplayIdentifier(OUT PWSTR Identifier, IN ULONG IdentifierLength)
Definition: settings.c:547
static UCHAR NTAPI DefaultProcessEntry(IN PCWSTR KeyName, IN PCWSTR KeyValue, OUT PVOID *UserData, OUT PBOOLEAN Current, IN PVOID Parameter OPTIONAL)
Definition: settings.c:408
#define ARRAYSIZE(array)
Definition: filtermapper.c:47
_CONST_RETURN wchar_t *__cdecl wcsstr(_In_z_ const wchar_t *_Str, _In_z_ const wchar_t *_SubStr)
pSpInfFindNextLine SpInfFindNextLine
Definition: infsupp.c:88
pSpInfFindFirstLine SpInfFindFirstLine
Definition: infsupp.c:87
FORCEINLINE VOID INF_FreeData(IN PCWSTR InfData)
Definition: infsupp.h:157
BOOLEAN INF_GetDataField(IN PINFCONTEXT Context, IN ULONG FieldIndex, OUT PCWSTR *Data)
Definition: infsupp.c:42
BOOLEAN AppendGenericListEntry(IN OUT PGENERIC_LIST List, IN PVOID Data, IN BOOLEAN Current)
Definition: genlist.c:62
NTSTRSAFEAPI RtlStringCchCopyW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ NTSTRSAFE_PCWSTR pszSrc)
Definition: ntstrsafe.h:127
#define DPRINT
Definition: sndvol32.h:71
const uint16_t * PCWSTR
Definition: typedefs.h:57
_Must_inspect_result_ _In_ WDFDEVICE _In_ PCUNICODE_STRING KeyName
Definition: wdfdevice.h:2699
__wchar_t WCHAR
Definition: xmlstorage.h:180

Referenced by DeviceSettingsPage(), LoadSetupData(), and SetupStartPage().

◆ CreateKeyboardDriverList()

PGENERIC_LIST CreateKeyboardDriverList ( IN HINF  InfFile)

Definition at line 1093 of file settings.c.

1095{
1098
1100 if (List == NULL)
1101 return NULL;
1102
1104 InfFile,
1105 L"Keyboard",
1106 &Context,
1108 NULL) == -1)
1109 {
1111 return NULL;
1112 }
1113
1114 return List;
1115}

Referenced by DeviceSettingsPage(), LoadSetupData(), and SetupStartPage().

◆ CreateKeyboardLayoutList()

PGENERIC_LIST CreateKeyboardLayoutList ( IN HINF  InfFile,
IN PCWSTR  LanguageId,
OUT PWSTR  DefaultKBLayout 
)

Definition at line 1230 of file settings.c.

1234{
1237 PCWSTR KeyValue;
1238 const MUI_LAYOUTS* LayoutsList;
1239 ULONG uIndex = 0;
1240
1241 /* Get default layout id */
1242 if (!SpInfFindFirstLine(InfFile, L"NLS", L"DefaultLayout", &Context))
1243 return NULL;
1244
1245 if (!INF_GetData(&Context, NULL, &KeyValue))
1246 return NULL;
1247
1248 wcscpy(DefaultKBLayout, KeyValue);
1249
1251 if (List == NULL)
1252 return NULL;
1253
1254 LayoutsList = MUIGetLayoutsList(LanguageId);
1255
1256 do
1257 {
1258 // NOTE: See https://svn.reactos.org/svn/reactos?view=revision&revision=68354
1260 InfFile,
1261 L"KeyboardLayout",
1262 &Context,
1264 DefaultKBLayout) == -1)
1265 {
1267 return NULL;
1268 }
1269
1270 uIndex++;
1271
1272 } while (LayoutsList[uIndex].LangID != NULL);
1273
1274 /* Check whether some keyboard layouts have been found */
1275 /* FIXME: Handle this case */
1276 if (GetNumberOfListEntries(List) == 0)
1277 {
1278 DPRINT1("No keyboard layouts have been found\n");
1280 return NULL;
1281 }
1282
1283 return List;
1284}
#define DPRINT1
Definition: precomp.h:8
const MUI_LAYOUTS * MUIGetLayoutsList(IN PCWSTR LanguageId)
Definition: mui.c:112
BOOLEAN INF_GetData(IN PINFCONTEXT Context, OUT PCWSTR *Key, OUT PCWSTR *Data)
Definition: infsupp.c:90
ULONG GetNumberOfListEntries(IN PGENERIC_LIST List)
Definition: genlist.c:140
_CRTIMP wchar_t *__cdecl wcscpy(_Out_writes_z_(_String_length_(_Source)+1) wchar_t *_Dest, _In_z_ const wchar_t *_Source)
uint32_t ULONG
Definition: typedefs.h:59
static WCHAR DefaultKBLayout[20]
Definition: usetup.c:68
_Must_inspect_result_ _In_ WDFUSBDEVICE _In_opt_ WDFREQUEST _In_opt_ PWDF_REQUEST_SEND_OPTIONS _Out_writes_opt_ NumCharacters PUSHORT _Inout_ PUSHORT _In_ UCHAR _In_opt_ USHORT LangID
Definition: wdfusb.h:1083

Referenced by DeviceSettingsPage(), LoadSetupData(), SetupStartPage(), and UpdateKBLayout().

◆ CreateLanguageList()

PGENERIC_LIST CreateLanguageList ( IN HINF  InfFile,
OUT PWSTR  DefaultLanguage 
)

Definition at line 1180 of file settings.c.

1183{
1186 PCWSTR KeyValue;
1187
1188 LANG_ENTRY_PARAM LangEntryParam;
1189
1190 LangEntryParam.uIndex = 0;
1191 LangEntryParam.DefaultLanguage = DefaultLanguage;
1192
1193 /* Get default language id */
1194 if (!SpInfFindFirstLine(InfFile, L"NLS", L"DefaultLanguage", &Context))
1195 return NULL;
1196
1197 if (!INF_GetData(&Context, NULL, &KeyValue))
1198 return NULL;
1199
1200 wcscpy(DefaultLanguage, KeyValue);
1201
1203 if (List == NULL)
1204 return NULL;
1205
1207 InfFile,
1208 L"Language",
1209 &Context,
1211 &LangEntryParam) == -1)
1212 {
1214 return NULL;
1215 }
1216
1217 /* Only one language available, make it the default one */
1218 if (LangEntryParam.uIndex == 1)
1219 {
1223 }
1224
1225 return List;
1226}
DWORD Id
static UCHAR NTAPI ProcessLangEntry(IN PCWSTR KeyName, IN PCWSTR KeyValue, OUT PVOID *UserData, OUT PBOOLEAN Current, IN PVOID Parameter OPTIONAL)
Definition: settings.c:1132
static ULONG DefaultLanguageIndex
Definition: settings.c:41
PGENERIC_LIST_ENTRY GetFirstListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:104
PVOID GetListEntryData(IN PGENERIC_LIST_ENTRY Entry)
Definition: genlist.c:126
Definition: settings.c:1125
ULONG uIndex
Definition: settings.c:1126
PWCHAR DefaultLanguage
Definition: settings.c:1127
static WCHAR DefaultLanguage[20]
Definition: usetup.c:67

Referenced by LanguagePage(), LoadSetupData(), and SetupStartPage().

◆ GetDefaultLanguageIndex()

ULONG GetDefaultLanguageIndex ( VOID  )

Definition at line 1119 of file settings.c.

1120{
1121 return DefaultLanguageIndex;
1122}

Referenced by LanguagePage().

◆ ProcessComputerFiles()

BOOLEAN ProcessComputerFiles ( IN HINF  InfFile,
IN PGENERIC_LIST  List,
OUT PWSTR AdditionalSectionName 
)

Definition at line 787 of file settings.c.

791{
793 static WCHAR SectionName[128];
794
795 DPRINT("ProcessComputerFiles() called\n");
796
798 if (Entry == NULL)
799 return FALSE;
800
801 RtlStringCchPrintfW(SectionName, ARRAYSIZE(SectionName),
802 L"Files.%s", ((PGENENTRY)GetListEntryData(Entry))->Id);
803 *AdditionalSectionName = SectionName;
804
805 return TRUE;
806}
#define FALSE
Definition: types.h:117
PGENERIC_LIST_ENTRY GetCurrentListEntry(IN PGENERIC_LIST List)
Definition: genlist.c:97
NTSTRSAFEVAPI RtlStringCchPrintfW(_Out_writes_(cchDest) _Always_(_Post_z_) NTSTRSAFE_PWSTR pszDest, _In_ size_t cchDest, _In_ _Printf_format_string_ NTSTRSAFE_PCWSTR pszFormat,...)
Definition: ntstrsafe.h:1110
base of all file and directory entries
Definition: entries.h:83
Definition: genlist.h:11

Referenced by PrepareCopyInfFile().

◆ ProcessDisplayRegistry()

BOOLEAN ProcessDisplayRegistry ( IN HINF  InfFile,
IN PGENERIC_LIST  List 
)

Definition at line 809 of file settings.c.

812{
818 ULONG StartValue;
819 ULONG Width, Height, Bpp;
823 WCHAR RegPath[255];
824
825 DPRINT("ProcessDisplayRegistry() called\n");
826
828 if (Entry == NULL)
829 return FALSE;
830
831 if (!SpInfFindFirstLine(InfFile, L"Display",
833 &Context))
834 {
835 DPRINT1("SpInfFindFirstLine() failed\n");
836 return FALSE;
837 }
838
839 /* Enable the correct driver */
841 {
842 DPRINT1("INF_GetDataField() failed\n");
843 return FALSE;
844 }
845
847 DPRINT("Service name: '%S'\n", ServiceName);
848
849 RtlStringCchPrintfW(RegPath, ARRAYSIZE(RegPath),
850 L"System\\CurrentControlSet\\Services\\%s",
852 RtlInitUnicodeString(&KeyName, RegPath);
854 &KeyName,
857 NULL);
861 if (!NT_SUCCESS(Status))
862 {
863 DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
864 return FALSE;
865 }
866
867 StartValue = 1;
869 L"Start",
870 REG_DWORD,
871 &StartValue,
872 sizeof(StartValue));
874 if (!NT_SUCCESS(Status))
875 {
876 DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
877 return FALSE;
878 }
879
880 /* Set the resolution */
881
882 if (!INF_GetDataField(&Context, 4, &Buffer))
883 {
884 DPRINT1("INF_GetDataField() failed\n");
885 return FALSE;
886 }
887
888 RtlStringCchPrintfW(RegPath, ARRAYSIZE(RegPath),
889 L"System\\CurrentControlSet\\Hardware Profiles\\Current\\System\\CurrentControlSet\\Services\\%s\\Device0",
891 DPRINT("RegPath: '%S'\n", RegPath);
892 RtlInitUnicodeString(&KeyName, RegPath);
894 &KeyName,
897 NULL);
902 {
903 /* Try without Hardware Profile part */
904 RtlStringCchPrintfW(RegPath, ARRAYSIZE(RegPath),
905 L"System\\CurrentControlSet\\Services\\%s\\Device0",
907 RtlInitUnicodeString(&KeyName, RegPath);
911 }
912 if (!NT_SUCCESS(Status))
913 {
914 DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
915 return FALSE;
916 }
917
918 Width = wcstoul(Buffer, NULL, 10);
920 L"DefaultSettings.XResolution",
921 REG_DWORD,
922 &Width,
923 sizeof(Width));
924 if (!NT_SUCCESS(Status))
925 {
926 DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
928 return FALSE;
929 }
930
931 if (!INF_GetDataField(&Context, 5, &Buffer))
932 {
933 DPRINT1("INF_GetDataField() failed\n");
935 return FALSE;
936 }
937
938 Height = wcstoul(Buffer, 0, 0);
940 L"DefaultSettings.YResolution",
941 REG_DWORD,
942 &Height,
943 sizeof(Height));
944 if (!NT_SUCCESS(Status))
945 {
946 DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
948 return FALSE;
949 }
950
951 if (!INF_GetDataField(&Context, 6, &Buffer))
952 {
953 DPRINT1("INF_GetDataField() failed\n");
955 return FALSE;
956 }
957
958 Bpp = wcstoul(Buffer, 0, 0);
960 L"DefaultSettings.BitsPerPel",
961 REG_DWORD,
962 &Bpp,
963 sizeof(Bpp));
964 if (!NT_SUCCESS(Status))
965 {
966 DPRINT1("RtlWriteRegistryValue() failed (Status %lx)\n", Status);
968 return FALSE;
969 }
970
972
973 DPRINT("ProcessDisplayRegistry() done\n");
974
975 return TRUE;
976}
LONG NTSTATUS
Definition: precomp.h:26
static WCHAR ServiceName[]
Definition: browser.c:19
HANDLE GetRootKeyByPredefKey(IN HANDLE KeyHandle, OUT PCWSTR *RootKeyMountPoint OPTIONAL)
Definition: registry.c:90
Definition: bufpool.h:45
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES ObjectAttributes
Definition: conport.c:36
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
Status
Definition: gdiplustypes.h:25
_Check_return_ unsigned long __cdecl wcstoul(_In_z_ const wchar_t *_Str, _Out_opt_ _Deref_post_z_ wchar_t **_EndPtr, _In_ int _Radix)
_CRTIMP size_t __cdecl wcslen(_In_z_ const wchar_t *_Str)
#define OBJ_CASE_INSENSITIVE
Definition: winternl.h:228
NTSYSAPI NTSTATUS WINAPI RtlWriteRegistryValue(ULONG, PCWSTR, PCWSTR, ULONG, PVOID, ULONG)
#define ASSERT(a)
Definition: mode.c:44
#define InitializeObjectAttributes(p, n, a, r, s)
Definition: reg.c:106
_Must_inspect_result_ _Out_ PNDIS_STATUS _In_ NDIS_HANDLE _In_ ULONG _Out_ PNDIS_STRING _Out_ PNDIS_HANDLE KeyHandle
Definition: ndis.h:4715
NTSYSAPI NTSTATUS NTAPI NtOpenKey(OUT PHANDLE KeyHandle, IN ACCESS_MASK DesiredAccess, IN POBJECT_ATTRIBUTES ObjectAttributes)
Definition: ntapi.c:336
NTSYSAPI VOID NTAPI RtlInitUnicodeString(PUNICODE_STRING DestinationString, PCWSTR SourceString)
NTSTATUS NTAPI NtClose(IN HANDLE Handle)
Definition: obhandle.c:3402
#define RTL_REGISTRY_HANDLE
Definition: nt_native.h:168
#define KEY_SET_VALUE
Definition: nt_native.h:1017
#define REG_DWORD
Definition: sdbapi.c:596
#define STATUS_OBJECT_NAME_NOT_FOUND
Definition: udferr_usr.h:149
_In_ HFONT _Out_ PUINT _Out_ PUINT Width
Definition: font.h:126
_In_ HFONT _Out_ PUINT Height
Definition: font.h:125
#define HKEY_LOCAL_MACHINE
Definition: winreg.h:12

Referenced by UpdateRegistry().

◆ ProcessKeyboardLayoutFiles()

BOOLEAN ProcessKeyboardLayoutFiles ( IN PGENERIC_LIST  List)

◆ ProcessKeyboardLayoutRegistry()

BOOLEAN ProcessKeyboardLayoutRegistry ( IN PGENERIC_LIST  List,
IN PCWSTR  LanguageId 
)

Definition at line 1288 of file settings.c.

1291{
1293 PCWSTR LayoutId;
1294 const MUI_LAYOUTS* LayoutsList;
1295 MUI_LAYOUTS NewLayoutsList[20];
1296 ULONG uIndex;
1297 ULONG uOldPos = 0;
1298
1300 if (Entry == NULL)
1301 return FALSE;
1302
1303 LayoutId = ((PGENENTRY)GetListEntryData(Entry))->Id;
1304 if (LayoutId == NULL)
1305 return FALSE;
1306
1307 LayoutsList = MUIGetLayoutsList(LanguageId);
1308
1309 if (_wcsicmp(LayoutsList[0].LayoutID, LayoutId) == 0)
1310 return TRUE;
1311
1312 for (uIndex = 1; LayoutsList[uIndex].LangID != NULL; uIndex++)
1313 {
1314 if (_wcsicmp(LayoutsList[uIndex].LayoutID, LayoutId) == 0)
1315 {
1316 uOldPos = uIndex;
1317 continue;
1318 }
1319
1320 NewLayoutsList[uIndex].LangID = LayoutsList[uIndex].LangID;
1321 NewLayoutsList[uIndex].LayoutID = LayoutsList[uIndex].LayoutID;
1322 }
1323
1324 NewLayoutsList[uIndex].LangID = NULL;
1325 NewLayoutsList[uIndex].LayoutID = NULL;
1326 NewLayoutsList[uOldPos].LangID = LayoutsList[0].LangID;
1327 NewLayoutsList[uOldPos].LayoutID = LayoutsList[0].LayoutID;
1328 NewLayoutsList[0].LangID = LayoutsList[uOldPos].LangID;
1329 NewLayoutsList[0].LayoutID = LayoutsList[uOldPos].LayoutID;
1330
1331 return AddKbLayoutsToRegistry(NewLayoutsList);
1332}
struct _GENENTRY * PGENENTRY
BOOLEAN AddKbLayoutsToRegistry(IN const MUI_LAYOUTS *MuiLayouts)
Definition: mui.c:208
_Check_return_ _CRTIMP int __cdecl _wcsicmp(_In_z_ const wchar_t *_Str1, _In_z_ const wchar_t *_Str2)
PCWSTR LangID
Definition: mui.h:11
PCWSTR LayoutID
Definition: mui.h:12

Referenced by UpdateRegistry().

◆ ProcessLocaleRegistry()

BOOLEAN ProcessLocaleRegistry ( IN PGENERIC_LIST  List)

Definition at line 979 of file settings.c.

981{
983 PCWSTR LanguageId;
987
990
992 if (Entry == NULL)
993 return FALSE;
994
995 LanguageId = ((PGENENTRY)GetListEntryData(Entry))->Id;
996 if (LanguageId == NULL)
997 return FALSE;
998
999 DPRINT("LanguageId: %S\n", LanguageId);
1000
1001 /* Open the default users locale key */
1003 L".DEFAULT\\Control Panel\\International");
1004
1006 &KeyName,
1009 NULL);
1010
1014 if (!NT_SUCCESS(Status))
1015 {
1016 DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
1017 return FALSE;
1018 }
1019
1020 /* Set default user locale */
1021 RtlInitUnicodeString(&ValueName, L"Locale");
1023 &ValueName,
1024 0,
1025 REG_SZ,
1026 (PVOID)LanguageId,
1027 (wcslen(LanguageId) + 1) * sizeof(WCHAR));
1029 if (!NT_SUCCESS(Status))
1030 {
1031 DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
1032 return FALSE;
1033 }
1034
1035 /* Skip first 4 zeroes */
1036 if (wcslen(LanguageId) >= 4)
1037 LanguageId += 4;
1038
1039 /* Open the NLS language key */
1041 L"SYSTEM\\CurrentControlSet\\Control\\NLS\\Language");
1042
1044 &KeyName,
1047 NULL);
1048
1052 if (!NT_SUCCESS(Status))
1053 {
1054 DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
1055 return FALSE;
1056 }
1057
1058 /* Set default language */
1059 RtlInitUnicodeString(&ValueName, L"Default");
1061 &ValueName,
1062 0,
1063 REG_SZ,
1064 (PVOID)LanguageId,
1065 (wcslen(LanguageId) + 1) * sizeof(WCHAR));
1066 if (!NT_SUCCESS(Status))
1067 {
1068 DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
1070 return FALSE;
1071 }
1072
1073 /* Set install language */
1074 RtlInitUnicodeString(&ValueName, L"InstallLanguage");
1076 &ValueName,
1077 0,
1078 REG_SZ,
1079 (PVOID)LanguageId,
1080 (wcslen(LanguageId) + 1) * sizeof(WCHAR));
1082 if (!NT_SUCCESS(Status))
1083 {
1084 DPRINT1("NtSetValueKey() failed (Status %lx)\n", Status);
1085 return FALSE;
1086 }
1087
1088 return TRUE;
1089}
#define REG_SZ
Definition: layer.c:22
NTSYSAPI NTSTATUS NTAPI NtSetValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName, IN ULONG TitleIndex OPTIONAL, IN ULONG Type, IN PVOID Data, IN ULONG DataSize)
Definition: ntapi.c:859
_Must_inspect_result_ _In_ WDFKEY _In_ PCUNICODE_STRING ValueName
Definition: wdfregistry.h:243
#define HKEY_USERS
Definition: winreg.h:13

Referenced by UpdateRegistry().

◆ SetDefaultPagefile()

BOOLEAN SetDefaultPagefile ( IN WCHAR  Drive)

Definition at line 1387 of file settings.c.

1389{
1393 UNICODE_STRING KeyName = RTL_CONSTANT_STRING(L"SYSTEM\\CurrentControlSet\\Control\\Session Manager\\Memory Management");
1395 WCHAR ValueBuffer[] = L"?:\\pagefile.sys 0 0\0";
1396
1398 &KeyName,
1401 NULL);
1405 if (!NT_SUCCESS(Status))
1406 return FALSE;
1407
1408 ValueBuffer[0] = Drive;
1409
1411 &ValueName,
1412 0,
1414 (PVOID)&ValueBuffer,
1415 sizeof(ValueBuffer));
1416
1418 return TRUE;
1419}
PWCHAR Drive
Definition: chkdsk.c:73
#define KEY_ALL_ACCESS
Definition: nt_native.h:1041
#define REG_MULTI_SZ
Definition: nt_native.h:1501
#define RTL_CONSTANT_STRING(s)
Definition: tunneltest.c:14

Referenced by UpdateRegistry().

◆ SetGeoID()

BOOLEAN SetGeoID ( IN PCWSTR  Id)

Definition at line 1344 of file settings.c.

1346{
1351
1353 L".DEFAULT\\Control Panel\\International\\Geo");
1355 &Name,
1358 NULL);
1362 if (!NT_SUCCESS(Status))
1363 {
1364 DPRINT1("NtOpenKey() failed (Status %lx)\n", Status);
1365 return FALSE;
1366 }
1367
1368 RtlInitUnicodeString(&Name, L"Nation");
1370 &Name,
1371 0,
1372 REG_SZ,
1373 (PVOID)Id,
1374 (wcslen(Id) + 1) * sizeof(WCHAR));
1376 if (!NT_SUCCESS(Status))
1377 {
1378 DPRINT1("NtSetValueKey() failed (Status = %lx)\n", Status);
1379 return FALSE;
1380 }
1381
1382 return TRUE;
1383}
struct NameRec_ * Name
Definition: cdprocs.h:460

Referenced by UpdateRegistry().