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
9ee5f265
Commit
9ee5f265
authored
Jun 29, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Jun 30, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/rebar: Use proper structure size in tests and parameter checks.
parent
aa9602db
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
16 deletions
+19
-16
rebar.c
dlls/comctl32/rebar.c
+7
-7
rebar.c
dlls/comctl32/tests/rebar.c
+9
-9
commctrl.h
include/commctrl.h
+3
-0
No files found.
dlls/comctl32/rebar.c
View file @
9ee5f265
...
...
@@ -1699,11 +1699,11 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
if
(
(
lprbbi
->
fMask
&
RBBIM_CHILDSIZE
)
&&
(
(
lpBand
->
cxMinChild
!=
lprbbi
->
cxMinChild
)
||
(
lpBand
->
cyMinChild
!=
lprbbi
->
cyMinChild
)
||
(
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFOA
)
&&
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
&&
(
(
lprbbi
->
cbSize
>=
REBARBANDINFOA_V6_SIZE
&&
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
&&
(
(
lpBand
->
cyChild
!=
lprbbi
->
cyChild
)
||
(
lpBand
->
cyMaxChild
!=
lprbbi
->
cyMaxChild
)
||
(
lpBand
->
cyIntegral
!=
lprbbi
->
cyIntegral
)
)
)
||
(
(
lprbbi
->
cbSize
<
sizeof
(
REBARBANDINFOA
)
)
&&
(
(
lprbbi
->
cbSize
<
REBARBANDINFOA_V6_SIZE
)
&&
(
(
lpBand
->
cyChild
||
lpBand
->
cyMaxChild
||
lpBand
->
cyIntegral
)
)
)
)
)
...
...
@@ -1711,7 +1711,7 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
lpBand
->
cxMinChild
=
lprbbi
->
cxMinChild
;
lpBand
->
cyMinChild
=
lprbbi
->
cyMinChild
;
/* These fields where added in WIN32_IE == 0x400 and are set only for RBBS_VARIABLEHEIGHT bands */
if
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFOA
)
&&
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
{
if
(
lprbbi
->
cbSize
>=
REBARBANDINFOA_V6_SIZE
&&
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
{
lpBand
->
cyMaxChild
=
lprbbi
->
cyMaxChild
;
lpBand
->
cyIntegral
=
lprbbi
->
cyIntegral
;
...
...
@@ -1747,7 +1747,7 @@ REBAR_CommonSetupBand(HWND hwnd, const REBARBANDINFOW *lprbbi, REBAR_BAND *lpBan
}
/* check for additional data */
if
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFOA
)
)
{
if
(
lprbbi
->
cbSize
>=
REBARBANDINFOA_V6_SIZE
)
{
if
(
(
lprbbi
->
fMask
&
RBBIM_IDEALSIZE
)
&&
(
lpBand
->
cxIdeal
!=
lprbbi
->
cxIdeal
)
)
{
...
...
@@ -2167,7 +2167,7 @@ REBAR_GetBandInfoT(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL
lprbbi
->
cyMinChild
=
lpBand
->
cyMinChild
;
/* to make tests pass we follow Windows behaviour and allow to read these fields only
* for RBBS_VARIABLEHEIGHTS bands */
if
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFOA
)
&&
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
{
if
(
lprbbi
->
cbSize
>=
REBARBANDINFOW_V6_SIZE
&&
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
{
lprbbi
->
cyChild
=
lpBand
->
cyChild
;
lprbbi
->
cyMaxChild
=
lpBand
->
cyMaxChild
;
lprbbi
->
cyIntegral
=
lpBand
->
cyIntegral
;
...
...
@@ -2184,7 +2184,7 @@ REBAR_GetBandInfoT(const REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL
lprbbi
->
wID
=
lpBand
->
wID
;
/* check for additional data */
if
(
lprbbi
->
cbSize
>=
sizeof
(
REBARBANDINFOA
)
)
{
if
(
lprbbi
->
cbSize
>=
REBARBANDINFOW_V6_SIZE
)
{
if
(
lprbbi
->
fMask
&
RBBIM_IDEALSIZE
)
lprbbi
->
cxIdeal
=
lpBand
->
cxIdeal
;
...
...
@@ -2424,7 +2424,7 @@ REBAR_InsertBandT(REBAR_INFO *infoPtr, WPARAM wParam, LPARAM lParam, BOOL bUnico
REBAR_CommonSetupBand
(
infoPtr
->
hwndSelf
,
lprbbi
,
lpBand
);
/* Make sure the defaults for these are correct */
if
(
lprbbi
->
cbSize
<
sizeof
(
REBARBANDINFOA
)
||
!
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
{
if
(
lprbbi
->
cbSize
<
REBARBANDINFOA_V6_SIZE
||
!
(
lpBand
->
fStyle
&
RBBS_VARIABLEHEIGHT
))
{
lpBand
->
cyChild
=
lpBand
->
cyMinChild
;
lpBand
->
cyMaxChild
=
0x7fffffff
;
lpBand
->
cyIntegral
=
0
;
...
...
dlls/comctl32/tests/rebar.c
View file @
9ee5f265
...
...
@@ -150,7 +150,7 @@ static void dump_sizes(HWND hRebar)
for (i=0; i<count; i++)
{
REBARBANDINFO rbi;
rbi.cbSize =
sizeof(REBARBANDINFO)
;
rbi.cbSize =
REBARBANDINFOA_V6_SIZE
;
rbi.fMask = RBBIM_SIZE | RBBIM_CHILDSIZE | RBBIM_STYLE;
ok(SendMessageA(hRebar, RB_GETBANDINFOA, i, (LPARAM)&rbi), "RB_GETBANDINFO failed\n");
ok(SendMessageA(hRebar, RB_GETRECT, i, (LPARAM)&r), "RB_GETRECT failed\n");
...
...
@@ -313,7 +313,7 @@ static int rbsize_numtests = 0;
ok(SendMessageA(hRebar, RB_GETRECT, i, (LPARAM)&rc) == 1, "RB_GETRECT\n"); \
if (!(res->bands[i].fStyle & RBBS_HIDDEN)) \
check_rect("band", rc, res->bands[i].rc); \
rbi.cbSize =
sizeof(REBARBANDINFO)
; \
rbi.cbSize =
REBARBANDINFOA_V6_SIZE
; \
rbi.fMask = RBBIM_STYLE | RBBIM_SIZE; \
ok(SendMessageA(hRebar, RB_GETBANDINFO, i, (LPARAM)&rbi) == 1, "RB_GETBANDINFO\n"); \
compare(rbi.fStyle, res->bands[i].fStyle, "%x"); \
...
...
@@ -329,11 +329,11 @@ static int rbsize_numtests = 0;
static
void
add_band_w
(
HWND
hRebar
,
LPCSTR
lpszText
,
int
cxMinChild
,
int
cx
,
int
cxIdeal
)
{
CHAR
buffer
[
MAX_PATH
];
REBARBANDINFO
rbi
;
REBARBANDINFO
A
rbi
;
if
(
lpszText
!=
NULL
)
strcpy
(
buffer
,
lpszText
);
rbi
.
cbSize
=
sizeof
(
rbi
)
;
rbi
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rbi
.
fMask
=
RBBIM_SIZE
|
RBBIM_CHILDSIZE
|
RBBIM_CHILD
|
RBBIM_IDEALSIZE
|
RBBIM_TEXT
;
rbi
.
cx
=
cx
;
rbi
.
cxMinChild
=
cxMinChild
;
...
...
@@ -353,7 +353,7 @@ static void layout_test(void)
rebuild_rebar
(
&
hRebar
);
check_sizes
();
rbi
.
cbSize
=
sizeof
(
rbi
)
;
rbi
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rbi
.
fMask
=
RBBIM_SIZE
|
RBBIM_CHILDSIZE
|
RBBIM_CHILD
;
rbi
.
cx
=
200
;
rbi
.
cxMinChild
=
100
;
...
...
@@ -742,10 +742,10 @@ static void expect_band_content(UINT uBand, INT fStyle, COLORREF clrFore,
INT
cxHeader
)
{
CHAR
buf
[
MAX_PATH
]
=
"abc"
;
REBARBANDINFO
rb
;
REBARBANDINFO
A
rb
;
memset
(
&
rb
,
0xdd
,
sizeof
(
rb
));
rb
.
cbSize
=
sizeof
(
rb
)
;
rb
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rb
.
fMask
=
RBBIM_BACKGROUND
|
RBBIM_CHILD
|
RBBIM_CHILDSIZE
|
RBBIM_COLORS
|
RBBIM_HEADERSIZE
|
RBBIM_ID
|
RBBIM_IDEALSIZE
|
RBBIM_IMAGE
|
RBBIM_LPARAM
|
RBBIM_SIZE
|
RBBIM_STYLE
|
RBBIM_TEXT
;
...
...
@@ -779,7 +779,7 @@ static void bandinfo_test(void)
CHAR
szABCD
[]
=
"ABCD"
;
rebuild_rebar
(
&
hRebar
);
rb
.
cbSize
=
sizeof
(
REBARBANDINFO
)
;
rb
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rb
.
fMask
=
0
;
ok
(
SendMessageA
(
hRebar
,
RB_INSERTBANDA
,
0
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
0
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
""
,
-
1
,
NULL
,
0
,
0
,
0
,
NULL
,
0
,
0xdddddddd
,
0xdddddddd
,
0xdddddddd
,
0
,
0
,
0
);
...
...
@@ -798,7 +798,7 @@ static void bandinfo_test(void)
ok
(
SendMessageA
(
hRebar
,
RB_SETBANDINFOA
,
0
,
(
LPARAM
)
&
rb
),
"RB_SETBANDINFO failed
\n
"
);
expect_band_content
(
0
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
"ABC"
,
-
1
,
NULL
,
15
,
20
,
0
,
NULL
,
0
,
0xdddddddd
,
0xdddddddd
,
0xdddddddd
,
0
,
0
,
35
);
rb
.
cbSize
=
sizeof
(
REBARBANDINFO
)
;
rb
.
cbSize
=
REBARBANDINFOA_V6_SIZE
;
rb
.
fMask
=
0
;
ok
(
SendMessageA
(
hRebar
,
RB_INSERTBANDA
,
1
,
(
LPARAM
)
&
rb
),
"RB_INSERTBAND failed
\n
"
);
expect_band_content
(
1
,
0
,
0
,
GetSysColor
(
COLOR_3DFACE
),
""
,
-
1
,
NULL
,
0
,
0
,
0
,
NULL
,
0
,
0xdddddddd
,
0xdddddddd
,
0xdddddddd
,
0
,
0
,
9
);
...
...
include/commctrl.h
View file @
9ee5f265
...
...
@@ -2031,6 +2031,9 @@ typedef REBARBANDINFOW const *LPCREBARBANDINFOW;
#define REBARBANDINFOA_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, wID)
#define REBARBANDINFOW_V3_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, wID)
#define REBARBANDINFO_V3_SIZE CCSIZEOF_STRUCT(WINELIB_NAME_AW(REBARBANDINFO), wID)
#define REBARBANDINFOA_V6_SIZE CCSIZEOF_STRUCT(REBARBANDINFOA, cxHeader)
#define REBARBANDINFOW_V6_SIZE CCSIZEOF_STRUCT(REBARBANDINFOW, cxHeader)
#define REBARBANDINFO_V6_SIZE CCSIZEOF_STRUCT(WINELIB_NAME_AW(REBARBANDINFO), cxHeader)
typedef
struct
tagNMREBARCHILDSIZE
{
...
...
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