Skip to content

Commit

Permalink
Revert "[BOOTDATA][NTUSER] Add UserIsIMMEnabled and use it (reactos#4882
Browse files Browse the repository at this point in the history
)"

This reverts commit a2c6af0.
  • Loading branch information
DarkFire01 committed Sep 16, 2023
1 parent 7cbca9a commit ba04e5c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 69 deletions.
2 changes: 1 addition & 1 deletion boot/bootdata/hivesft.inf
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\FontMapper",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix",,0x00000012
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IME Compatibility",,0x00000012

HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM","LoadIMM",0x00010003,1
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM","LoadIMM",0x00010003,0
HKLM,"SOFTWARE\Microsoft\Windows NT\CurrentVersion\IMM","LoadCTFIME",0x00010003,0

; DOS Device ports
Expand Down
4 changes: 0 additions & 4 deletions win32ss/gdi/ntgdi/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,10 +56,6 @@ BOOL
NTAPI
RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData);

DWORD
NTAPI
RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault);

VOID FASTCALL
SetLastNtError(
NTSTATUS Status);
Expand Down
4 changes: 2 additions & 2 deletions win32ss/user/ntuser/ime.c
Original file line number Diff line number Diff line change
Expand Up @@ -550,7 +550,7 @@ DWORD FASTCALL UserBuildHimcList(PTHREADINFO pti, DWORD dwCount, HIMC *phList)
}
else
{
for (pti = gptiCurrent->ppi->ptiList; pti; pti = pti->ptiSibling)
for (pti = GetW32ThreadInfo()->ppi->ptiList; pti; pti = pti->ptiSibling)
{
for (pIMC = pti->spDefaultImc; pIMC; pIMC = pIMC->pImcNext)
{
Expand Down Expand Up @@ -704,7 +704,7 @@ NtUserBuildHimcList(DWORD dwThreadId, DWORD dwCount, HIMC *phList, LPDWORD pdwCo

if (dwThreadId == 0)
{
pti = gptiCurrent;
pti = GetW32ThreadInfo();
}
else if (dwThreadId == INVALID_THREAD_ID)
{
Expand Down
32 changes: 5 additions & 27 deletions win32ss/user/ntuser/metric.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,26 +14,6 @@ static BOOL Setup = FALSE;

/* FUNCTIONS *****************************************************************/

BOOL FASTCALL UserIsDBCSEnabled(VOID)
{
return NLS_MB_CODE_PAGE_TAG;
}

BOOL FASTCALL UserIsIMMEnabled(VOID)
{
static WCHAR s_szLoadIMM[] = L"LoadIMM";

if (NLS_MB_CODE_PAGE_TAG)
return TRUE;

return !!RegGetSectionDWORD(L"IMM", s_szLoadIMM, TRUE);
}

BOOL FASTCALL UserIsCiceroEnabled(VOID)
{
return FALSE; /* FIXME: Cicero is not supported yet */
}

BOOL
NTAPI
InitMetrics(VOID)
Expand Down Expand Up @@ -189,14 +169,12 @@ InitMetrics(VOID)
piSysMet[90] = 0;
#endif

if (UserIsDBCSEnabled())
gpsi->dwSRVIFlags |= SRVINFO_DBCSENABLED; /* DBCS Support */
/*gpsi->dwSRVIFlags |= SRVINFO_CICERO_ENABLED;*/ /* Cicero is not supported yet */

if (UserIsIMMEnabled())
gpsi->dwSRVIFlags |= SRVINFO_IMM32; /* IME Support */

if (UserIsCiceroEnabled())
gpsi->dwSRVIFlags |= SRVINFO_CICERO_ENABLED; /* Cicero support */
if (NLS_MB_CODE_PAGE_TAG) /* Is the system multi-byte codepage? */
{
gpsi->dwSRVIFlags |= (SRVINFO_DBCSENABLED | SRVINFO_IMM32); /* DBCS+IME Support */
}

Setup = TRUE;

Expand Down
30 changes: 0 additions & 30 deletions win32ss/user/ntuser/misc/registry.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,36 +155,6 @@ RegReadDWORD(HKEY hkey, PWSTR pwszValue, PDWORD pdwData)
return NT_SUCCESS(Status);
}

NTSTATUS
NTAPI
RegOpenSectionKey(
LPCWSTR pszSection,
PHKEY phkey)
{
WCHAR szKey[MAX_PATH] =
L"\\Registry\\Machine\\Software\\Microsoft\\Windows NT\\CurrentVersion\\";

RtlStringCchCatW(szKey, _countof(szKey), pszSection);
return RegOpenKey(szKey, phkey);
}

DWORD
NTAPI
RegGetSectionDWORD(LPCWSTR pszSection, LPWSTR pszValue, DWORD dwDefault)
{
HKEY hKey;
DWORD dwValue;

if (NT_ERROR(RegOpenSectionKey(pszSection, &hKey)))
return dwDefault;

if (!RegReadDWORD(hKey, pszValue, &dwValue))
dwValue = dwDefault;

ZwClose(hKey);
return dwValue;
}

_Success_(return!=FALSE)
BOOL
NTAPI
Expand Down
9 changes: 7 additions & 2 deletions win32ss/user/ntuser/simplecall.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,16 @@ NtUserCallNoParam(DWORD Routine)
break;

case NOPARAM_ROUTINE_UPDATEPERUSERIMMENABLING:
if (UserIsIMMEnabled())
// TODO: This should also check the registry!
// see https://www.pctipsbox.com/fix-available-for-ie7-memory-leaks-on-xp-sp3/ for more information
if (NLS_MB_CODE_PAGE_TAG)
{
gpsi->dwSRVIFlags |= SRVINFO_IMM32;
}
else
{
gpsi->dwSRVIFlags &= ~SRVINFO_IMM32;

}
Result = TRUE; // Always return TRUE.
break;

Expand Down
3 changes: 0 additions & 3 deletions win32ss/user/ntuser/userfuncs.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,6 @@ NTSTATUS FASTCALL InitSessionImpl(VOID);

BOOL NTAPI InitMetrics(VOID);
LONG NTAPI UserGetSystemMetrics(ULONG Index);
BOOL FASTCALL UserIsDBCSEnabled(VOID);
BOOL FASTCALL UserIsIMMEnabled(VOID);
BOOL FASTCALL UserIsCiceroEnabled(VOID);

/*************** KEYBOARD.C ***************/

Expand Down

0 comments on commit ba04e5c

Please sign in to comment.