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
3d7a6535
Commit
3d7a6535
authored
Apr 05, 2007
by
Mikołaj Zalewski
Committed by
Alexandre Julliard
Apr 24, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: toolbar: Don't execute TB_GETBUTTONINFO if cbSize is invalid.
parent
10b1d001
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
1 deletion
+32
-1
toolbar.c
dlls/comctl32/tests/toolbar.c
+23
-0
toolbar.c
dlls/comctl32/toolbar.c
+9
-1
No files found.
dlls/comctl32/tests/toolbar.c
View file @
3d7a6535
...
...
@@ -864,6 +864,28 @@ static void test_sizes(void)
DestroyWindow
(
hToolbar
);
}
static
void
test_getbuttoninfo
(
void
)
{
HWND
hToolbar
=
NULL
;
int
i
;
rebuild_toolbar_with_buttons
(
&
hToolbar
);
for
(
i
=
0
;
i
<
128
;
i
++
)
{
TBBUTTONINFO
tbi
;
int
ret
;
tbi
.
cbSize
=
i
;
tbi
.
dwMask
=
TBIF_BYINDEX
|
TBIF_COMMAND
;
ret
=
(
int
)
SendMessage
(
hToolbar
,
TB_GETBUTTONINFO
,
0
,
(
LPARAM
)
&
tbi
);
if
(
i
==
sizeof
(
TBBUTTONINFO
))
{
compare
(
ret
,
0
,
"%d"
);
}
else
{
compare
(
ret
,
-
1
,
"%d"
);
}
}
DestroyWindow
(
hToolbar
);
}
static
void
test_createtoolbarex
()
{
...
...
@@ -933,6 +955,7 @@ START_TEST(toolbar)
test_add_string
();
test_hotitem
();
test_sizes
();
test_getbuttoninfo
();
test_createtoolbarex
();
PostQuitMessage
(
0
);
...
...
dlls/comctl32/toolbar.c
View file @
3d7a6535
...
...
@@ -3364,8 +3364,16 @@ TOOLBAR_GetButtonInfoT(HWND hwnd, WPARAM wParam, LPARAM lParam, BOOL bUnicode)
if
(
lpTbInfo
==
NULL
)
return
-
1
;
if
(
lpTbInfo
->
cbSize
<
sizeof
(
TBBUTTONINFOA
))
/* MSDN documents a iImageLabel field added in Vista but it is not present in
* the headers and tests shows that even with comctl 6 Vista accepts only the
* original TBBUTTONINFO size
*/
if
(
lpTbInfo
->
cbSize
!=
sizeof
(
TBBUTTONINFOW
))
{
WARN
(
"Invalid button size
\n
"
);
return
-
1
;
}
nIndex
=
TOOLBAR_GetButtonIndex
(
infoPtr
,
(
INT
)
wParam
,
lpTbInfo
->
dwMask
&
0x80000000
);
...
...
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