https://git.reactos.org/?p=reactos.git;a=commitdiff;h=7a8ddbf1479f67f93225a…
commit 7a8ddbf1479f67f93225abf6c2a57a8aef6efcf5
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Thu Oct 27 21:53:58 2022 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Thu Oct 27 21:53:58 2022 +0900
[NTUSER] Support SM_DBCSENABLED and SM_IMMENABLED (#4806)
- Don't set SRVINFO_CICERO_ENABLED flag because we don't have Cicero support.
- Improve UserGetSystemMetrics for SM_DBCSENABLED and SM_IMMENABLED.
- Delete useless UserIsDBCSEnabled function.
CORE-11700
---
win32ss/user/ntuser/metric.c | 31 +++++++++++++------------------
1 file changed, 13 insertions(+), 18 deletions(-)
diff --git a/win32ss/user/ntuser/metric.c b/win32ss/user/ntuser/metric.c
index a50d10df4c8..b9801486024 100644
--- a/win32ss/user/ntuser/metric.c
+++ b/win32ss/user/ntuser/metric.c
@@ -14,20 +14,6 @@ static BOOL Setup = FALSE;
/* FUNCTIONS *****************************************************************/
-BOOL APIENTRY UserIsDBCSEnabled(VOID)
-{
- switch (PRIMARYLANGID(gusLanguageID))
- {
- case LANG_CHINESE:
- case LANG_JAPANESE:
- case LANG_KOREAN:
- return TRUE;
-
- default:
- return FALSE;
- }
-}
-
BOOL
NTAPI
InitMetrics(VOID)
@@ -164,12 +150,12 @@ InitMetrics(VOID)
piSysMet[SM_NETWORK] = 3;
piSysMet[SM_SLOWMACHINE] = 0;
piSysMet[SM_SECURE] = 0;
- piSysMet[SM_DBCSENABLED] = UserIsDBCSEnabled();
+ piSysMet[SM_DBCSENABLED] = NLS_MB_CODE_PAGE_TAG;
piSysMet[SM_SHOWSOUNDS] = gspv.bShowSounds;
piSysMet[SM_MIDEASTENABLED] = 0;
piSysMet[SM_CMONITORS] = 1;
piSysMet[SM_SAMEDISPLAYFORMAT] = 1;
- piSysMet[SM_IMMENABLED] = 0;
+ piSysMet[SM_IMMENABLED] = NLS_MB_CODE_PAGE_TAG;
/* Reserved */
piSysMet[SM_RESERVED1] = 0;
@@ -183,7 +169,13 @@ InitMetrics(VOID)
piSysMet[90] = 0;
#endif
- gpsi->dwSRVIFlags |= SRVINFO_CICERO_ENABLED;
+ /*gpsi->dwSRVIFlags |= SRVINFO_CICERO_ENABLED;*/ /* Cicero is not supported yet
*/
+
+ if (NLS_MB_CODE_PAGE_TAG) /* Is the system multi-byte codepage? */
+ {
+ gpsi->dwSRVIFlags |= (SRVINFO_DBCSENABLED | SRVINFO_IMM32); /* DBCS+IME
Support */
+ }
+
Setup = TRUE;
return TRUE;
@@ -198,7 +190,10 @@ UserGetSystemMetrics(ULONG Index)
TRACE("UserGetSystemMetrics(%lu)\n", Index);
if (Index == SM_DBCSENABLED)
- return UserIsDBCSEnabled();
+ return !!(gpsi->dwSRVIFlags & SRVINFO_DBCSENABLED);
+
+ if (Index == SM_IMMENABLED)
+ return !!(gpsi->dwSRVIFlags & SRVINFO_IMM32);
/* Get metrics from array */
if (Index < SM_CMETRICS)