mirror of
https://github.com/reactos/reactos.git
synced 2025-02-23 00:45:24 +00:00
[NTUSER] Fix UserDestroyInputContext (again) (#4476)
Fix the HIMC handle leak. CORE-11700
This commit is contained in:
parent
14d50cc6c0
commit
4a748a3a97
2 changed files with 6 additions and 2 deletions
|
@ -1465,10 +1465,11 @@ VOID UserFreeInputContext(PVOID Object)
|
|||
BOOLEAN UserDestroyInputContext(PVOID Object)
|
||||
{
|
||||
PIMC pIMC = Object;
|
||||
if (!pIMC || !UserMarkObjectDestroy(pIMC))
|
||||
if (!pIMC)
|
||||
return TRUE;
|
||||
|
||||
return UserDeleteObject(UserHMGetHandle(pIMC), TYPE_INPUTCONTEXT);
|
||||
UserDeleteObject(UserHMGetHandle(pIMC), TYPE_INPUTCONTEXT);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
// Win: DestroyInputContext
|
||||
|
@ -1560,6 +1561,7 @@ PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData)
|
|||
|
||||
// Release the extra reference (UserCreateObject added 2 references).
|
||||
UserDereferenceObject(pIMC);
|
||||
ASSERT(pIMC->head.cLockObj == 1);
|
||||
|
||||
if (dwClientImcData) // Non-first time.
|
||||
{
|
||||
|
@ -1572,6 +1574,7 @@ PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData)
|
|||
// Add the first one (default) to the list.
|
||||
UserAssignmentLock((PVOID*)&pti->spDefaultImc, pIMC);
|
||||
pIMC->pImcNext = NULL;
|
||||
ASSERT(pIMC->head.cLockObj == 2); // UserAssignmentUnlock'ed at ExitThreadCallback
|
||||
}
|
||||
|
||||
pIMC->dwClientImcData = dwClientImcData; // Set it.
|
||||
|
|
|
@ -582,6 +582,7 @@ UserCreateObject( PUSER_HANDLE_TABLE ht,
|
|||
return Object;
|
||||
}
|
||||
|
||||
// Win: HMMarkObjectDestroy
|
||||
BOOL
|
||||
FASTCALL
|
||||
UserMarkObjectDestroy(PVOID Object)
|
||||
|
|
Loading…
Reference in a new issue