mirror of
https://github.com/reactos/reactos.git
synced 2024-06-29 01:12:06 +00:00
[NTUSER] Plan A: UserDereferenceObject in UserCreateInputContext (#4247)
- Call UserDereferenceObject function in UserCreateInputContext. - Don't call UserDereferenceObject against input context at the other places. CORE-11700
This commit is contained in:
parent
1f6cd38050
commit
8e8f61989a
|
@ -654,11 +654,7 @@ InitThreadCallback(PETHREAD Thread)
|
||||||
/* Create the default input context */
|
/* Create the default input context */
|
||||||
if (IS_IMM_MODE())
|
if (IS_IMM_MODE())
|
||||||
{
|
{
|
||||||
PIMC pIMC = UserCreateInputContext(0);
|
(VOID)UserCreateInputContext(0);
|
||||||
if (pIMC)
|
|
||||||
{
|
|
||||||
UserDereferenceObject(pIMC);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Last things to do only if we are not a SYSTEM or CSRSS thread */
|
/* Last things to do only if we are not a SYSTEM or CSRSS thread */
|
||||||
|
|
|
@ -482,6 +482,9 @@ PIMC FASTCALL UserCreateInputContext(ULONG_PTR dwClientImcData)
|
||||||
if (!pIMC)
|
if (!pIMC)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
// Release the extra reference (UserCreateObject added 2 references).
|
||||||
|
UserDereferenceObject(pIMC);
|
||||||
|
|
||||||
if (dwClientImcData) // Non-first time.
|
if (dwClientImcData) // Non-first time.
|
||||||
{
|
{
|
||||||
// Insert pIMC to the second position (non-default) of the list.
|
// Insert pIMC to the second position (non-default) of the list.
|
||||||
|
@ -506,17 +509,17 @@ NtUserCreateInputContext(ULONG_PTR dwClientImcData)
|
||||||
PIMC pIMC;
|
PIMC pIMC;
|
||||||
HIMC ret = NULL;
|
HIMC ret = NULL;
|
||||||
|
|
||||||
|
if (!dwClientImcData)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
UserEnterExclusive();
|
UserEnterExclusive();
|
||||||
|
|
||||||
if (!IS_IMM_MODE() || !dwClientImcData)
|
if (!IS_IMM_MODE())
|
||||||
goto Quit;
|
goto Quit;
|
||||||
|
|
||||||
pIMC = UserCreateInputContext(dwClientImcData);
|
pIMC = UserCreateInputContext(dwClientImcData);
|
||||||
if (pIMC)
|
if (pIMC)
|
||||||
{
|
|
||||||
ret = UserHMGetHandle(pIMC);
|
ret = UserHMGetHandle(pIMC);
|
||||||
UserDereferenceObject(pIMC);
|
|
||||||
}
|
|
||||||
|
|
||||||
Quit:
|
Quit:
|
||||||
UserLeave();
|
UserLeave();
|
||||||
|
|
Loading…
Reference in a new issue