https://git.reactos.org/?p=reactos.git;a=commitdiff;h=d735373e46cb84fa29335…
commit d735373e46cb84fa293359b881b1e22ef5f6bb29
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Mon Jan 31 04:21:45 2022 +0900
Commit: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
CommitDate: Mon Jan 31 04:21:45 2022 +0900
[USER32] Improve RegisterIMEClass function
CORE-11700
---
win32ss/user/user32/misc/imm.c | 38 +++++++++++++++-----------------------
1 file changed, 15 insertions(+), 23 deletions(-)
diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c
index ae711d1b70d..2a9f6d523f0 100644
--- a/win32ss/user/user32/misc/imm.c
+++ b/win32ss/user/user32/misc/imm.c
@@ -653,37 +653,29 @@ UpdatePerUserImmEnabling(VOID)
return Ret;
}
-static const WCHAR imeW[] = {'I','M','E',0};
-
BOOL
WINAPI
RegisterIMEClass(VOID)
{
- WNDCLASSEXW WndClass;
ATOM atom;
+ WNDCLASSEXW WndClass = { sizeof(WndClass) };
+
+ WndClass.lpszClassName = L"IME";
+ WndClass.style = CS_GLOBALCLASS;
+ WndClass.lpfnWndProc = ImeWndProcW;
+ WndClass.cbWndExtra = sizeof(LONG_PTR);
+ WndClass.hCursor = LoadCursorW(NULL, IDC_ARROW);
- ZeroMemory(&WndClass, sizeof(WndClass));
-
- WndClass.cbSize = sizeof(WndClass);
- WndClass.lpszClassName = imeW;
- WndClass.style = CS_GLOBALCLASS;
- WndClass.lpfnWndProc = ImeWndProcW;
- WndClass.cbWndExtra = sizeof(LONG_PTR);
- WndClass.hCursor = LoadCursorW(NULL, IDC_ARROW);
-
- atom = RegisterClassExWOWW( &WndClass,
- 0,
- FNID_IME,
- 0,
- FALSE);
- if (atom)
+ atom = RegisterClassExWOWW(&WndClass, 0, FNID_IME, 0, FALSE);
+ if (!atom)
{
- RegisterDefaultClasses |= ICLASS_TO_MASK(ICLS_IME);
- TRACE("Register IME Class!\n");
- return TRUE;
+ ERR("Failed to register IME Class!\n");
+ return FALSE;
}
- ERR("Failed to register IME Class!\n");
- return FALSE;
+
+ RegisterDefaultClasses |= ICLASS_TO_MASK(ICLS_IME);
+ TRACE("RegisterIMEClass atom = %u\n", atom);
+ return TRUE;
}
/*