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
6bcdc69e
Commit
6bcdc69e
authored
Aug 07, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Aug 07, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/treeview: Check passed handle value in WM_COMMAND handler.
parent
83c9cdb7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
2 deletions
+21
-2
treeview.c
dlls/comctl32/tests/treeview.c
+16
-0
treeview.c
dlls/comctl32/treeview.c
+5
-2
No files found.
dlls/comctl32/tests/treeview.c
View file @
6bcdc69e
...
...
@@ -879,9 +879,25 @@ static void test_itemedit(void)
/* item shouldn't be selected automatically after TVM_EDITLABEL */
r
=
SendMessage
(
hTree
,
TVM_GETITEMSTATE
,
(
WPARAM
)
hRoot
,
TVIS_SELECTED
);
expect
(
0
,
r
);
/* try to cancel with wrong edit handle */
r
=
SendMessage
(
hTree
,
WM_COMMAND
,
MAKEWPARAM
(
0
,
EN_KILLFOCUS
),
(
LPARAM
)
NULL
);
expect
(
0
,
r
);
ok
(
IsWindow
(
edit
),
"Expected edit control to be valid
\n
"
);
r
=
SendMessage
(
hTree
,
WM_COMMAND
,
MAKEWPARAM
(
0
,
EN_KILLFOCUS
),
(
LPARAM
)
edit
);
expect
(
0
,
r
);
ok
(
!
IsWindow
(
edit
),
"Expected edit control to be destroyed
\n
"
);
/* try to cancel without creating edit */
r
=
SendMessage
(
hTree
,
WM_COMMAND
,
MAKEWPARAM
(
0
,
EN_KILLFOCUS
),
(
LPARAM
)
NULL
);
expect
(
0
,
r
);
/* try to cancel with wrong (not null) handle */
edit
=
(
HWND
)
SendMessage
(
hTree
,
TVM_EDITLABEL
,
0
,
(
LPARAM
)
hRoot
);
ok
(
IsWindow
(
edit
),
"Expected valid handle
\n
"
);
r
=
SendMessage
(
hTree
,
WM_COMMAND
,
MAKEWPARAM
(
0
,
EN_KILLFOCUS
),
(
LPARAM
)
hTree
);
expect
(
0
,
r
);
ok
(
IsWindow
(
edit
),
"Expected edit control to be valid
\n
"
);
r
=
SendMessage
(
hTree
,
WM_COMMAND
,
MAKEWPARAM
(
0
,
EN_KILLFOCUS
),
(
LPARAM
)
edit
);
expect
(
0
,
r
);
/* remove selection after starting edit */
r
=
TreeView_SelectItem
(
hTree
,
hRoot
);
...
...
dlls/comctl32/treeview.c
View file @
6bcdc69e
...
...
@@ -3651,8 +3651,11 @@ TREEVIEW_Command(TREEVIEW_INFO *infoPtr, WPARAM wParam, LPARAM lParam)
break
;
}
case
EN_KILLFOCUS
:
TREEVIEW_EndEditLabelNow
(
infoPtr
,
FALSE
);
break
;
/* apparently we should respect passed handle value */
if
(
infoPtr
->
hwndEdit
!=
(
HWND
)
lParam
)
return
FALSE
;
TREEVIEW_EndEditLabelNow
(
infoPtr
,
FALSE
);
break
;
default:
return
SendMessageW
(
infoPtr
->
hwndNotify
,
WM_COMMAND
,
wParam
,
lParam
);
...
...
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