|
39 | 39 | #include <ndk/pstypes.h>
|
40 | 40 | #include <ndk/rtlfuncs.h>
|
41 | 41 | #include "../../../win32ss/include/ntuser.h"
|
| 42 | +#include "../../../win32ss/include/ntwin32.h" |
42 | 43 | #include <imm32_undoc.h>
|
43 | 44 | #include <strsafe.h>
|
44 | 45 |
|
@@ -3608,29 +3609,67 @@ BOOL WINAPI ImmRegisterClient(PVOID ptr, /* FIXME: should point to SHAREDINFO st
|
3608 | 3609 | return TRUE;
|
3609 | 3610 | }
|
3610 | 3611 |
|
| 3612 | +/*********************************************************************** |
| 3613 | + * CtfImmIsTextFrameServiceDisabled(IMM32.@) |
| 3614 | + */ |
| 3615 | +BOOL WINAPI CtfImmIsTextFrameServiceDisabled(VOID) |
| 3616 | +{ |
| 3617 | + PTEB pTeb = NtCurrentTeb(); |
| 3618 | + if (((PW32CLIENTINFO)pTeb->Win32ClientInfo)->CI_flags & CI_TFSDISABLED) |
| 3619 | + return TRUE; |
| 3620 | + return FALSE; |
| 3621 | +} |
| 3622 | + |
3611 | 3623 | /***********************************************************************
|
3612 | 3624 | * ImmGetImeInfoEx (IMM32.@)
|
3613 | 3625 | */
|
| 3626 | + |
| 3627 | +static BOOL APIENTRY Imm32GetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType) |
| 3628 | +{ |
| 3629 | + return NtUserGetImeInfoEx(pImeInfoEx, SearchType); |
| 3630 | +} |
| 3631 | + |
3614 | 3632 | BOOL WINAPI
|
3615 | 3633 | ImmGetImeInfoEx(PIMEINFOEX pImeInfoEx,
|
3616 | 3634 | IMEINFOEXCLASS SearchType,
|
3617 | 3635 | PVOID pvSearchKey)
|
3618 | 3636 | {
|
| 3637 | + BOOL bDisabled = FALSE; |
| 3638 | + HKL hKL; |
| 3639 | + PTEB pTeb; |
| 3640 | + |
3619 | 3641 | switch (SearchType)
|
3620 | 3642 | {
|
3621 | 3643 | case ImeInfoExKeyboardLayout:
|
3622 |
| - pImeInfoEx->hkl = *(LPHKL)pvSearchKey; |
3623 |
| - if (!IS_IME_HKL(pImeInfoEx->hkl)) |
3624 |
| - return FALSE; |
3625 | 3644 | break;
|
3626 | 3645 |
|
3627 |
| - case ImeInfoExImeFileName: |
3628 |
| - lstrcpynW(pImeInfoEx->wszImeFile, (LPWSTR)pvSearchKey, |
3629 |
| - ARRAY_SIZE(pImeInfoEx->wszImeFile)); |
| 3646 | + case ImeInfoExImeWindow: |
| 3647 | + bDisabled = CtfImmIsTextFrameServiceDisabled(); |
| 3648 | + SearchType = ImeInfoExKeyboardLayout; |
3630 | 3649 | break;
|
3631 | 3650 |
|
3632 |
| - default: |
3633 |
| - return FALSE; |
| 3651 | + case ImeInfoExImeFileName: |
| 3652 | + StringCchCopyW(pImeInfoEx->wszImeFile, _countof(pImeInfoEx->wszImeFile), |
| 3653 | + pvSearchKey); |
| 3654 | + goto Quit; |
3634 | 3655 | }
|
3635 |
| - return NtUserGetImeInfoEx(pImeInfoEx, SearchType); |
| 3656 | + |
| 3657 | + hKL = *(HKL*)pvSearchKey; |
| 3658 | + pImeInfoEx->hkl = hKL; |
| 3659 | + |
| 3660 | + if (!IS_IME_HKL(hKL)) |
| 3661 | + { |
| 3662 | + if (g_dwImm32Flags & IMM32_FLAG_CICERO_ENABLED) |
| 3663 | + { |
| 3664 | + pTeb = NtCurrentTeb(); |
| 3665 | + if (((PW32CLIENTINFO)pTeb->Win32ClientInfo)->W32ClientInfo[0] & 2) |
| 3666 | + return FALSE; |
| 3667 | + if (!bDisabled) |
| 3668 | + goto Quit; |
| 3669 | + } |
| 3670 | + return FALSE; |
| 3671 | + } |
| 3672 | + |
| 3673 | +Quit: |
| 3674 | + return Imm32GetImeInfoEx(pImeInfoEx, SearchType); |
3636 | 3675 | }
|
0 commit comments