Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
fd67f32e
Commit
fd67f32e
authored
Feb 15, 2008
by
Aric Stewart
Committed by
Alexandre Julliard
Feb 16, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
imm: Ensure hCompStr handle is not NULL and check for empty composition strings properly.
parent
e9063b77
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
imm.c
dlls/imm32/imm.c
+21
-3
No files found.
dlls/imm32/imm.c
View file @
fd67f32e
...
...
@@ -194,6 +194,18 @@ static LRESULT ImmInternalSendIMENotify(WPARAM notify, LPARAM lParam)
return
0
;
}
static
HIMCC
ImmCreateBlankCompStr
(
void
)
{
HIMCC
rc
;
LPCOMPOSITIONSTRING
ptr
;
rc
=
ImmCreateIMCC
(
sizeof
(
COMPOSITIONSTRING
));
ptr
=
(
LPCOMPOSITIONSTRING
)
ImmLockIMCC
(
rc
);
memset
(
ptr
,
0
,
sizeof
(
COMPOSITIONSTRING
));
ptr
->
dwSize
=
sizeof
(
COMPOSITIONSTRING
);
ImmUnlockIMCC
(
rc
);
return
rc
;
}
static
void
ImmInternalSetOpenStatus
(
BOOL
fOpen
)
{
TRACE
(
"Setting internal state to %s
\n
"
,(
fOpen
)
?
"OPEN"
:
"CLOSED"
);
...
...
@@ -202,7 +214,7 @@ static void ImmInternalSetOpenStatus(BOOL fOpen)
{
ShowWindow
(
hwndDefault
,
SW_HIDE
);
ImmDestroyIMCC
(
root_context
->
IMC
.
hCompStr
);
root_context
->
IMC
.
hCompStr
=
NULL
;
root_context
->
IMC
.
hCompStr
=
ImmCreateBlankCompStr
()
;
}
root_context
->
IMC
.
fOpen
=
fOpen
;
...
...
@@ -597,6 +609,9 @@ HIMC WINAPI ImmCreateContext(void)
new_context
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
InputContextData
));
/* hCompStr is never NULL */
new_context
->
IMC
.
hCompStr
=
ImmCreateBlankCompStr
();
return
(
HIMC
)
new_context
;
}
...
...
@@ -1411,14 +1426,17 @@ BOOL WINAPI ImmNotifyIME(
TRACE
(
"%s - %s
\n
"
,
"NI_COMPOSITIONSTR"
,
"CPS_CANCEL"
);
{
BOOL
send
;
LPCOMPOSITIONSTRING
lpCompStr
;
if
(
pX11DRV_ForceXIMReset
)
pX11DRV_ForceXIMReset
(
root_context
->
IMC
.
hWnd
);
send
=
(
root_context
->
IMC
.
hCompStr
!=
NULL
);
lpCompStr
=
ImmLockIMCC
(
root_context
->
IMC
.
hCompStr
);
send
=
(
lpCompStr
->
dwCompStrLen
!=
0
);
ImmUnlockIMCC
(
root_context
->
IMC
.
hCompStr
);
ImmDestroyIMCC
(
root_context
->
IMC
.
hCompStr
);
root_context
->
IMC
.
hCompStr
=
NULL
;
root_context
->
IMC
.
hCompStr
=
ImmCreateBlankCompStr
()
;
if
(
send
)
ImmInternalPostIMEMessage
(
WM_IME_COMPOSITION
,
0
,
...
...
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