mirror of
https://github.com/reactos/reactos.git
synced 2025-01-19 10:03:28 +08: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 */
|
||||
if (IS_IMM_MODE())
|
||||
{
|
||||
PIMC pIMC = UserCreateInputContext(0);
|
||||
if (pIMC)
|
||||
{
|
||||
UserDereferenceObject(pIMC);
|
||||
}
|
||||
(VOID)UserCreateInputContext(0);
|
||||
}
|
||||
|
||||
/* 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)
|
||||
return NULL;
|
||||
|
||||
// Release the extra reference (UserCreateObject added 2 references).
|
||||
UserDereferenceObject(pIMC);
|
||||
|
||||
if (dwClientImcData) // Non-first time.
|
||||
{
|
||||
// Insert pIMC to the second position (non-default) of the list.
|
||||
@ -506,17 +509,17 @@ NtUserCreateInputContext(ULONG_PTR dwClientImcData)
|
||||
PIMC pIMC;
|
||||
HIMC ret = NULL;
|
||||
|
||||
if (!dwClientImcData)
|
||||
return NULL;
|
||||
|
||||
UserEnterExclusive();
|
||||
|
||||
if (!IS_IMM_MODE() || !dwClientImcData)
|
||||
if (!IS_IMM_MODE())
|
||||
goto Quit;
|
||||
|
||||
pIMC = UserCreateInputContext(dwClientImcData);
|
||||
if (pIMC)
|
||||
{
|
||||
ret = UserHMGetHandle(pIMC);
|
||||
UserDereferenceObject(pIMC);
|
||||
}
|
||||
|
||||
Quit:
|
||||
UserLeave();
|
||||
|
Loading…
Reference in New Issue
Block a user