https://git.reactos.org/?p=reactos.git;a=commitdiff;h=33fe4333f40dadfda1c92…
commit 33fe4333f40dadfda1c9232639c887249573459e
Author: Katayama Hirofumi MZ <katayama.hirofumi.mz(a)gmail.com>
AuthorDate: Wed Sep 23 21:42:54 2020 +0900
Commit: GitHub <noreply(a)github.com>
CommitDate: Wed Sep 23 21:42:54 2020 +0900
[USER32] Load IMM table (#3215)
Implement the IMM function table in module user32.dll. CORE-11700
File immtable.h is located at win32ss/user/user32/include, that is a list of the
DEFINE_IMM_ENTRY macro calls.
---
win32ss/user/user32/include/immtable.h | 53 +++++++++
win32ss/user/user32/include/user32.h | 2 +
win32ss/user/user32/include/user32p.h | 35 +++---
win32ss/user/user32/misc/imm.c | 202 ++++++++-------------------------
win32ss/user/user32/misc/immtable.h | 52 ---------
5 files changed, 119 insertions(+), 225 deletions(-)
diff --git a/win32ss/user/user32/include/immtable.h
b/win32ss/user/user32/include/immtable.h
new file mode 100644
index 00000000000..ca37779bdd2
--- /dev/null
+++ b/win32ss/user/user32/include/immtable.h
@@ -0,0 +1,53 @@
+/* DEFINE_IMM_ENTRY(type, name, params, retval, retkind) */
+DEFINE_IMM_ENTRY(BOOL, ImmWINNLSEnableIME, (HWND hwnd, BOOL enable), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmWINNLSGetEnableStatus, (HWND hwnd), 0, NONVOID)
+DEFINE_IMM_ENTRY(LRESULT, ImmSendIMEMessageExW, (HWND hwnd, LPARAM lParam), 0, NONVOID)
+DEFINE_IMM_ENTRY(LRESULT, ImmSendIMEMessageExA, (HWND hwnd, LPARAM lParam), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmIMPGetIMEW, (HWND hwnd, LPIMEPROW ime), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmIMPGetIMEA, (HWND hwnd, LPIMEPROA ime), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmIMPQueryIMEW, (LPIMEPROW ime), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmIMPQueryIMEA, (LPIMEPROA ime), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmIMPSetIMEW, (HWND hwnd, LPIMEPROW ime), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmIMPSetIMEA, (HWND hwnd, LPIMEPROA ime), 0, NONVOID)
+DEFINE_IMM_ENTRY(HIMC, ImmAssociateContext, (HWND hwnd, HIMC hIMC), 0, NONVOID)
+DEFINE_IMM_ENTRY(LRESULT, ImmEscapeA, (HKL hKL, HIMC hIMC, UINT uEscape, LPVOID lpData),
0, NONVOID)
+DEFINE_IMM_ENTRY(LRESULT, ImmEscapeW, (HKL hKL, HIMC hIMC, UINT uEscape, LPVOID lpData),
0, NONVOID)
+DEFINE_IMM_ENTRY(LONG, ImmGetCompositionStringA, (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf,
DWORD dwBufLen), 0, NONVOID)
+DEFINE_IMM_ENTRY(LONG, ImmGetCompositionStringW, (HIMC hIMC, DWORD dwIndex, LPVOID lpBuf,
DWORD dwBufLen), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmGetCompositionWindow, (HIMC hIMC, LPCOMPOSITIONFORM
lpCompForm), 0, NONVOID)
+DEFINE_IMM_ENTRY(HIMC, ImmGetContext, (HWND hwnd), 0, NONVOID)
+DEFINE_IMM_ENTRY(HWND, ImmGetDefaultIMEWnd, (HWND hwnd), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmIsIME, (HKL hKL), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmReleaseContext, (HWND hwnd, HIMC hIMC), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmRegisterClient, (/*PSHAREDINFO*/ LPVOID pInfo, HINSTANCE
hInst), TRUE, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmGetCompositionFontW, (HIMC hIMC, LPLOGFONTW plf), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmGetCompositionFontA, (HIMC hIMC, LPLOGFONTA plf), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionFontW, (HIMC hIMC, LPLOGFONTW plf), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionFontA, (HIMC hIMC, LPLOGFONTA plf), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionWindow, (HIMC hIMC, LPCOMPOSITIONFORM
lpCompForm), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmNotifyIME, (HIMC hIMC, DWORD dwAction, DWORD dwIndex, DWORD
dwValue), 0, NONVOID)
+DEFINE_IMM_ENTRY(/*PINPUTCONTEXT*/ LPVOID, ImmLockIMC, (HIMC hIMC), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmUnlockIMC, (HIMC hIMC), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmLoadIME, (HKL hKL), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetOpenStatus, (HIMC hIMC, BOOL bOpen), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmFreeLayout, (DWORD dwFlags), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmActivateLayout, (HKL hKL), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetCandidateWindow, (HIMC hIMC, LPCANDIDATEFORM lpCandForm), 0,
NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmConfigureIMEW, (HKL hKL, HWND hWnd, DWORD dwMode, LPVOID
lpData), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmGetConversionStatus, (HIMC hIMC, LPDWORD lpdwConversion,
LPDWORD lpdwSentence), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetConversionStatus, (HIMC hIMC, DWORD dwConversion, DWORD
dwSentence), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetStatusWindowPos, (HIMC hIMC, LPPOINT lppt), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmGetImeInfoEx, (PIMEINFOEX info, IMEINFOEXCLASS type, LPVOID
pvKey), 0, NONVOID)
+DEFINE_IMM_ENTRY(/*PIMEDPI*/ LPVOID, ImmLockImeDpi, (HKL hKL), 0, NONVOID)
+DEFINE_IMM_ENTRY(VOID, ImmUnlockImeDpi, (/*PIMEDPI*/ LPVOID dpi), 0, VOID)
+DEFINE_IMM_ENTRY(BOOL, ImmGetOpenStatus, (HIMC hIMC), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetActiveContext, (HWND hwnd, HIMC hIMC, BOOL bFlag), 0,
NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmTranslateMessage, (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM
lParam), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmLoadLayout, (HKL hKL, PIMEINFOEX info), 0, NONVOID)
+DEFINE_IMM_ENTRY(DWORD, ImmProcessKey, (HWND hwnd, HKL hKL, UINT uVKey, LPARAM lParam,
DWORD dwHotKeyID), 0, NONVOID)
+DEFINE_IMM_ENTRY(LRESULT, ImmPutImeMenuItemsIntoMappedFile, (HIMC hIMC), 0, NONVOID)
+DEFINE_IMM_ENTRY(DWORD, ImmGetProperty, (HKL hKL, DWORD dwIndex), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionStringA, (HIMC hIMC, DWORD dwIndex, LPCVOID
lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionStringW, (HIMC hIMC, DWORD dwIndex, LPCVOID
lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen), 0, NONVOID)
+DEFINE_IMM_ENTRY(BOOL, ImmEnumInputContext, (DWORD dwThreadID, IMCENUMPROC lpfn, LPARAM
lParam), 0, NONVOID)
+DEFINE_IMM_ENTRY(LRESULT, ImmSystemHandler, (HIMC hIMC, WPARAM wParam, LPARAM lParam), 0,
NONVOID)
diff --git a/win32ss/user/user32/include/user32.h b/win32ss/user/user32/include/user32.h
index 56415399ffc..2615fb61549 100644
--- a/win32ss/user/user32/include/user32.h
+++ b/win32ss/user/user32/include/user32.h
@@ -57,6 +57,8 @@
#include <wine/unicode.h>
#include <wine/debug.h>
+#include <winnls32.h>
+
/* Internal User32 Headers */
#include "user32p.h"
diff --git a/win32ss/user/user32/include/user32p.h
b/win32ss/user/user32/include/user32p.h
index 9bfaeecf83a..5ec7b322bd1 100644
--- a/win32ss/user/user32/include/user32p.h
+++ b/win32ss/user/user32/include/user32p.h
@@ -17,31 +17,24 @@
#include "resource.h"
#include "ntwrapper.h"
+#define IMM_RETURN_VOID(retval) /* empty */
+#define IMM_RETURN_NONVOID(retval) return (retval)
+/* typedef FN_... */
+#undef DEFINE_IMM_ENTRY
+#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
+ typedef type (WINAPI *FN_##name)params;
+#include "immtable.h"
+
+/* define Imm32ApiTable */
typedef struct
{
- BOOL (WINAPI* pImmIsIME) (HKL);
- LRESULT (WINAPI* pImmEscapeA) (HKL, HIMC, UINT, LPVOID);
- LRESULT (WINAPI* pImmEscapeW) (HKL, HIMC, UINT, LPVOID);
- LONG (WINAPI* pImmGetCompositionStringA) (HIMC, DWORD, LPVOID, DWORD);
- LONG (WINAPI* pImmGetCompositionStringW) (HIMC, DWORD, LPVOID, DWORD);
- BOOL (WINAPI* pImmGetCompositionFontA) (HIMC, LPLOGFONTA);
- BOOL (WINAPI* pImmGetCompositionFontW) (HIMC, LPLOGFONTW);
- BOOL (WINAPI* pImmSetCompositionFontA)(HIMC, LPLOGFONTA);
- BOOL (WINAPI* pImmSetCompositionFontW)(HIMC, LPLOGFONTW);
- BOOL (WINAPI* pImmGetCompositionWindow) (HIMC, LPCOMPOSITIONFORM);
- BOOL (WINAPI* pImmSetCompositionWindow) (HIMC, LPCOMPOSITIONFORM);
- HIMC (WINAPI* pImmAssociateContext) (HWND, HIMC);
- BOOL (WINAPI* pImmReleaseContext) (HWND, HIMC);
- HIMC (WINAPI* pImmGetContext) (HWND);
- HWND (WINAPI* pImmGetDefaultIMEWnd) (HWND);
- BOOL (WINAPI* pImmNotifyIME) (HIMC, DWORD, DWORD, DWORD);
- BOOL (WINAPI* pImmRegisterClient) (PVOID, HINSTANCE);
- UINT (WINAPI* pImmProcessKey) (HWND, HKL, UINT, LPARAM, DWORD);
-
+#undef DEFINE_IMM_ENTRY
+#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
+ FN_##name p##name;
+#include "immtable.h"
} Imm32ApiTable;
-
/* global variables */
extern HINSTANCE User32Instance;
#define user32_module User32Instance
@@ -61,6 +54,8 @@ extern HINSTANCE ghmodUserApiHook;
extern HICON hIconSmWindows, hIconWindows;
extern Imm32ApiTable gImmApiEntries;
+#define IMM_FN(name) gImmApiEntries.p##name
+
#define IS_ATOM(x) \
(((ULONG_PTR)(x) > 0x0) && ((ULONG_PTR)(x) < 0x10000))
diff --git a/win32ss/user/user32/misc/imm.c b/win32ss/user/user32/misc/imm.c
index b06bb5da1d8..03e040230a9 100644
--- a/win32ss/user/user32/misc/imm.c
+++ b/win32ss/user/user32/misc/imm.c
@@ -3,46 +3,35 @@
* PROJECT: ReactOS user32.dll
* FILE: win32ss/user/user32/misc/imm.c
* PURPOSE: User32.dll Imm functions
- * PROGRAMMER: Dmitry Chapyshev (dmitry(a)reactos.org)
+ * PROGRAMMERS: Dmitry Chapyshev (dmitry(a)reactos.org)
+ * Katayama Hirofumi MZ (katayama.hirofumi.mz(a)gmail.com)
* UPDATE HISTORY:
* 01/27/2009 Created
*/
#include <user32.h>
-
-#include <winnls32.h>
#include <strsafe.h>
WINE_DEFAULT_DEBUG_CHANNEL(user32);
#define IMM_INIT_MAGIC 0x19650412
-
-Imm32ApiTable gImmApiEntries = {0};
HINSTANCE ghImm32 = NULL;
BOOL bImmInitializing = FALSE;
-BOOL ImmApiTableZero = TRUE;
+/* define stub functions */
+#undef DEFINE_IMM_ENTRY
+#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
+ static type WINAPI IMMSTUB_##name params { IMM_RETURN_##retkind((type)retval); }
+#include "immtable.h"
-/*
- * This function should not be implemented, it is used,
- * if you can not load function from imm32.dll
- */
-BOOL WINAPI IMM_ImmIsIME(HKL hKL) { return 0; }
-HIMC WINAPI IMM_ImmAssociateContext(HWND hwnd, HIMC himc) { return 0; }
-BOOL WINAPI IMM_ImmReleaseContext(HWND hwnd, HIMC himc) { return 0; }
-LRESULT WINAPI IMM_ImmEscapeAW(HKL hkl, HIMC himc, UINT uint, LPVOID lpvoid) { return 0;
}
-LONG WINAPI IMM_ImmGetCompositionStringAW(HIMC himc, DWORD dword1, LPVOID lpvoid, DWORD
dword2) { return 0; }
-BOOL WINAPI IMM_ImmGetCompositionFontA(HIMC himc, LPLOGFONTA lplf) { return 0; }
-BOOL WINAPI IMM_ImmGetCompositionFontW(HIMC himc, LPLOGFONTW lplf) { return 0; }
-BOOL WINAPI IMM_ImmSetCompositionFontA(HIMC himc, LPLOGFONTA lplf) { return 0; }
-BOOL WINAPI IMM_ImmSetCompositionFontW(HIMC himc, LPLOGFONTW lplf) { return 0; }
-BOOL WINAPI IMM_ImmSetGetCompositionWindow(HIMC himc, LPCOMPOSITIONFORM lpcf) { return 0;
}
-HIMC WINAPI IMM_ImmGetContext(HWND hwnd) { return 0; }
-HWND WINAPI IMM_ImmGetDefaultIMEWnd(HWND hwnd) { return 0; }
-BOOL WINAPI IMM_ImmNotifyIME(HIMC himc, DWORD dword1, DWORD dword2, DWORD dword3) {
return 0; }
-BOOL WINAPI IMM_ImmRegisterClient(PVOID ptr, HINSTANCE hMod) { return 0; }
-UINT WINAPI IMM_ImmProcessKey(HWND hwnd, HKL hkl, UINT Vk, LPARAM lParam, DWORD HotKey) {
return 0; }
+Imm32ApiTable gImmApiEntries = {
+/* initialize by stubs */
+#undef DEFINE_IMM_ENTRY
+#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
+ IMMSTUB_##name,
+#include "immtable.h"
+};
HRESULT WINAPI GetImmFileName(PWSTR lpBuffer, UINT uSize)
{
@@ -66,11 +55,8 @@ BOOL WINAPI IntInitializeImmEntryTable(VOID)
WCHAR ImmFile[MAX_PATH];
HMODULE imm32 = ghImm32;
- if (gImmApiEntries.pImmIsIME != 0)
- {
- ERR("Imm Api Table Init 1\n");
- return TRUE;
- }
+ if (IMM_FN(ImmWINNLSEnableIME) != IMMSTUB_ImmWINNLSEnableIME)
+ return TRUE;
GetImmFileName(ImmFile, sizeof(ImmFile));
TRACE("File %ws\n",ImmFile);
@@ -91,91 +77,16 @@ BOOL WINAPI IntInitializeImmEntryTable(VOID)
return TRUE;
}
- if (ImmApiTableZero)
- {
- ImmApiTableZero = FALSE;
- ZeroMemory(&gImmApiEntries, sizeof(Imm32ApiTable));
- }
-
- gImmApiEntries.pImmIsIME = (BOOL (WINAPI*)(HKL)) GetProcAddress(imm32,
"ImmIsIME");
- if (!gImmApiEntries.pImmIsIME)
- gImmApiEntries.pImmIsIME = IMM_ImmIsIME;
-
- gImmApiEntries.pImmEscapeA = (LRESULT (WINAPI*)(HKL, HIMC, UINT, LPVOID))
GetProcAddress(imm32, "ImmEscapeA");
- if (!gImmApiEntries.pImmEscapeA)
- gImmApiEntries.pImmEscapeA = IMM_ImmEscapeAW;
-
- gImmApiEntries.pImmEscapeW = (LRESULT (WINAPI*)(HKL, HIMC, UINT, LPVOID))
GetProcAddress(imm32, "ImmEscapeW");
- if (!gImmApiEntries.pImmEscapeW)
- gImmApiEntries.pImmEscapeW = IMM_ImmEscapeAW;
-
- gImmApiEntries.pImmGetCompositionStringA = (LONG (WINAPI*)(HIMC, DWORD, LPVOID,
DWORD)) GetProcAddress(imm32, "ImmGetCompositionStringA");
- if (!gImmApiEntries.pImmGetCompositionStringA)
- gImmApiEntries.pImmGetCompositionStringA = IMM_ImmGetCompositionStringAW;
-
- gImmApiEntries.pImmGetCompositionStringW = (LONG (WINAPI*)(HIMC, DWORD, LPVOID,
DWORD)) GetProcAddress(imm32, "ImmGetCompositionStringW");
- if (!gImmApiEntries.pImmGetCompositionStringW)
- gImmApiEntries.pImmGetCompositionStringW = IMM_ImmGetCompositionStringAW;
-
- gImmApiEntries.pImmGetCompositionFontA = (BOOL (WINAPI*)(HIMC, LPLOGFONTA))
GetProcAddress(imm32, "ImmGetCompositionFontA");
- if (!gImmApiEntries.pImmGetCompositionFontA)
- gImmApiEntries.pImmGetCompositionFontA = IMM_ImmGetCompositionFontA;
-
- gImmApiEntries.pImmGetCompositionFontW = (BOOL (WINAPI*)(HIMC, LPLOGFONTW))
GetProcAddress(imm32, "ImmGetCompositionFontW");
- if (!gImmApiEntries.pImmGetCompositionFontW)
- gImmApiEntries.pImmGetCompositionFontW = IMM_ImmGetCompositionFontW;
-
- gImmApiEntries.pImmSetCompositionFontA = (BOOL (WINAPI*)(HIMC, LPLOGFONTA))
GetProcAddress(imm32, "ImmSetCompositionFontA");
- if (!gImmApiEntries.pImmSetCompositionFontA)
- gImmApiEntries.pImmSetCompositionFontA = IMM_ImmSetCompositionFontA;
-
- gImmApiEntries.pImmSetCompositionFontW = (BOOL (WINAPI*)(HIMC, LPLOGFONTW))
GetProcAddress(imm32, "ImmSetCompositionFontW");
- if (!gImmApiEntries.pImmSetCompositionFontW)
- gImmApiEntries.pImmSetCompositionFontW = IMM_ImmSetCompositionFontW;
-
- gImmApiEntries.pImmGetCompositionWindow = (BOOL (WINAPI*)(HIMC, LPCOMPOSITIONFORM))
GetProcAddress(imm32, "ImmGetCompositionWindow");
- if (!gImmApiEntries.pImmGetCompositionWindow)
- gImmApiEntries.pImmGetCompositionWindow = IMM_ImmSetGetCompositionWindow;
-
- gImmApiEntries.pImmSetCompositionWindow = (BOOL (WINAPI*)(HIMC, LPCOMPOSITIONFORM))
GetProcAddress(imm32, "ImmSetCompositionWindow");
- if (!gImmApiEntries.pImmSetCompositionWindow)
- gImmApiEntries.pImmSetCompositionWindow = IMM_ImmSetGetCompositionWindow;
-
- gImmApiEntries.pImmAssociateContext = (HIMC (WINAPI*)(HWND, HIMC))
GetProcAddress(imm32, "ImmAssociateContext");
- if (!gImmApiEntries.pImmAssociateContext)
- gImmApiEntries.pImmAssociateContext = IMM_ImmAssociateContext;
-
- gImmApiEntries.pImmReleaseContext = (BOOL (WINAPI*)(HWND, HIMC))
GetProcAddress(imm32, "ImmReleaseContext");
- if (!gImmApiEntries.pImmReleaseContext)
- gImmApiEntries.pImmReleaseContext = IMM_ImmReleaseContext;
-
- gImmApiEntries.pImmGetContext = (HIMC (WINAPI*)(HWND)) GetProcAddress(imm32,
"ImmGetContext");
- if (!gImmApiEntries.pImmGetContext)
- gImmApiEntries.pImmGetContext = IMM_ImmGetContext;
-
- gImmApiEntries.pImmGetDefaultIMEWnd = (HWND (WINAPI*)(HWND)) GetProcAddress(imm32,
"ImmGetDefaultIMEWnd");
- if (!gImmApiEntries.pImmGetDefaultIMEWnd)
- gImmApiEntries.pImmGetDefaultIMEWnd = IMM_ImmGetDefaultIMEWnd;
-
- gImmApiEntries.pImmNotifyIME = (BOOL (WINAPI*)(HIMC, DWORD, DWORD, DWORD))
GetProcAddress(imm32, "ImmNotifyIME");
- if (!gImmApiEntries.pImmNotifyIME)
- gImmApiEntries.pImmNotifyIME = IMM_ImmNotifyIME;
-
- /*
- * TODO: Load more functions from imm32.dll
- * Function like IMPSetIMEW, IMPQueryIMEW etc. call functions
- * from imm32.dll through pointers in the structure gImmApiEntries.
- * I do not know whether it is necessary to initialize a table
- * of functions to load user32 (DLL_PROCESS_ATTACH)
- */
-
- gImmApiEntries.pImmRegisterClient = (BOOL (WINAPI*)(PVOID, HINSTANCE))
GetProcAddress(imm32, "ImmRegisterClient");
- if (!gImmApiEntries.pImmRegisterClient)
- gImmApiEntries.pImmRegisterClient = IMM_ImmRegisterClient;
-
- gImmApiEntries.pImmProcessKey = (UINT (WINAPI*)(HWND, HKL, UINT, LPARAM, DWORD))
GetProcAddress(imm32, "ImmProcessKey");
- if (!gImmApiEntries.pImmProcessKey)
- gImmApiEntries.pImmProcessKey = IMM_ImmProcessKey;
+/* load imm procedures */
+#undef DEFINE_IMM_ENTRY
+#define DEFINE_IMM_ENTRY(type, name, params, retval, retkind) \
+ do { \
+ FN_##name proc = (FN_##name)GetProcAddress(imm32, #name); \
+ if (proc) { \
+ IMM_FN(name) = proc; \
+ } \
+ } while (0);
+#include "immtable.h"
return TRUE;
}
@@ -212,12 +123,7 @@ BOOL WINAPI User32InitializeImmEntryTable(DWORD magic)
return FALSE;
}
}
-#if 0 // For real Imm32.dll testing!!!!
- if (ghImm32 && !gImmApiEntries.pImmRegisterClient(&gSharedInfo,
ghImm32))
- {
- ERR("Wine is stubed!\n");
- }
-#endif
+
return TRUE;
}
@@ -349,113 +255,103 @@ BOOL WINAPI CliImmSetHotKey(DWORD dwID, UINT uModifiers, UINT
uVirtualKey, HKL h
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
IMPSetIMEW(HWND hwnd, LPIMEPROW ime)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmIMPSetIMEW)(hwnd, ime);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
IMPQueryIMEW(LPIMEPROW ime)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmIMPQueryIMEW)(ime);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
IMPGetIMEW(HWND hwnd, LPIMEPROW ime)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmIMPGetIMEW)(hwnd, ime);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
IMPSetIMEA(HWND hwnd, LPIMEPROA ime)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmIMPSetIMEA)(hwnd, ime);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
IMPQueryIMEA(LPIMEPROA ime)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmIMPQueryIMEA)(ime);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
IMPGetIMEA(HWND hwnd, LPIMEPROA ime)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmIMPGetIMEA)(hwnd, ime);
}
/*
- * @unimplemented
+ * @implemented
*/
LRESULT
WINAPI
-SendIMEMessageExW(HWND hwnd, LPARAM lparam)
+SendIMEMessageExW(HWND hwnd, LPARAM lParam)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmSendIMEMessageExW)(hwnd, lParam);
}
/*
- * @unimplemented
+ * @implemented
*/
LRESULT
WINAPI
-SendIMEMessageExA(HWND hwnd, LPARAM lparam)
+SendIMEMessageExA(HWND hwnd, LPARAM lParam)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmSendIMEMessageExA)(hwnd, lParam);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
WINNLSEnableIME(HWND hwnd, BOOL enable)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmWINNLSEnableIME)(hwnd, enable);
}
/*
- * @unimplemented
+ * @implemented
*/
BOOL
WINAPI
WINNLSGetEnableStatus(HWND hwnd)
{
- UNIMPLEMENTED;
- return FALSE;
+ return IMM_FN(ImmWINNLSGetEnableStatus)(hwnd);
}
/*
diff --git a/win32ss/user/user32/misc/immtable.h b/win32ss/user/user32/misc/immtable.h
deleted file mode 100644
index d0cbdc2e4a5..00000000000
--- a/win32ss/user/user32/misc/immtable.h
+++ /dev/null
@@ -1,52 +0,0 @@
-DEFINE_IMM_ENTRY(BOOL, ImmWINNLSEnableIME, (HWND, BOOL))
-DEFINE_IMM_ENTRY(BOOL, ImmWINNLSGetEnableStatus, (HWND))
-DEFINE_IMM_ENTRY(LRESULT, ImmSendIMEMessageExW, (HWND, LPARAM))
-DEFINE_IMM_ENTRY(LRESULT, ImmSendIMEMessageExA, (HWND, LPARAM))
-DEFINE_IMM_ENTRY(BOOL, ImmIMPGetIMEW, (HWND, LPIMEPROW))
-DEFINE_IMM_ENTRY(BOOL, ImmIMPGetIMEA, (HWND, LPIMEPROA))
-DEFINE_IMM_ENTRY(BOOL, ImmIMPQueryIMEW, (LPIMEPROW))
-DEFINE_IMM_ENTRY(BOOL, ImmIMPQueryIMEA, (LPIMEPROA))
-DEFINE_IMM_ENTRY(BOOL, ImmIMPSetIMEW, (HWND, LPIMEPROW))
-DEFINE_IMM_ENTRY(BOOL, ImmIMPSetIMEA, (HWND, LPIMEPROA))
-DEFINE_IMM_ENTRY(HIMC, ImmAssociateContext, (HWND, HIMC))
-DEFINE_IMM_ENTRY(LRESULT, ImmEscapeA, (HKL, HIMC, UINT, LPVOID))
-DEFINE_IMM_ENTRY(LRESULT, ImmEscapeW, (HKL, HIMC, UINT, LPVOID))
-DEFINE_IMM_ENTRY(LONG, ImmGetCompositionStringA, (HIMC, DWORD, LPVOID, DWORD))
-DEFINE_IMM_ENTRY(LONG, ImmGetCompositionStringW, (HIMC, DWORD, LPVOID, DWORD))
-DEFINE_IMM_ENTRY(BOOL, ImmGetCompositionWindow, (HIMC, LPCOMPOSITIONFORM))
-DEFINE_IMM_ENTRY(HIMC, ImmGetContext, (HWND))
-DEFINE_IMM_ENTRY(HWND, ImmGetDefaultIMEWnd, (HWND))
-DEFINE_IMM_ENTRY(BOOL, ImmIsIME, (HKL))
-DEFINE_IMM_ENTRY(BOOL, ImmReleaseContext, (HWND, HIMC))
-DEFINE_IMM_ENTRY(BOOL, ImmRegisterClient, (/*PSHAREDINFO*/ LPVOID, HINSTANCE))
-DEFINE_IMM_ENTRY(BOOL, ImmGetCompositionFontW, (HIMC, LPLOGFONTW))
-DEFINE_IMM_ENTRY(BOOL, ImmGetCompositionFontA, (HIMC, LPLOGFONTA))
-DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionFontW, (HIMC, LPLOGFONTW))
-DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionFontA, (HIMC, LPLOGFONTA))
-DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionWindow, (HIMC, LPCOMPOSITIONFORM))
-DEFINE_IMM_ENTRY(BOOL, ImmNotifyIME, (HIMC, DWORD, DWORD, DWORD))
-DEFINE_IMM_ENTRY(PINPUTCONTEXT, ImmLockIMC, (HIMC))
-DEFINE_IMM_ENTRY(BOOL, ImmUnlockIMC, (HIMC))
-DEFINE_IMM_ENTRY(BOOL, ImmLoadIME, (HKL))
-DEFINE_IMM_ENTRY(BOOL, ImmSetOpenStatus, (HIMC, BOOL))
-DEFINE_IMM_ENTRY(BOOL, ImmFreeLayout, (DWORD))
-DEFINE_IMM_ENTRY(BOOL, ImmActivateLayout, (HKL))
-DEFINE_IMM_ENTRY(BOOL, ImmSetCandidateWindow, (HIMC, LPCANDIDATEFORM))
-DEFINE_IMM_ENTRY(BOOL, ImmConfigureIMEW, (HKL, HWND, DWORD, LPVOID))
-DEFINE_IMM_ENTRY(BOOL, ImmGetConversionStatus, (HIMC, LPDWORD, LPDWORD))
-DEFINE_IMM_ENTRY(BOOL, ImmSetConversionStatus, (HIMC, DWORD, DWORD))
-DEFINE_IMM_ENTRY(BOOL, ImmSetStatusWindowPos, (HIMC, LPPOINT))
-DEFINE_IMM_ENTRY(BOOL, ImmGetImeInfoEx, (PIMEINFOEX, IMEINFOEXCLASS, LPVOID))
-DEFINE_IMM_ENTRY(PIMEDPI, ImmLockImeDpi, (HKL))
-DEFINE_IMM_ENTRY(VOID, ImmUnlockImeDpi, (/*PIMEDPI*/ LPVOID))
-DEFINE_IMM_ENTRY(BOOL, ImmGetOpenStatus, (HIMC))
-DEFINE_IMM_ENTRY(BOOL, ImmSetActiveContext, (HWND, HIMC, BOOL))
-DEFINE_IMM_ENTRY(BOOL, ImmTranslateMessage, (HWND, UINT, WPARAM, LPARAM))
-DEFINE_IMM_ENTRY(BOOL, ImmLoadLayout, (HKL, PIMEINFOEX))
-DEFINE_IMM_ENTRY(DWORD, ImmProcessKey, (HWND, HKL, UINT, LPARAM, DWORD))
-DEFINE_IMM_ENTRY(LRESULT, ImmPutImeMenuItemsIntoMappedFile, (HIMC))
-DEFINE_IMM_ENTRY(DWORD, ImmGetProperty, (HKL, DWORD))
-DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionStringA, (HIMC, DWORD, LPCVOID, DWORD, LPCVOID,
DWORD))
-DEFINE_IMM_ENTRY(BOOL, ImmSetCompositionStringW, (HIMC, DWORD, LPCVOID, DWORD, LPCVOID,
DWORD))
-DEFINE_IMM_ENTRY(BOOL, ImmEnumInputContext, (DWORD, IMCENUMPROC, LPARAM))
-DEFINE_IMM_ENTRY(LRESULT, ImmSystemHandler, (HIMC, WPARAM, LPARAM))