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
f3967902
Commit
f3967902
authored
Feb 25, 2015
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 26, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm32: Do not let ImmDestroyContext destroy any default contexts.
parent
e28fc117
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
5 deletions
+15
-5
imm.c
dlls/imm32/imm.c
+15
-5
No files found.
dlls/imm32/imm.c
View file @
f3967902
...
...
@@ -77,6 +77,7 @@ typedef struct tagInputContextData
ImmHkl
*
immKbd
;
UINT
lastVK
;
BOOL
threadDefault
;
DWORD
magic
;
}
InputContextData
;
...
...
@@ -119,6 +120,7 @@ static CRITICAL_SECTION threaddata_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
#define is_kbd_ime_unicode(p) (p->imeInfo.fdwProperty & IME_PROP_UNICODE)
static
BOOL
IMM_DestroyContext
(
HIMC
hIMC
);
static
InputContextData
*
get_imc_data
(
HIMC
hIMC
);
static
inline
WCHAR
*
strdupAtoW
(
const
char
*
str
)
{
...
...
@@ -244,6 +246,16 @@ static IMMThreadData* IMM_GetThreadData(DWORD id)
return
data
;
}
static
BOOL
IMM_IsDefaultContext
(
HIMC
imc
)
{
InputContextData
*
data
=
get_imc_data
(
imc
);
if
(
!
data
)
return
FALSE
;
return
data
->
threadDefault
;
}
static
void
IMM_FreeThreadData
(
void
)
{
IMMThreadData
*
data
;
...
...
@@ -478,6 +490,8 @@ static IMMThreadData* IMM_GetInitializedThreadData(void)
HIMC
defaultContext
;
LeaveCriticalSection
(
&
threaddata_cs
);
defaultContext
=
ImmCreateContext
();
if
(
defaultContext
)
((
InputContextData
*
)
defaultContext
)
->
threadDefault
=
TRUE
;
thread_data
=
IMM_GetThreadData
(
0
);
if
(
!
thread_data
)
{
...
...
@@ -780,11 +794,7 @@ static BOOL IMM_DestroyContext(HIMC hIMC)
*/
BOOL
WINAPI
ImmDestroyContext
(
HIMC
hIMC
)
{
IMMThreadData
*
thread_data
=
IMM_GetThreadData
(
0
);
HIMC
defaultContext
=
thread_data
->
defaultContext
;
LeaveCriticalSection
(
&
threaddata_cs
);
if
(
hIMC
!=
defaultContext
)
if
(
!
IMM_IsDefaultContext
(
hIMC
))
return
IMM_DestroyContext
(
hIMC
);
else
return
FALSE
;
...
...
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