ReactOS 0.4.16-dev-109-gf4cb10f
cicimc.cpp
Go to the documentation of this file.
1/*
2 * PROJECT: ReactOS Cicero
3 * LICENSE: LGPL-2.1-or-later (https://spdx.org/licenses/LGPL-2.1-or-later)
4 * PURPOSE: Locking and Unlocking IMC and IMCC handles
5 * COPYRIGHT: Copyright 2023 Katayama Hirofumi MZ <katayama.hirofumi.mz@gmail.com>
6 */
7
8#include "precomp.h"
9#include <imm.h>
10#include <immdev.h>
11#include <imm32_undoc.h>
12#include "cicimc.h"
13
14#define CUSTOM_CAND_INFO_SIZE 1964
15
17{
18 HIMCC hNewCandInfo, hCandInfo = m_pIC->hCandInfo;
19 if (hCandInfo)
20 {
21 hNewCandInfo = ImmReSizeIMCC(hCandInfo, CUSTOM_CAND_INFO_SIZE);
22 if (!hNewCandInfo)
23 {
24 ImmDestroyIMCC(m_pIC->hCandInfo);
26 return FALSE;
27 }
28 }
29 else
30 {
32 }
33
34 m_pIC->hCandInfo = hNewCandInfo;
35 if (!m_pIC->hCandInfo)
36 return FALSE;
37
38 CicIMCCLock<CANDIDATEINFO> candInfo(m_pIC->hCandInfo);
39 if (!candInfo)
40 {
41 ImmDestroyIMCC(m_pIC->hCandInfo);
43 return FALSE;
44 }
45
46 candInfo.get().dwSize = CUSTOM_CAND_INFO_SIZE;
47 candInfo.get().dwCount = 0;
48 candInfo.get().dwOffset[0] = sizeof(CANDIDATEINFO);
49
50 // FIXME: Something is trailing after CANDIDATEINFO...
51
52 return TRUE;
53}
#define CUSTOM_CAND_INFO_SIZE
Definition: cicimc.cpp:14
LPINPUTCONTEXTDX m_pIC
Definition: cicimc.h:92
T_DATA & get() const
Definition: cicimc.h:68
BOOL ClearCand()
Definition: cicimc.cpp:16
DWORD HIMCC
Definition: dimm.idl:76
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
HIMCC WINAPI ImmCreateIMCC(DWORD size)
Definition: utils.c:1178
HIMCC WINAPI ImmReSizeIMCC(HIMCC imcc, DWORD size)
Definition: utils.c:1226
HIMCC WINAPI ImmDestroyIMCC(HIMCC block)
Definition: utils.c:1188
unsigned int BOOL
Definition: ntddk_ex.h:94
struct tagCANDIDATEINFO CANDIDATEINFO