mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 08:55:19 +00:00
[NTUSER] Improve UserFreeInputContext and UserDestroyInputContext
CORE-18044
This commit is contained in:
parent
dfd06ee8fc
commit
2b2366ab90
1 changed files with 11 additions and 14 deletions
|
@ -1218,13 +1218,22 @@ AllocInputContextObject(PDESKTOP pDesk,
|
|||
|
||||
VOID UserFreeInputContext(PVOID Object)
|
||||
{
|
||||
PIMC pIMC = Object;
|
||||
PIMC pIMC = Object, *ppIMC;
|
||||
PTHREADINFO pti;
|
||||
|
||||
if (!pIMC)
|
||||
return;
|
||||
|
||||
/* Find the IMC in the list and remove it */
|
||||
pti = pIMC->head.pti;
|
||||
for (ppIMC = &pti->spDefaultImc; *ppIMC; ppIMC = &(*ppIMC)->pImcNext)
|
||||
{
|
||||
if (*ppIMC == pIMC)
|
||||
{
|
||||
*ppIMC = pIMC->pImcNext;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ExFreePoolWithTag(pIMC, USERTAG_IME);
|
||||
|
||||
|
@ -1234,25 +1243,13 @@ VOID UserFreeInputContext(PVOID Object)
|
|||
|
||||
BOOLEAN UserDestroyInputContext(PVOID Object)
|
||||
{
|
||||
PIMC pIMC = Object, pImc0;
|
||||
PTHREADINFO pti;
|
||||
PIMC pIMC = Object;
|
||||
|
||||
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)
|
||||
{
|
||||
pImc0->pImcNext = pIMC->pImcNext;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return UserDeleteObject(pIMC->head.h, TYPE_INPUTCONTEXT);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue