Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

485 lines
17 KiB

  1. /**************************************************************************\
  2. * Module Name: fareast.c
  3. *
  4. * Win32 IMM/IME API functions
  5. *
  6. * Copyright (c) 1985 - 1999, Microsoft Corporation
  7. *
  8. * History:
  9. * 07-May-1996 takaok Created.
  10. \**************************************************************************/
  11. #include "precomp.h"
  12. #pragma hdrstop
  13. #define COMMON_RETURN_ZERO \
  14. return 0;
  15. ////////////////////////
  16. // Fake routines
  17. ////////////////////////
  18. VOID fakeImm_v1(PVOID dummy)
  19. {
  20. UNREFERENCED_PARAMETER(dummy);
  21. }
  22. #ifdef CUAS_ENABLE
  23. VOID fakeImm_vd1(DWORD dummy)
  24. {
  25. UNREFERENCED_PARAMETER(dummy);
  26. };
  27. #endif // CUAS_ENABLE
  28. DWORD fakeImm_d1(DWORD dummy)
  29. {
  30. UNREFERENCED_PARAMETER(dummy);
  31. return 0;
  32. }
  33. #ifdef CUAS_ENABLE
  34. DWORD fakeImm_dv1(VOID)
  35. {
  36. return 0;
  37. };
  38. #endif // CUAS_ENABLE
  39. VOID fakeImm_v2(PVOID dummy1, PVOID dummy2)
  40. {
  41. UNREFERENCED_PARAMETER(dummy1);
  42. UNREFERENCED_PARAMETER(dummy2);
  43. }
  44. DWORD fakeImm_d2(DWORD dummy1, DWORD dummy2)
  45. {
  46. UNREFERENCED_PARAMETER(dummy1);
  47. UNREFERENCED_PARAMETER(dummy2);
  48. return 0;
  49. }
  50. DWORD fakeImm_d3(DWORD dummy1, DWORD dummy2, DWORD dummy3)
  51. {
  52. UNREFERENCED_PARAMETER(dummy1);
  53. UNREFERENCED_PARAMETER(dummy2);
  54. UNREFERENCED_PARAMETER(dummy3);
  55. return 0;
  56. }
  57. DWORD fakeImm_bwuwl(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
  58. {
  59. UNREFERENCED_PARAMETER(hwnd);
  60. UNREFERENCED_PARAMETER(msg);
  61. UNREFERENCED_PARAMETER(wParam);
  62. UNREFERENCED_PARAMETER(lParam);
  63. return 0;
  64. }
  65. VOID WINAPI fakeImm_wv1(PVOID dummy)
  66. {
  67. UNREFERENCED_PARAMETER(dummy);
  68. }
  69. DWORD WINAPI fakeImm_wd1(PVOID dummy)
  70. {
  71. UNREFERENCED_PARAMETER(dummy);
  72. COMMON_RETURN_ZERO;
  73. }
  74. DWORD WINAPI fakeImm_wd2(PVOID dummy1, PVOID dummy2)
  75. {
  76. UNREFERENCED_PARAMETER(dummy1);
  77. UNREFERENCED_PARAMETER(dummy2);
  78. COMMON_RETURN_ZERO;
  79. }
  80. //
  81. // This stub returns true.
  82. //
  83. BOOL WINAPI fakeImm_bd2(PVOID dummy1, PVOID dummy2)
  84. {
  85. UNREFERENCED_PARAMETER(dummy1);
  86. UNREFERENCED_PARAMETER(dummy2);
  87. return TRUE;
  88. }
  89. DWORD WINAPI fakeImm_wd3(PVOID dummy1, PVOID dummy2, PVOID dummy3)
  90. {
  91. UNREFERENCED_PARAMETER(dummy1);
  92. UNREFERENCED_PARAMETER(dummy2);
  93. UNREFERENCED_PARAMETER(dummy3);
  94. COMMON_RETURN_ZERO;
  95. }
  96. DWORD WINAPI fakeImm_wd4(PVOID dummy1, PVOID dummy2, PVOID dummy3, PVOID dummy4)
  97. {
  98. UNREFERENCED_PARAMETER(dummy1);
  99. UNREFERENCED_PARAMETER(dummy2);
  100. UNREFERENCED_PARAMETER(dummy3);
  101. UNREFERENCED_PARAMETER(dummy4);
  102. COMMON_RETURN_ZERO;
  103. }
  104. DWORD WINAPI fakeImm_wd5(PVOID dummy1, PVOID dummy2, PVOID dummy3, PVOID dummy4, PVOID dummy5)
  105. {
  106. UNREFERENCED_PARAMETER(dummy1);
  107. UNREFERENCED_PARAMETER(dummy2);
  108. UNREFERENCED_PARAMETER(dummy3);
  109. UNREFERENCED_PARAMETER(dummy4);
  110. UNREFERENCED_PARAMETER(dummy5);
  111. COMMON_RETURN_ZERO;
  112. }
  113. DWORD WINAPI fakeImm_wd6(PVOID dummy1, PVOID dummy2, PVOID dummy3, PVOID dummy4, PVOID dummy5, PVOID dummy6)
  114. {
  115. UNREFERENCED_PARAMETER(dummy1);
  116. UNREFERENCED_PARAMETER(dummy2);
  117. UNREFERENCED_PARAMETER(dummy3);
  118. UNREFERENCED_PARAMETER(dummy4);
  119. UNREFERENCED_PARAMETER(dummy5);
  120. UNREFERENCED_PARAMETER(dummy6);
  121. COMMON_RETURN_ZERO;
  122. }
  123. ImmApiEntries gImmApiEntries = {
  124. (BOOL (WINAPI* /*ImmWINNLSEnableIME*/)(HWND, BOOL)) fakeImm_wd2,
  125. (BOOL (WINAPI* /*ImmWINNLSGetEnableStatus*/)(HWND)) fakeImm_wd1,
  126. (LRESULT (WINAPI* /*SendIMEMessageExW*/)(HWND, LPARAM)) fakeImm_wd2,
  127. (LRESULT (WINAPI* /*SendIMEMessageExA*/)(HWND, LPARAM)) fakeImm_wd2,
  128. (BOOL (WINAPI* /*IMPGetIMEW*/)(HWND, LPIMEPROW)) fakeImm_wd2,
  129. (BOOL (WINAPI* /*IMPGetIMEA*/)(HWND, LPIMEPROA)) fakeImm_wd2,
  130. (BOOL (WINAPI* /*IMPQueryIMEW*/)(LPIMEPROW)) fakeImm_wd1,
  131. (BOOL (WINAPI* /*IMPQueryIMEA*/)(LPIMEPROA)) fakeImm_wd1,
  132. (BOOL (WINAPI* /*IMPSetIMEW*/)(HWND, LPIMEPROW)) fakeImm_wd2,
  133. (BOOL (WINAPI* /*IMPSetIMEA*/)(HWND, LPIMEPROA)) fakeImm_wd2,
  134. (HIMC (WINAPI* /*ImmAssociateContext*/)(HWND, HIMC)) fakeImm_wd2,
  135. (LRESULT (WINAPI* /*ImmEscapeA*/)(HKL, HIMC, UINT, LPVOID)) fakeImm_wd4,
  136. (LRESULT (WINAPI* /*ImmEscapeW*/)(HKL, HIMC, UINT, LPVOID)) fakeImm_wd4,
  137. (LONG (WINAPI* /*ImmGetCompositionStringA*/)(HIMC, DWORD, LPVOID, DWORD)) fakeImm_wd4,
  138. (LONG (WINAPI* /*ImmGetCompositionStringW*/)(HIMC, DWORD, LPVOID, DWORD)) fakeImm_wd4,
  139. (BOOL (WINAPI* /*ImmGetCompositionWindow*/)(HIMC, LPCOMPOSITIONFORM)) fakeImm_wd2,
  140. (HIMC (WINAPI* /*ImmGetContext*/)(HWND)) fakeImm_wd1,
  141. (HWND (WINAPI* /*ImmGetDefaultIMEWnd*/)(HWND)) fakeImm_wd1,
  142. (BOOL (WINAPI* /*ImmIsIME*/)(HKL)) fakeImm_wd1,
  143. (BOOL (WINAPI* /*ImmReleaseContext*/)(HWND, HIMC)) fakeImm_wd2,
  144. (BOOL (* /*ImmRegisterClient*/)(PSHAREDINFO, HINSTANCE)) fakeImm_bd2,
  145. (BOOL (WINAPI* /*ImmGetCompositionFontW*/)(HIMC, LPLOGFONTW)) fakeImm_wd2,
  146. (BOOL (WINAPI* /*ImmGetCompositionFontA*/)(HIMC, LPLOGFONTA)) fakeImm_wd2,
  147. (BOOL (WINAPI* /*ImmSetCompositionFontW*/)(HIMC, LPLOGFONTW)) fakeImm_wd2,
  148. (BOOL (WINAPI* /*ImmSetCompositionFontA*/)(HIMC, LPLOGFONTA)) fakeImm_wd2,
  149. (BOOL (WINAPI* /*ImmSetCompositionWindow*/)(HIMC, LPCOMPOSITIONFORM)) fakeImm_wd2,
  150. (BOOL (WINAPI* /*ImmNotifyIME*/)(HIMC, DWORD, DWORD, DWORD)) fakeImm_wd4,
  151. (PINPUTCONTEXT (WINAPI* /*ImmLockIMC*/)(HIMC)) fakeImm_wd1,
  152. (BOOL (WINAPI* /*ImmUnlockIMC*/)(HIMC)) fakeImm_wd1,
  153. (BOOL (WINAPI* /*ImmLoadIME*/)(HKL)) fakeImm_wd1,
  154. (BOOL (WINAPI* /*ImmSetOpenStatus*/)(HIMC, BOOL)) fakeImm_wd2,
  155. (BOOL (WINAPI* /*ImmFreeLayout*/)(DWORD dwFlag)) fakeImm_wd1,
  156. (BOOL (WINAPI* /*ImmActivateLayout*/)(HKL)) fakeImm_wd1,
  157. (BOOL (WINAPI* /*ImmGetCandidateWindow*/)(HIMC, DWORD, LPCANDIDATEFORM)) fakeImm_wd3,
  158. (BOOL (WINAPI* /*ImmSetCandidateWindow*/)(HIMC, LPCANDIDATEFORM)) fakeImm_wd2,
  159. (BOOL (WINAPI* /*ImmConfigureIMEW*/)(HKL, HWND, DWORD, LPVOID)) fakeImm_wd4,
  160. (BOOL (WINAPI* /*ImmGetConversionStatus*/)(HIMC, LPDWORD, LPDWORD)) fakeImm_wd3,
  161. (BOOL (WINAPI* /*ImmSetConversionStatus*/)(HIMC, DWORD, DWORD)) fakeImm_wd3,
  162. (BOOL (WINAPI* /*ImmSetStatusWindowPos*/)(HIMC, LPPOINT)) fakeImm_wd2,
  163. (BOOL (WINAPI* /*ImmGetImeInfoEx*/)(PIMEINFOEX, IMEINFOEXCLASS, PVOID)) fakeImm_wd3,
  164. (PIMEDPI (WINAPI* /*ImmLockImeDpi*/)(HKL)) fakeImm_wd1,
  165. (VOID (WINAPI* /*ImmUnlockImeDpi*/)(PIMEDPI)) fakeImm_wv1,
  166. (BOOL (WINAPI* /*ImmGetOpenStatus*/)(HIMC)) fakeImm_wd1,
  167. (BOOL (* /*ImmSetActiveContext*/)(HWND, HIMC, BOOL)) fakeImm_d3,
  168. (BOOL (* /*ImmTranslateMessage*/)(HWND, UINT, WPARAM, LPARAM)) fakeImm_bwuwl,
  169. (BOOL (* /*ImmLoadLayout*/)(HKL, PIMEINFOEX)) fakeImm_d2,
  170. (DWORD (WINAPI* /*ImmProcessKey*/)(HWND, HKL, UINT, LPARAM, DWORD)) fakeImm_wd5,
  171. (LRESULT (* /*ImmPutImeMenuItemsIntoMappedFile*/)(HIMC)) fakeImm_d1,
  172. (DWORD (WINAPI* /*ImmGetProperty*/)(HKL, DWORD)) fakeImm_wd2,
  173. (BOOL (WINAPI* /*ImmSetCompositionStringA*/)(
  174. HIMC hImc, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen))
  175. fakeImm_wd6,
  176. (BOOL (WINAPI* /*ImmSetCompositionStringW*/)(
  177. HIMC hImc, DWORD dwIndex, LPCVOID lpComp, DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen))
  178. fakeImm_wd6,
  179. (BOOL (WINAPI* /*ImmEnumInputContext*/)(
  180. DWORD idThread, IMCENUMPROC lpfn, LPARAM lParam)) fakeImm_wd3,
  181. (LRESULT (WINAPI* /*ImmSystemHandler*/)(HIMC, WPARAM, LPARAM))
  182. fakeImm_wd3,
  183. #ifdef CUAS_ENABLE
  184. // Cicero
  185. (HRESULT (WINAPI* /* CtfImmTIMActivate*/)(HKL)) fakeImm_wd1,
  186. (VOID (WINAPI* /* CtfImmRestoreToolbarWnd*/)(DWORD)) fakeImm_vd1,
  187. (DWORD (WINAPI* /* CtfImmHideToolbarWnd*/)(VOID)) fakeImm_dv1,
  188. (LRESULT (WINAPI* /* CtfImmDispatchDefImeMessage*/)(HWND, UINT, WPARAM, LPARAM)) fakeImm_bwuwl,
  189. #endif // CUAS_ENABLE
  190. };
  191. //
  192. // Imm32's instance handle
  193. //
  194. // NULL if not initialized.
  195. //
  196. HMODULE ghImm32;
  197. #define IMMMODULENAME L"IMM32.DLL"
  198. #define PATHDLM L'\\'
  199. #define IMMMODULENAMELEN ((sizeof PATHDLM + sizeof IMMMODULENAME) / sizeof(WCHAR))
  200. VOID GetImmFileName(PWSTR wszImmFile)
  201. {
  202. UINT i = GetSystemDirectoryW(wszImmFile, MAX_PATH);
  203. if (i > 0 && i < MAX_PATH - IMMMODULENAMELEN) {
  204. wszImmFile += i;
  205. if (wszImmFile[-1] != PATHDLM) {
  206. *wszImmFile++ = PATHDLM;
  207. }
  208. }
  209. wcscpy(wszImmFile, IMMMODULENAME);
  210. }
  211. #define REGISTER(name,cast) \
  212. gImmApiEntries.name = (cast)GetProcAddress(hImm, #name); \
  213. if (gImmApiEntries.name == NULL) { \
  214. RIPMSG1(RIP_WARNING, "gImmApiEntries.%s got to be NULL", #name); \
  215. gImmApiEntries.name = (PVOID)fakeImm_v1; \
  216. return; \
  217. } else
  218. ///////////////////////////////////////////////////////
  219. // _InitializeImmEntryTable(HMODULE)
  220. //
  221. // Initialize IMM entry table:
  222. ///////////////////////////////////////////////////////
  223. VOID _InitializeImmEntryTable(VOID)
  224. {
  225. HMODULE hImm = ghImm32;
  226. WCHAR wszImmFile[MAX_PATH];
  227. if (((PVOID)gImmApiEntries.ImmWINNLSEnableIME) != ((PVOID)fakeImm_wd2)) {
  228. // already initialized.
  229. return;
  230. }
  231. GetImmFileName(wszImmFile);
  232. if (hImm == NULL) {
  233. // check if IMM DLL is already attached to the process
  234. hImm = GetModuleHandleW(wszImmFile);
  235. }
  236. if (hImm == NULL) {
  237. hImm = ghImm32 = LoadLibraryW(wszImmFile);
  238. if (hImm == NULL) {
  239. RIPMSG1(RIP_WARNING, "_InitializeImmEntryTable: failed to load Imm32.Dll: err=%d\n", GetLastError());
  240. return;
  241. }
  242. // at this point, Init routine of IMM32 has been called, thus User32InitializeImmEntry.. called.
  243. // all what we have to do is just return here.
  244. return;
  245. }
  246. if (hImm == NULL) {
  247. RIPMSG0(RIP_WARNING, "Failed to attach IMM32.DLL.\n");
  248. return;
  249. }
  250. // get the addresses of the procedures
  251. REGISTER(ImmWINNLSEnableIME, BOOL (WINAPI*)(HWND, BOOL));
  252. REGISTER(ImmWINNLSGetEnableStatus, BOOL (*)(HWND));
  253. REGISTER(ImmSendIMEMessageExW, LRESULT (*)(HWND, LPARAM));
  254. REGISTER(ImmSendIMEMessageExA, LRESULT (*)(HWND, LPARAM));
  255. REGISTER(ImmIMPGetIMEW, BOOL(*)(HWND, LPIMEPROW));
  256. REGISTER(ImmIMPGetIMEA, BOOL(*)(HWND, LPIMEPROA))
  257. REGISTER(ImmIMPQueryIMEW, BOOL(*)(LPIMEPROW))
  258. REGISTER(ImmIMPQueryIMEA, BOOL(*)(LPIMEPROA));
  259. REGISTER(ImmIMPSetIMEW, BOOL(*)(HWND, LPIMEPROW));
  260. REGISTER(ImmIMPSetIMEA, BOOL(*)(HWND, LPIMEPROA));
  261. REGISTER(ImmAssociateContext, HIMC (WINAPI*)(HWND, HIMC));
  262. REGISTER(ImmEscapeA, LRESULT(WINAPI*)(HKL, HIMC, UINT, LPVOID));
  263. REGISTER(ImmEscapeW, LRESULT(WINAPI*)(HKL, HIMC, UINT, LPVOID));
  264. REGISTER(ImmGetCompositionStringA, LONG (WINAPI*)(HIMC, DWORD, LPVOID, DWORD));
  265. REGISTER(ImmGetCompositionStringW, LONG (WINAPI*)(HIMC, DWORD, LPVOID, DWORD));
  266. REGISTER(ImmGetCompositionWindow, BOOL (WINAPI*)(HIMC, LPCOMPOSITIONFORM));
  267. REGISTER(ImmGetContext, HIMC (WINAPI*)(HWND));
  268. REGISTER(ImmGetDefaultIMEWnd, HWND (WINAPI*)(HWND));
  269. REGISTER(ImmIsIME, BOOL (WINAPI*)(HKL));
  270. REGISTER(ImmReleaseContext, BOOL (WINAPI*)(HWND, HIMC));
  271. REGISTER(ImmRegisterClient, BOOL(*)(PSHAREDINFO, HINSTANCE));
  272. REGISTER(ImmGetCompositionFontW, BOOL (WINAPI*)(HIMC, LPLOGFONTW));
  273. REGISTER(ImmGetCompositionFontA, BOOL (WINAPI*)(HIMC, LPLOGFONTA));
  274. REGISTER(ImmSetCompositionFontW, BOOL (WINAPI*)(HIMC, LPLOGFONTW));
  275. REGISTER(ImmSetCompositionFontA, BOOL (WINAPI*)(HIMC, LPLOGFONTA));
  276. REGISTER(ImmSetCompositionWindow, BOOL(WINAPI*)(HIMC, LPCOMPOSITIONFORM));
  277. REGISTER(ImmNotifyIME, BOOL (WINAPI*)(HIMC, DWORD, DWORD, DWORD));
  278. REGISTER(ImmLockIMC, PINPUTCONTEXT(WINAPI*)(HIMC));
  279. REGISTER(ImmUnlockIMC, BOOL (WINAPI*)(HIMC));
  280. REGISTER(ImmLoadIME, BOOL (WINAPI*)(HKL));
  281. REGISTER(ImmSetOpenStatus, BOOL (WINAPI*)(HIMC, BOOL));
  282. REGISTER(ImmFreeLayout, BOOL (WINAPI*)(DWORD));
  283. REGISTER(ImmActivateLayout, BOOL (WINAPI*)(HKL));
  284. REGISTER(ImmGetCandidateWindow, BOOL (WINAPI*)(HIMC, DWORD, LPCANDIDATEFORM));
  285. REGISTER(ImmSetCandidateWindow, BOOL (WINAPI*)(HIMC, LPCANDIDATEFORM));
  286. REGISTER(ImmConfigureIMEW, BOOL (WINAPI*)(HKL, HWND, DWORD, LPVOID));
  287. REGISTER(ImmGetConversionStatus, BOOL (WINAPI*)(HIMC, LPDWORD, LPDWORD));
  288. REGISTER(ImmSetConversionStatus, BOOL (WINAPI*)(HIMC, DWORD, DWORD));
  289. REGISTER(ImmSetStatusWindowPos, BOOL (WINAPI*)(HIMC, LPPOINT));
  290. REGISTER(ImmGetImeInfoEx, BOOL (WINAPI*)(PIMEINFOEX, IMEINFOEXCLASS, PVOID));
  291. REGISTER(ImmLockImeDpi, PIMEDPI (WINAPI*)(HKL));
  292. REGISTER(ImmUnlockImeDpi, VOID (WINAPI*)(PIMEDPI));
  293. REGISTER(ImmGetOpenStatus, BOOL (WINAPI*)(HIMC));
  294. REGISTER(ImmSetActiveContext, BOOL (*)(HWND, HIMC, BOOL));
  295. REGISTER(ImmTranslateMessage, BOOL (*)(HWND, UINT, WPARAM, LPARAM));
  296. REGISTER(ImmLoadLayout, BOOL (*)(HKL, PIMEINFOEX));
  297. REGISTER(ImmProcessKey, DWORD (*)(HWND, HKL, UINT, LPARAM, DWORD));
  298. REGISTER(ImmPutImeMenuItemsIntoMappedFile, LRESULT(*)(HIMC));
  299. REGISTER(ImmGetProperty, DWORD (WINAPI*)(HKL, DWORD));
  300. REGISTER(ImmSetCompositionStringA,
  301. BOOL (WINAPI*)(HIMC hImc, DWORD dwIndex, LPCVOID lpComp,
  302. DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen))
  303. REGISTER(ImmSetCompositionStringW,
  304. BOOL (WINAPI*)(HIMC hImc, DWORD dwIndex, LPCVOID lpComp,
  305. DWORD dwCompLen, LPCVOID lpRead, DWORD dwReadLen));
  306. REGISTER(ImmEnumInputContext,
  307. BOOL (WINAPI*)(DWORD idThread, IMCENUMPROC lpfn, LPARAM lParam));
  308. REGISTER(ImmSystemHandler,
  309. LRESULT (WINAPI*)(HIMC, WPARAM, LPARAM));
  310. #ifdef CUAS_ENABLE
  311. // Cicero
  312. REGISTER(CtfImmTIMActivate, HRESULT (WINAPI*)(HKL));
  313. REGISTER(CtfImmRestoreToolbarWnd, VOID (WINAPI*)(DWORD));
  314. REGISTER(CtfImmHideToolbarWnd, DWORD (WINAPI*)(VOID));
  315. REGISTER(CtfImmDispatchDefImeMessage, LRESULT (WINAPI*)(HWND, UINT, WPARAM, LPARAM));
  316. #endif // CUAS_ENABLE
  317. }
  318. BOOL bImmInitializing = FALSE;
  319. VOID InitializeImmEntryTable(VOID)
  320. {
  321. bImmInitializing = TRUE;
  322. _InitializeImmEntryTable();
  323. }
  324. FUNCLOG1(LOG_GENERAL, BOOL, DUMMYCALLINGTYPE, User32InitializeImmEntryTable, DWORD, magic)
  325. BOOL User32InitializeImmEntryTable(DWORD magic)
  326. {
  327. if (magic != IMM_MAGIC_CALLER_ID) {
  328. RIPMSG1(RIP_WARNING, "User32InitializeImmEntryTable: magic # does not match: 0x%08x", magic);
  329. return FALSE;
  330. }
  331. if (((PVOID)gImmApiEntries.ImmWINNLSEnableIME) != ((PVOID)fakeImm_wd2)) {
  332. // already initialized
  333. return TRUE;
  334. }
  335. _InitializeImmEntryTable();
  336. if (ghImm32 == NULL) {
  337. if (!bImmInitializing) {
  338. // increment the load counter of IMM32.DLL; application may call FreeLibrary later
  339. WCHAR wszImmFile[MAX_PATH];
  340. GetImmFileName(wszImmFile);
  341. ghImm32 = LoadLibraryW(wszImmFile);
  342. }
  343. }
  344. // for IMM initialization
  345. return fpImmRegisterClient(&gSharedInfo, ghImm32);
  346. }
  347. //
  348. // for historical reasons, these entries are put in user32.dll
  349. //
  350. FUNCLOG1(LOG_GENERAL, UINT, WINAPI, WINNLSGetIMEHotkey, HWND, hwndIme)
  351. UINT WINAPI WINNLSGetIMEHotkey(HWND hwndIme)
  352. {
  353. UNREFERENCED_PARAMETER(hwndIme);
  354. //
  355. // Win95/NT3.51 behavior, i.e. always return 0.
  356. //
  357. return 0;
  358. }
  359. FUNCLOG2(LOG_GENERAL, BOOL, WINAPI, WINNLSEnableIME, HWND, hwnd, BOOL, bFlag)
  360. BOOL WINAPI WINNLSEnableIME(HWND hwnd, BOOL bFlag)
  361. {
  362. return gImmApiEntries.ImmWINNLSEnableIME(hwnd, bFlag);
  363. }
  364. FUNCLOG1(LOG_GENERAL, BOOL, WINAPI, WINNLSGetEnableStatus, HWND, hwnd)
  365. BOOL WINAPI WINNLSGetEnableStatus(HWND hwnd)
  366. {
  367. return gImmApiEntries.ImmWINNLSGetEnableStatus(hwnd);
  368. }
  369. FUNCLOG2(LOG_GENERAL, LRESULT, WINAPI, SendIMEMessageExW, HWND, hwnd, LPARAM, lParam)
  370. LRESULT WINAPI SendIMEMessageExW(HWND hwnd, LPARAM lParam)
  371. {
  372. return gImmApiEntries.ImmSendIMEMessageExW(hwnd, lParam);
  373. }
  374. FUNCLOG2(LOG_GENERAL, LRESULT, WINAPI, SendIMEMessageExA, HWND, hwnd, LPARAM, lParam)
  375. LRESULT WINAPI SendIMEMessageExA(HWND hwnd, LPARAM lParam)
  376. {
  377. return gImmApiEntries.ImmSendIMEMessageExA(hwnd, lParam);
  378. }
  379. FUNCLOG2(LOG_GENERAL, BOOL, WINAPI, IMPGetIMEW, HWND, hwnd, LPIMEPROW, lpImeProW)
  380. BOOL WINAPI IMPGetIMEW(HWND hwnd, LPIMEPROW lpImeProW)
  381. {
  382. return gImmApiEntries.ImmIMPGetIMEW(hwnd, lpImeProW);
  383. }
  384. FUNCLOG2(LOG_GENERAL, BOOL, WINAPI, IMPGetIMEA, HWND, hwnd, LPIMEPROA, lpImeProA)
  385. BOOL WINAPI IMPGetIMEA(HWND hwnd, LPIMEPROA lpImeProA)
  386. {
  387. return gImmApiEntries.ImmIMPGetIMEA(hwnd, lpImeProA);
  388. }
  389. FUNCLOG1(LOG_GENERAL, BOOL, WINAPI, IMPQueryIMEW, LPIMEPROW, lpImeProW)
  390. BOOL WINAPI IMPQueryIMEW(LPIMEPROW lpImeProW)
  391. {
  392. return gImmApiEntries.ImmIMPQueryIMEW(lpImeProW);
  393. }
  394. FUNCLOG1(LOG_GENERAL, BOOL, WINAPI, IMPQueryIMEA, LPIMEPROA, lpImeProA)
  395. BOOL WINAPI IMPQueryIMEA(LPIMEPROA lpImeProA)
  396. {
  397. return gImmApiEntries.ImmIMPQueryIMEA(lpImeProA);
  398. }
  399. FUNCLOG2(LOG_GENERAL, BOOL, WINAPI, IMPSetIMEW, HWND, hwnd, LPIMEPROW, lpImeProW)
  400. BOOL WINAPI IMPSetIMEW(HWND hwnd, LPIMEPROW lpImeProW)
  401. {
  402. return gImmApiEntries.ImmIMPSetIMEW(hwnd, lpImeProW);
  403. }
  404. FUNCLOG2(LOG_GENERAL, BOOL, WINAPI, IMPSetIMEA, HWND, hwnd, LPIMEPROA, lpImeProA)
  405. BOOL WINAPI IMPSetIMEA(HWND hwnd, LPIMEPROA lpImeProA)
  406. {
  407. return gImmApiEntries.ImmIMPSetIMEA(hwnd, lpImeProA);
  408. }