Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
3e8a4b67
Commit
3e8a4b67
authored
Jul 12, 2022
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Store message spy pointer in TEB.
parent
f77f12ba
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
13 deletions
+18
-13
imm.c
dlls/imm32/imm.c
+17
-13
ntuser.h
include/ntuser.h
+1
-0
No files found.
dlls/imm32/imm.c
View file @
3e8a4b67
...
...
@@ -123,8 +123,6 @@ struct coinit_spy
}
apt_flags
;
};
static
LONG
spy_tls
=
TLS_OUT_OF_INDEXES
;
static
struct
list
ImmHklList
=
LIST_INIT
(
ImmHklList
);
static
struct
list
ImmThreadDataList
=
LIST_INIT
(
ImmThreadDataList
);
...
...
@@ -256,13 +254,18 @@ static DWORD convert_candidatelist_AtoW(
return
ret
;
}
static
struct
coinit_spy
*
get_thread_coinit_spy
(
void
)
{
return
NtUserGetThreadInfo
()
->
client_imm
;
}
static
void
imm_couninit_thread
(
BOOL
cleanup
)
{
struct
coinit_spy
*
spy
;
TRACE
(
"implicit COM deinitialization
\n
"
);
if
(
!
(
spy
=
TlsGetValue
(
spy_tls
))
||
(
spy
->
apt_flags
&
IMM_APT_BROKEN
))
if
(
!
(
spy
=
get_thread_coinit_spy
(
))
||
(
spy
->
apt_flags
&
IMM_APT_BROKEN
))
return
;
if
(
cleanup
&&
spy
->
cookie
.
QuadPart
)
...
...
@@ -314,7 +317,11 @@ static ULONG WINAPI InitializeSpy_Release(IInitializeSpy *iface)
{
struct
coinit_spy
*
spy
=
impl_from_IInitializeSpy
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
spy
->
ref
);
if
(
!
ref
)
HeapFree
(
GetProcessHeap
(),
0
,
spy
);
if
(
!
ref
)
{
HeapFree
(
GetProcessHeap
(),
0
,
spy
);
NtUserGetThreadInfo
()
->
client_imm
=
NULL
;
}
return
ref
;
}
...
...
@@ -380,20 +387,15 @@ static void imm_coinit_thread(void)
TRACE
(
"implicit COM initialization
\n
"
);
if
(
spy_tls
==
TLS_OUT_OF_INDEXES
)
{
DWORD
tls
=
TlsAlloc
();
if
(
tls
==
TLS_OUT_OF_INDEXES
)
return
;
if
(
InterlockedCompareExchange
(
&
spy_tls
,
tls
,
TLS_OUT_OF_INDEXES
))
TlsFree
(
tls
);
}
if
(
!
(
spy
=
TlsGetValue
(
spy_tls
)))
if
(
!
(
spy
=
get_thread_coinit_spy
()))
{
if
(
!
(
spy
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
*
spy
))))
return
;
spy
->
IInitializeSpy_iface
.
lpVtbl
=
&
InitializeSpyVtbl
;
spy
->
ref
=
1
;
spy
->
cookie
.
QuadPart
=
0
;
spy
->
apt_flags
=
0
;
TlsSetValue
(
spy_tls
,
spy
);
NtUserGetThreadInfo
()
->
client_imm
=
spy
;
}
if
(
spy
->
apt_flags
&
(
IMM_APT_INIT
|
IMM_APT_BROKEN
))
...
...
@@ -474,7 +476,8 @@ static void IMM_FreeThreadData(void)
}
LeaveCriticalSection
(
&
threaddata_cs
);
if
((
spy
=
TlsGetValue
(
spy_tls
)))
IInitializeSpy_Release
(
&
spy
->
IInitializeSpy_iface
);
if
((
spy
=
get_thread_coinit_spy
()))
IInitializeSpy_Release
(
&
spy
->
IInitializeSpy_iface
);
}
static
HMODULE
load_graphics_driver
(
void
)
...
...
@@ -754,6 +757,7 @@ BOOL WINAPI ImmSetActiveContext(HWND hwnd, HIMC himc, BOOL activate)
SendMessageW
(
hwnd
,
WM_IME_SETCONTEXT
,
activate
,
ISC_SHOWUIALL
);
/* TODO: send WM_IME_NOTIFY */
}
SetLastError
(
0
);
return
TRUE
;
}
...
...
include/ntuser.h
View file @
3e8a4b67
...
...
@@ -63,6 +63,7 @@ struct ntuser_thread_info
ULONG_PTR
message_extra
;
/* value for GetMessageExtraInfo */
HWND
top_window
;
/* desktop window */
HWND
msg_window
;
/* HWND_MESSAGE parent window */
void
*
client_imm
;
/* client IMM thread info */
};
static
inline
struct
ntuser_thread_info
*
NtUserGetThreadInfo
(
void
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment