[NTUSER] Implement GetSystemMetrics.SM_DBCSENABLED (#4317)

- Add UserIsDBCSEnabled helper function.
- Support SM_DBCSENABLED value of GetSystemMetrics function.
CORE-11700
This commit is contained in:
Katayama Hirofumi MZ 2022-01-30 11:23:22 +09:00 committed by GitHub
parent df8c74e78b
commit c339105b0d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -14,6 +14,21 @@ static BOOL Setup = FALSE;
/* FUNCTIONS *****************************************************************/
BOOL APIENTRY UserIsDBCSEnabled(VOID)
{
switch (PRIMARYLANGID(gusLanguageID))
{
case LANG_CHINESE:
case LANG_JAPANESE:
case LANG_KOREAN:
//case LANG_VIETNAMESE: // Are you using double-byte character strings?
return TRUE;
default:
return FALSE;
}
}
BOOL
NTAPI
InitMetrics(VOID)
@ -150,7 +165,7 @@ InitMetrics(VOID)
piSysMet[SM_NETWORK] = 3;
piSysMet[SM_SLOWMACHINE] = 0;
piSysMet[SM_SECURE] = 0;
piSysMet[SM_DBCSENABLED] = 0;
piSysMet[SM_DBCSENABLED] = UserIsDBCSEnabled();
piSysMet[SM_SHOWSOUNDS] = gspv.bShowSounds;
piSysMet[SM_MIDEASTENABLED] = 0;
piSysMet[SM_CMONITORS] = 1;
@ -183,6 +198,9 @@ UserGetSystemMetrics(ULONG Index)
ASSERT(Setup);
TRACE("UserGetSystemMetrics(%lu)\n", Index);
if (Index == SM_DBCSENABLED)
return UserIsDBCSEnabled();
/* Get metrics from array */
if (Index < SM_CMETRICS)
{
@ -206,5 +224,4 @@ UserGetSystemMetrics(ULONG Index)
return 0;
}
/* EOF */