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