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
69080d6d
Commit
69080d6d
authored
Sep 26, 2009
by
Nikolay Sivov
Committed by
Alexandre Julliard
Sep 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32/monthcal: Add parameter validation to MCM_HITTEST handler.
parent
1224cc46
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
monthcal.c
dlls/comctl32/monthcal.c
+4
-0
monthcal.c
dlls/comctl32/tests/monthcal.c
+15
-2
commctrl.h
include/commctrl.h
+7
-0
No files found.
dlls/comctl32/monthcal.c
View file @
69080d6d
...
...
@@ -1141,6 +1141,7 @@ MONTHCAL_HitTest(const MONTHCAL_INFO *infoPtr, MCHITTESTINFO *lpht)
DWORD
retval
;
int
day
,
wday
,
wnum
;
if
(
!
lpht
||
lpht
->
cbSize
<
MCHITTESTINFO_V1_SIZE
)
return
-
1
;
x
=
lpht
->
pt
.
x
;
y
=
lpht
->
pt
.
y
;
...
...
@@ -1417,6 +1418,7 @@ MONTHCAL_LButtonDown(MONTHCAL_INFO *infoPtr, LPARAM lParam)
InvalidateRect
(
infoPtr
->
hwndSelf
,
NULL
,
FALSE
);
}
ht
.
cbSize
=
sizeof
(
MCHITTESTINFO
);
ht
.
pt
.
x
=
(
short
)
LOWORD
(
lParam
);
ht
.
pt
.
y
=
(
short
)
HIWORD
(
lParam
);
TRACE
(
"(%d, %d)
\n
"
,
ht
.
pt
.
x
,
ht
.
pt
.
y
);
...
...
@@ -1550,6 +1552,7 @@ MONTHCAL_LButtonUp(MONTHCAL_INFO *infoPtr, LPARAM lParam)
redraw
=
TRUE
;
}
ht
.
cbSize
=
sizeof
(
MCHITTESTINFO
);
ht
.
pt
.
x
=
(
short
)
LOWORD
(
lParam
);
ht
.
pt
.
y
=
(
short
)
HIWORD
(
lParam
);
hit
=
MONTHCAL_HitTest
(
infoPtr
,
&
ht
);
...
...
@@ -1628,6 +1631,7 @@ MONTHCAL_MouseMove(MONTHCAL_INFO *infoPtr, LPARAM lParam)
if
(
!
(
infoPtr
->
status
&
MC_SEL_LBUTDOWN
))
return
0
;
ht
.
cbSize
=
sizeof
(
MCHITTESTINFO
);
ht
.
pt
.
x
=
(
short
)
LOWORD
(
lParam
);
ht
.
pt
.
y
=
(
short
)
HIWORD
(
lParam
);
...
...
dlls/comctl32/tests/monthcal.c
View file @
69080d6d
...
...
@@ -867,6 +867,19 @@ static void test_monthcal_hittest(void)
hwnd
=
create_monthcal_control
(
0
);
/* test with invalid structure size */
mchit
.
cbSize
=
MCHITTESTINFO_V1_SIZE
-
1
;
mchit
.
pt
.
x
=
0
;
mchit
.
pt
.
y
=
0
;
res
=
SendMessage
(
hwnd
,
MCM_HITTEST
,
0
,
(
LPARAM
)
&
mchit
);
expect
(
0
,
mchit
.
pt
.
x
);
expect
(
0
,
mchit
.
pt
.
y
);
expect
(
-
1
,
res
);
expect
(
0
,
mchit
.
uHit
);
/* test with invalid pointer */
res
=
SendMessage
(
hwnd
,
MCM_HITTEST
,
0
,
(
LPARAM
)
NULL
);
expect
(
-
1
,
res
);
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
st
.
wYear
=
2007
;
...
...
@@ -882,7 +895,7 @@ static void test_monthcal_hittest(void)
expect
(
1
,
res
);
/* (0, 0) is the top left of the control and should not be active */
mchit
.
cbSize
=
sizeof
(
MCHITTESTINFO
)
;
mchit
.
cbSize
=
MCHITTESTINFO_V1_SIZE
;
mchit
.
pt
.
x
=
0
;
mchit
.
pt
.
y
=
0
;
res
=
SendMessage
(
hwnd
,
MCM_HITTEST
,
0
,
(
LPARAM
)
&
mchit
);
...
...
@@ -1051,7 +1064,7 @@ static void test_monthcal_todaylink(void)
flush_sequences
(
sequences
,
NUM_MSG_SEQUENCES
);
/* (70, 370) is in active area - today link */
mchit
.
cbSize
=
sizeof
(
MCHITTESTINFO
)
;
mchit
.
cbSize
=
MCHITTESTINFO_V1_SIZE
;
mchit
.
pt
.
x
=
70
;
mchit
.
pt
.
y
=
370
;
res
=
SendMessage
(
hwnd
,
MCM_HITTEST
,
0
,
(
LPARAM
)
&
mchit
);
...
...
include/commctrl.h
View file @
69080d6d
...
...
@@ -4702,8 +4702,15 @@ typedef struct {
POINT
pt
;
UINT
uHit
;
SYSTEMTIME
st
;
/* Vista */
RECT
rc
;
INT
iOffset
;
INT
iRow
;
INT
iCol
;
}
MCHITTESTINFO
,
*
PMCHITTESTINFO
;
#define MCHITTESTINFO_V1_SIZE CCSIZEOF_STRUCT(MCHITTESTINFO, st)
typedef
struct
tagNMSELCHANGE
{
NMHDR
nmhdr
;
...
...
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