mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[WIN32SS][NTUSER] Implement NtUserDestroyInputContext (#4063)
CORE-11700
This commit is contained in:
parent
e3402aca65
commit
3d78601f39
|
@ -3,7 +3,8 @@
|
||||||
* PROJECT: ReactOS Win32k subsystem
|
* PROJECT: ReactOS Win32k subsystem
|
||||||
* PURPOSE: Input Method Editor and Input Method Manager support
|
* PURPOSE: Input Method Editor and Input Method Manager support
|
||||||
* FILE: win32ss/user/ntuser/ime.c
|
* FILE: win32ss/user/ntuser/ime.c
|
||||||
* PROGRAMER: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
* PROGRAMERS: Casper S. Hornstrup (chorns@users.sourceforge.net)
|
||||||
|
* Katayama Hirofumi MZ (katayama.hirofumi.mz@gmail.com)
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <win32k.h>
|
#include <win32k.h>
|
||||||
|
@ -134,5 +135,82 @@ NtUserSetImeOwnerWindow(PIMEINFOEX pImeInfoEx, BOOL fFlag)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
PVOID
|
||||||
|
AllocInputContextObject(PDESKTOP pDesk,
|
||||||
|
PTHREADINFO pti,
|
||||||
|
SIZE_T Size,
|
||||||
|
PVOID* HandleOwner)
|
||||||
|
{
|
||||||
|
PTHRDESKHEAD ObjHead;
|
||||||
|
|
||||||
|
ASSERT(Size > sizeof(*ObjHead));
|
||||||
|
ASSERT(pti != NULL);
|
||||||
|
|
||||||
|
ObjHead = UserHeapAlloc(Size);
|
||||||
|
if (!ObjHead)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
RtlZeroMemory(ObjHead, Size);
|
||||||
|
|
||||||
|
ObjHead->pSelf = ObjHead;
|
||||||
|
ObjHead->rpdesk = pDesk;
|
||||||
|
ObjHead->pti = pti;
|
||||||
|
IntReferenceThreadInfo(pti);
|
||||||
|
*HandleOwner = pti;
|
||||||
|
pti->ppi->UserHandleCount++;
|
||||||
|
|
||||||
|
return ObjHead;
|
||||||
|
}
|
||||||
|
|
||||||
|
VOID UserFreeInputContext(PVOID Object)
|
||||||
|
{
|
||||||
|
PIMC pIMC = Object, pImc0;
|
||||||
|
PTHREADINFO pti = pIMC->head.pti;
|
||||||
|
|
||||||
|
UserMarkObjectDestroy(Object);
|
||||||
|
|
||||||
|
for (pImc0 = pti->spDefaultImc; pImc0; pImc0 = pImc0->pImcNext)
|
||||||
|
{
|
||||||
|
if (pImc0->pImcNext == pIMC)
|
||||||
|
{
|
||||||
|
pImc0->pImcNext = pIMC->pImcNext;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
UserHeapFree(Object);
|
||||||
|
|
||||||
|
pti->ppi->UserHandleCount--;
|
||||||
|
IntDereferenceThreadInfo(pti);
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOLEAN UserDestroyInputContext(PVOID Object)
|
||||||
|
{
|
||||||
|
PIMC pIMC = Object;
|
||||||
|
UserDeleteObject(pIMC->head.h, TYPE_INPUTCONTEXT);
|
||||||
|
return TRUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
BOOL APIENTRY NtUserDestroyInputContext(HIMC hIMC)
|
||||||
|
{
|
||||||
|
PIMC pIMC;
|
||||||
|
BOOL ret = FALSE;
|
||||||
|
|
||||||
|
UserEnterExclusive();
|
||||||
|
|
||||||
|
if (!(gpsi->dwSRVIFlags & SRVINFO_IMM32))
|
||||||
|
{
|
||||||
|
EngSetLastError(ERROR_CALL_NOT_IMPLEMENTED);
|
||||||
|
UserLeave();
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
|
pIMC = UserGetObject(gHandleTable, hIMC, TYPE_INPUTCONTEXT);
|
||||||
|
if (pIMC)
|
||||||
|
ret = UserDereferenceObject(pIMC);
|
||||||
|
|
||||||
|
UserLeave();
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
|
@ -424,14 +424,6 @@ NtUserCreateInputContext(PCLIENTIMC pClientImc)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL
|
|
||||||
APIENTRY
|
|
||||||
NtUserDestroyInputContext(HIMC hIMC)
|
|
||||||
{
|
|
||||||
STUB;
|
|
||||||
return FALSE;
|
|
||||||
}
|
|
||||||
|
|
||||||
DWORD
|
DWORD
|
||||||
APIENTRY
|
APIENTRY
|
||||||
NtUserGetRawInputBuffer(
|
NtUserGetRawInputBuffer(
|
||||||
|
|
|
@ -237,7 +237,7 @@ static const struct
|
||||||
{ AllocSysObject, /*UserKbdFileCleanup*/NULL, FreeSysObject }, /* TYPE_KBDFILE */
|
{ AllocSysObject, /*UserKbdFileCleanup*/NULL, FreeSysObject }, /* TYPE_KBDFILE */
|
||||||
{ AllocThreadObject, IntRemoveEvent, FreeThreadObject }, /* TYPE_WINEVENTHOOK */
|
{ AllocThreadObject, IntRemoveEvent, FreeThreadObject }, /* TYPE_WINEVENTHOOK */
|
||||||
{ AllocSysObject, /*UserTimerCleanup*/NULL, FreeSysObject }, /* TYPE_TIMER */
|
{ AllocSysObject, /*UserTimerCleanup*/NULL, FreeSysObject }, /* TYPE_TIMER */
|
||||||
{ NULL, NULL, NULL }, /* TYPE_INPUTCONTEXT */
|
{ AllocInputContextObject, UserDestroyInputContext, UserFreeInputContext }, /* TYPE_INPUTCONTEXT */
|
||||||
{ NULL, NULL, NULL }, /* TYPE_HIDDATA */
|
{ NULL, NULL, NULL }, /* TYPE_HIDDATA */
|
||||||
{ NULL, NULL, NULL }, /* TYPE_DEVICEINFO */
|
{ NULL, NULL, NULL }, /* TYPE_DEVICEINFO */
|
||||||
{ NULL, NULL, NULL }, /* TYPE_TOUCHINPUTINFO */
|
{ NULL, NULL, NULL }, /* TYPE_TOUCHINPUTINFO */
|
||||||
|
|
|
@ -163,4 +163,10 @@ BOOL UserPaintCaption(PWND pWnd, INT Flags);
|
||||||
BOOL FASTCALL SetLayeredStatus(PWND pWnd, BYTE set);
|
BOOL FASTCALL SetLayeredStatus(PWND pWnd, BYTE set);
|
||||||
BOOL FASTCALL GetLayeredStatus(PWND pWnd);
|
BOOL FASTCALL GetLayeredStatus(PWND pWnd);
|
||||||
|
|
||||||
|
/************** INPUT CONTEXT **************/
|
||||||
|
|
||||||
|
VOID UserFreeInputContext(PVOID Object);
|
||||||
|
BOOLEAN UserDestroyInputContext(PVOID Object);
|
||||||
|
PVOID AllocInputContextObject(PDESKTOP pDesk, PTHREADINFO pti, SIZE_T Size, PVOID* HandleOwner);
|
||||||
|
|
||||||
/* EOF */
|
/* EOF */
|
||||||
|
|
Loading…
Reference in a new issue