mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[NTUSER] Fix KVM and VBox tests (#4235)
KVM and VBox tests was failing since d5deacd
- Check NULL at UserFreeInputContext and UserDestroyInputContext functions.
- Move UserMarkObjectDestroy into the UserDestroyInputContext function.
CORE-11700
This commit is contained in:
parent
ee132a05ba
commit
757bed81b1
|
@ -224,10 +224,14 @@ AllocInputContextObject(PDESKTOP pDesk,
|
||||||
VOID UserFreeInputContext(PVOID Object)
|
VOID UserFreeInputContext(PVOID Object)
|
||||||
{
|
{
|
||||||
PIMC pIMC = Object, pImc0;
|
PIMC pIMC = Object, pImc0;
|
||||||
PTHREADINFO pti = pIMC->head.pti;
|
PTHREADINFO pti;
|
||||||
|
|
||||||
UserMarkObjectDestroy(Object);
|
if (!pIMC)
|
||||||
|
return;
|
||||||
|
|
||||||
|
pti = pIMC->head.pti;
|
||||||
|
|
||||||
|
/* Find the IMC in the list and remove it */
|
||||||
for (pImc0 = pti->spDefaultImc; pImc0; pImc0 = pImc0->pImcNext)
|
for (pImc0 = pti->spDefaultImc; pImc0; pImc0 = pImc0->pImcNext)
|
||||||
{
|
{
|
||||||
if (pImc0->pImcNext == pIMC)
|
if (pImc0->pImcNext == pIMC)
|
||||||
|
@ -237,7 +241,7 @@ VOID UserFreeInputContext(PVOID Object)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
UserHeapFree(Object);
|
UserHeapFree(pIMC);
|
||||||
|
|
||||||
pti->ppi->UserHandleCount--;
|
pti->ppi->UserHandleCount--;
|
||||||
IntDereferenceThreadInfo(pti);
|
IntDereferenceThreadInfo(pti);
|
||||||
|
@ -246,7 +250,11 @@ VOID UserFreeInputContext(PVOID Object)
|
||||||
BOOLEAN UserDestroyInputContext(PVOID Object)
|
BOOLEAN UserDestroyInputContext(PVOID Object)
|
||||||
{
|
{
|
||||||
PIMC pIMC = Object;
|
PIMC pIMC = Object;
|
||||||
UserDeleteObject(pIMC->head.h, TYPE_INPUTCONTEXT);
|
if (pIMC)
|
||||||
|
{
|
||||||
|
UserMarkObjectDestroy(pIMC);
|
||||||
|
UserDeleteObject(pIMC->head.h, TYPE_INPUTCONTEXT);
|
||||||
|
}
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue