mirror of
https://github.com/reactos/reactos.git
synced 2025-08-07 05:52:57 +00:00
[NTUSER][IMM32] Use Imm32CurrentPti and pool (#4356)
- Use newly-defined Imm32CurrentPti() instead of NtCurrentTeb()->Win32ThreadInfo. - THREADSTATE_GETTHREADINFO is same as THREADSTATE_UNKNOWN18. - Use the paged pool to allocate HIMC rather than heap. - Fix and improve ImmDestroyContext function. CORE-11700
This commit is contained in:
parent
78a7d7dc32
commit
45a4e53fa4
7 changed files with 64 additions and 65 deletions
|
@ -1215,7 +1215,7 @@ typedef struct tagIMEUI
|
|||
/* Window Extra data container. */
|
||||
typedef struct _IMEWND
|
||||
{
|
||||
WND;
|
||||
WND wnd;
|
||||
PIMEUI pimeui;
|
||||
} IMEWND, *PIMEWND;
|
||||
|
||||
|
@ -2570,8 +2570,7 @@ enum ThreadStateRoutines
|
|||
THREADSTATE_ISWINLOGON,
|
||||
THREADSTATE_ISWINLOGON2,
|
||||
THREADSTATE_UNKNOWN17,
|
||||
THREADSTATE_UNKNOWN18,
|
||||
THREADSTATE_GETTHREADINFO = 100, /* FIXME: Delete this HACK */
|
||||
THREADSTATE_GETTHREADINFO,
|
||||
THREADSTATE_PROGMANWINDOW, /* FIXME: Delete this HACK */
|
||||
THREADSTATE_TASKMANWINDOW, /* FIXME: Delete this HACK */
|
||||
};
|
||||
|
|
|
@ -1200,7 +1200,7 @@ AllocInputContextObject(PDESKTOP pDesk,
|
|||
ASSERT(Size > sizeof(*ObjHead));
|
||||
ASSERT(pti != NULL);
|
||||
|
||||
ObjHead = UserHeapAlloc(Size);
|
||||
ObjHead = ExAllocatePoolWithTag(PagedPool, Size, USERTAG_IME);
|
||||
if (!ObjHead)
|
||||
return NULL;
|
||||
|
||||
|
@ -1218,7 +1218,7 @@ AllocInputContextObject(PDESKTOP pDesk,
|
|||
|
||||
VOID UserFreeInputContext(PVOID Object)
|
||||
{
|
||||
PIMC pIMC = Object, pImc0;
|
||||
PIMC pIMC = Object;
|
||||
PTHREADINFO pti;
|
||||
|
||||
if (!pIMC)
|
||||
|
@ -1226,7 +1226,24 @@ VOID UserFreeInputContext(PVOID Object)
|
|||
|
||||
pti = pIMC->head.pti;
|
||||
|
||||
ExFreePoolWithTag(pIMC, USERTAG_IME);
|
||||
|
||||
pti->ppi->UserHandleCount--;
|
||||
IntDereferenceThreadInfo(pti);
|
||||
}
|
||||
|
||||
BOOLEAN UserDestroyInputContext(PVOID Object)
|
||||
{
|
||||
PIMC pIMC = Object, pImc0;
|
||||
PTHREADINFO pti;
|
||||
|
||||
if (!pIMC)
|
||||
return TRUE;
|
||||
|
||||
UserMarkObjectDestroy(pIMC);
|
||||
|
||||
/* Find the IMC in the list and remove it */
|
||||
pti = pIMC->head.pti;
|
||||
for (pImc0 = pti->spDefaultImc; pImc0; pImc0 = pImc0->pImcNext)
|
||||
{
|
||||
if (pImc0->pImcNext == pIMC)
|
||||
|
@ -1236,21 +1253,7 @@ VOID UserFreeInputContext(PVOID Object)
|
|||
}
|
||||
}
|
||||
|
||||
UserHeapFree(pIMC);
|
||||
|
||||
pti->ppi->UserHandleCount--;
|
||||
IntDereferenceThreadInfo(pti);
|
||||
}
|
||||
|
||||
BOOLEAN UserDestroyInputContext(PVOID Object)
|
||||
{
|
||||
PIMC pIMC = Object;
|
||||
if (pIMC)
|
||||
{
|
||||
UserMarkObjectDestroy(pIMC);
|
||||
UserDeleteObject(pIMC->head.h, TYPE_INPUTCONTEXT);
|
||||
}
|
||||
return TRUE;
|
||||
return UserDeleteObject(pIMC->head.h, TYPE_INPUTCONTEXT);
|
||||
}
|
||||
|
||||
BOOL NTAPI NtUserDestroyInputContext(HIMC hIMC)
|
||||
|
|
|
@ -248,8 +248,8 @@ NtUserGetThreadState(
|
|||
|
||||
switch (Routine)
|
||||
{
|
||||
case THREADSTATE_GETTHREADINFO: /* FIXME: Delete this HACK */
|
||||
GetW32ThreadInfo();
|
||||
case THREADSTATE_GETTHREADINFO:
|
||||
ret = TRUE;
|
||||
break;
|
||||
case THREADSTATE_FOCUSWINDOW:
|
||||
ret = (DWORD_PTR)IntGetThreadFocusWindow();
|
||||
|
@ -337,9 +337,6 @@ NtUserGetThreadState(
|
|||
case THREADSTATE_UNKNOWN17:
|
||||
/* FIXME */
|
||||
break;
|
||||
case THREADSTATE_UNKNOWN18:
|
||||
ret = TRUE;
|
||||
break;
|
||||
}
|
||||
|
||||
TRACE("Leave NtUserGetThreadState, ret=%lu\n", ret);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue