ReactOS  0.4.15-dev-3440-g915569a
ime.c
Go to the documentation of this file.
1 /*
2  * COPYRIGHT: See COPYING in the top level directory
3  * PROJECT: ReactOS Win32k subsystem
4  * PURPOSE: Input Method Editor and Input Method Manager support
5  * FILE: win32ss/user/ntuser/ime.c
6  * PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
7  * Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
8  */
9 
10 #include <win32k.h>
11 DBG_DEFAULT_CHANNEL(UserMisc);
12 
13 
16 {
17  PKL pKbdLayout;
18 
19  ASSERT_REFS_CO(pWnd);
20 
21  if ( Msg == WM_KEYDOWN ||
22  Msg == WM_SYSKEYDOWN ||
23  Msg == WM_KEYUP ||
24  Msg == WM_SYSKEYUP )
25  {
26  //Vk = wParam & 0xff;
27  pKbdLayout = pWnd->head.pti->KeyboardLayout;
28  if (pKbdLayout == NULL) return 0;
29  //
30  if (!(gpsi->dwSRVIFlags & SRVINFO_IMM32)) return 0;
31  // need ime.h!
32  }
33  // Call User32:
34  // Anything but BOOL!
35  //ImmRet = co_IntImmProcessKey(UserHMGetHandle(pWnd), pKbdLayout->hkl, Vk, lParam, HotKey);
36  FIXME(" is UNIMPLEMENTED.\n");
37  return 0;
38 }
39 
42  OUT LPUINT lpuModifiers,
43  OUT LPUINT lpuVKey,
44  OUT LPHKL lphKL)
45 {
46  STUB
47 
48  return FALSE;
49 }
50 
51 DWORD
53 NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
54 {
55  TRACE("NtUserNotifyIMEStatus(%p, %d, 0x%lX)\n", hwnd, fOpen, dwConversion);
56  return 0;
57 }
58 
59 DWORD
62  DWORD Unknown0,
63  DWORD Unknown1,
64  DWORD Unknown2,
67 {
68  STUB
69 
70  return 0;
71 }
72 
73 DWORD
76  DWORD VirtualKey,
77  LPARAM lParam)
78 {
79  STUB;
80  return 0;
81 }
82 
83 
84 DWORD
87  DWORD dwUnknown1)
88 {
89  STUB;
90  return 0;
91 }
92 
93 DWORD
96 {
97  STUB;
98  return 0;
99 }
100 
101 BOOL
102 APIENTRY
104  PIMEINFOEX pImeInfoEx,
105  IMEINFOEXCLASS SearchType)
106 {
107  STUB;
108  return FALSE;
109 }
110 
111 
112 DWORD
113 APIENTRY
115  DWORD dwUnknown1,
116  DWORD dwUnknown2)
117 {
118  STUB;
119  return 0;
120 }
121 
122 DWORD
123 APIENTRY
125  PIMEINFOEX pImeInfoEx)
126 {
127  STUB;
128  return 0;
129 }
130 
133 {
134  STUB
135  return 0;
136 }
137 
138 PVOID
140  PTHREADINFO pti,
141  SIZE_T Size,
142  PVOID* HandleOwner)
143 {
144  PTHRDESKHEAD ObjHead;
145 
146  ASSERT(Size > sizeof(*ObjHead));
147  ASSERT(pti != NULL);
148 
149  ObjHead = UserHeapAlloc(Size);
150  if (!ObjHead)
151  return NULL;
152 
153  RtlZeroMemory(ObjHead, Size);
154 
155  ObjHead->pSelf = ObjHead;
156  ObjHead->rpdesk = pDesk;
157  ObjHead->pti = pti;
159  *HandleOwner = pti;
160  pti->ppi->UserHandleCount++;
161 
162  return ObjHead;
163 }
164 
166 {
167  PIMC pIMC = Object, pImc0;
168  PTHREADINFO pti = pIMC->head.pti;
169 
171 
172  for (pImc0 = pti->spDefaultImc; pImc0; pImc0 = pImc0->pImcNext)
173  {
174  if (pImc0->pImcNext == pIMC)
175  {
176  pImc0->pImcNext = pIMC->pImcNext;
177  break;
178  }
179  }
180 
182 
183  pti->ppi->UserHandleCount--;
185 }
186 
188 {
189  PIMC pIMC = Object;
191  return TRUE;
192 }
193 
195 {
196  PIMC pIMC;
197  BOOL ret = FALSE;
198 
200 
201  if (!(gpsi->dwSRVIFlags & SRVINFO_IMM32))
202  {
204  UserLeave();
205  return FALSE;
206  }
207 
209  if (pIMC)
210  ret = UserDereferenceObject(pIMC);
211 
212  UserLeave();
213  return ret;
214 }
215 
216 /* EOF */
const DOCKBAR PVOID HWND HWND * hwnd
Definition: tooldock.h:22
#define IN
Definition: typedefs.h:39
DWORD APIENTRY NtUserSetImeInfoEx(PIMEINFOEX pImeInfoEx)
Definition: ime.c:124
PVOID pSelf
Definition: ntuser.h:187
BOOL FASTCALL UserDeleteObject(HANDLE h, HANDLE_TYPE type)
Definition: object.c:683
DWORD APIENTRY NtUserCheckImeHotKey(DWORD VirtualKey, LPARAM lParam)
Definition: ime.c:75
IN PUNICODE_STRING IN POBJECT_ATTRIBUTES IN DWORD Unknown3
Definition: conport.c:35
struct _DESKTOP * rpdesk
Definition: ntuser.h:186
struct tagIMC * spDefaultImc
Definition: win32.h:133
#define TRUE
Definition: types.h:120
#define ASSERT_REFS_CO(_obj_)
Definition: userfuncs.h:13
Definition: ntuser.h:190
HWND hWnd
Definition: settings.c:17
static __inline BOOL UserHeapFree(PVOID lpMem)
Definition: usrheap.h:44
IN PVOID IN PVOID IN USHORT IN USHORT Size
Definition: pci.h:361
uint32_t * LPUINT
Definition: typedefs.h:59
BOOL FASTCALL UserDereferenceObject(PVOID Object)
Definition: object.c:610
UINT_PTR WPARAM
Definition: windef.h:207
static __inline PVOID UserHeapAlloc(SIZE_T Bytes)
Definition: usrheap.h:34
DWORD APIENTRY NtUserSetImeOwnerWindow(PIMEINFOEX pImeInfoEx, BOOL fFlag)
Definition: ime.c:132
#define FASTCALL
Definition: nt_native.h:50
PSERVERINFO gpsi
Definition: main.c:27
WPARAM wParam
Definition: combotst.c:138
PPROCESSINFO ppi
Definition: win32.h:89
#define FALSE
Definition: types.h:117
DWORD dwSRVIFlags
Definition: ntuser.h:1013
unsigned int BOOL
Definition: ntddk_ex.h:94
PRTL_UNICODE_STRING_BUFFER PULONG PULONG Unknown4
#define FIXME(fmt,...)
Definition: debug.h:111
THRDESKHEAD head
Definition: ntuser.h:665
unsigned char BOOLEAN
Definition: input.h:26
#define WM_KEYDOWN
Definition: winuser.h:1702
LONG_PTR LPARAM
Definition: windef.h:208
DWORD HIMC
Definition: dimm.idl:75
BOOL APIENTRY NtUserDestroyInputContext(HIMC hIMC)
Definition: ime.c:194
VOID UserFreeInputContext(PVOID Object)
Definition: ime.c:165
#define IntReferenceThreadInfo(pti)
Definition: win32.h:169
BOOLEAN UserDestroyInputContext(PVOID Object)
Definition: ime.c:187
VOID FASTCALL UserEnterExclusive(VOID)
Definition: ntuser.c:245
DWORD APIENTRY NtUserNotifyIMEStatus(HWND hwnd, BOOL fOpen, DWORD dwConversion)
Definition: ime.c:53
#define TRACE(s)
Definition: solgame.cpp:4
IMEINFOEXCLASS
Definition: ntuser.h:1186
#define ASSERT(a)
Definition: mode.c:44
DBG_DEFAULT_CHANNEL(UserMisc)
#define WINAPI
Definition: msvc.h:6
#define WM_KEYUP
Definition: winuser.h:1703
unsigned long DWORD
Definition: ntddk_ex.h:95
int ret
DWORD APIENTRY NtUserDisableThreadIme(DWORD dwUnknown1)
Definition: ime.c:86
PVOID AllocInputContextObject(PDESKTOP pDesk, PTHREADINFO pti, SIZE_T Size, PVOID *HandleOwner)
Definition: ime.c:139
_Must_inspect_result_ _In_ WDFCOLLECTION _In_ WDFOBJECT Object
Definition: ntuser.h:663
VOID FASTCALL UserLeave(VOID)
Definition: ntuser.c:253
ULONG_PTR SIZE_T
Definition: typedefs.h:80
BOOL APIENTRY NtUserGetImeInfoEx(PIMEINFOEX pImeInfoEx, IMEINFOEXCLASS SearchType)
Definition: ime.c:103
PVOID UserGetObject(PUSER_HANDLE_TABLE ht, HANDLE handle, HANDLE_TYPE type)
Definition: object.c:462
#define STUB
Definition: kernel32.h:27
#define WM_SYSKEYUP
Definition: winuser.h:1707
THRDESKHEAD head
Definition: ntuser.h:192
unsigned int UINT
Definition: ndis.h:50
#define NULL
Definition: types.h:112
BOOL WINAPI NtUserGetImeHotKey(IN DWORD dwHotKey, OUT LPUINT lpuModifiers, OUT LPUINT lpuVKey, OUT LPHKL lphKL)
Definition: ime.c:41
#define OUT
Definition: typedefs.h:40
struct @1587 Msg[]
#define SRVINFO_IMM32
Definition: ntuser.h:919
#define WM_SYSKEYDOWN
Definition: winuser.h:1706
#define ERROR_CALL_NOT_IMPLEMENTED
Definition: compat.h:102
#define RtlZeroMemory(Destination, Length)
Definition: typedefs.h:262
struct tagIMC * pImcNext
Definition: ntuser.h:193
UINT FASTCALL IntImmProcessKey(PUSER_MESSAGE_QUEUE MessageQueue, PWND pWnd, UINT Msg, WPARAM wParam, LPARAM lParam)
Definition: ime.c:15
DWORD APIENTRY NtUserSetAppImeLevel(DWORD dwUnknown1, DWORD dwUnknown2)
Definition: ime.c:114
DWORD APIENTRY NtUserGetAppImeLevel(HWND hWnd)
Definition: ime.c:95
PUSER_HANDLE_TABLE gHandleTable
Definition: object.c:13
#define IntDereferenceThreadInfo(pti)
Definition: win32.h:174
LPARAM lParam
Definition: combotst.c:139
ENGAPI VOID APIENTRY EngSetLastError(_In_ ULONG iError)
Definition: error.c:27
#define APIENTRY
Definition: api.h:79
DWORD APIENTRY NtUserSetImeHotKey(DWORD Unknown0, DWORD Unknown1, DWORD Unknown2, DWORD Unknown3, DWORD Unknown4)
Definition: ime.c:61
BOOL FASTCALL UserMarkObjectDestroy(PVOID Object)
Definition: object.c:587