[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
This commit is contained in:
Katayama Hirofumi MZ 2022-10-27 21:53:58 +09:00 committed by GitHub
parent 58983061e9
commit 7a8ddbf147
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -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)