Author: ekohl
Date: Sun Sep 20 19:34:51 2015
New Revision: 69309
URL:
http://svn.reactos.org/svn/reactos?rev=69309&view=rev
Log:
[INTL]
Implement a save routine for the GeoID. Stores the current GeoID in the default user
profile too, if required.
CORE-10172 #resolve
Modified:
trunk/reactos/dll/cpl/intl/generalp.c
Modified: trunk/reactos/dll/cpl/intl/generalp.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/dll/cpl/intl/generalp.c?re…
==============================================================================
--- trunk/reactos/dll/cpl/intl/generalp.c [iso-8859-1] (original)
+++ trunk/reactos/dll/cpl/intl/generalp.c [iso-8859-1] Sun Sep 20 19:34:51 2015
@@ -475,6 +475,76 @@
return userGeoID;
}
+VOID
+SaveGeoID(
+ PGLOBALDATA pGlobalData)
+{
+ HKEY hGeoKey;
+ WCHAR value[15];
+ DWORD valuesize;
+ DWORD ret;
+
+ wsprintf(value, L"%lu", (DWORD)pGlobalData->geoid);
+ valuesize = (wcslen(value) + 1) * sizeof(WCHAR);
+
+ if (pGlobalData->bApplyToDefaultUser)
+ {
+ ret = RegOpenKeyExW(HKEY_USERS,
+ L".DEFAULT\\Control Panel\\International\\Geo",
+ 0,
+ KEY_WRITE,
+ &hGeoKey);
+ if (ret != ERROR_SUCCESS)
+ {
+ PrintErrorMsgBox(IDS_ERROR_DEF_INT_KEY_REG);
+ return;
+ }
+
+ ret = RegSetValueExW(hGeoKey,
+ L"Nation",
+ 0,
+ REG_SZ,
+ (PBYTE)value,
+ valuesize);
+
+ RegFlushKey(hGeoKey);
+ RegCloseKey(hGeoKey);
+
+ if (ret != ERROR_SUCCESS)
+ {
+ PrintErrorMsgBox(IDS_ERROR_INT_KEY_REG);
+ return;
+ }
+ }
+
+ ret = RegOpenKeyExW(HKEY_CURRENT_USER,
+ L"Control Panel\\International\\Geo",
+ 0,
+ KEY_WRITE,
+ &hGeoKey);
+ if (ret != ERROR_SUCCESS)
+ {
+ PrintErrorMsgBox(IDS_ERROR_INT_KEY_REG);
+ return;
+ }
+
+ ret = RegSetValueExW(hGeoKey,
+ L"Nation",
+ 0,
+ REG_SZ,
+ (PBYTE)value,
+ valuesize);
+
+ RegFlushKey(hGeoKey);
+ RegCloseKey(hGeoKey);
+
+ if (ret != ERROR_SUCCESS)
+ {
+ PrintErrorMsgBox(IDS_ERROR_INT_KEY_REG);
+ return;
+ }
+}
+
DWORD
VerifyUnattendLCID(HWND hwndDlg)
{
@@ -630,7 +700,7 @@
/* Set new GEO ID */
if (pGlobalData->fGeoIdChanged == TRUE)
{
- SetUserGeoID(pGlobalData->geoid);
+ SaveGeoID(pGlobalData);
pGlobalData->fGeoIdChanged = FALSE;
}