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
e58af930
Commit
e58af930
authored
Oct 16, 2013
by
Piotr Caban
Committed by
Alexandre Julliard
Oct 16, 2013
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
comctl32: Fix UDM_GETPOS behaviour on out of range values.
parent
ac31df43
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
5 deletions
+25
-5
updown.c
dlls/comctl32/updown.c
+25
-5
No files found.
dlls/comctl32/updown.c
View file @
e58af930
...
...
@@ -482,6 +482,25 @@ static LRESULT UPDOWN_KeyPressed(UPDOWN_INFO *infoPtr, int key)
return
0
;
}
static
int
UPDOWN_GetPos
(
UPDOWN_INFO
*
infoPtr
,
BOOL
*
err
)
{
BOOL
succ
=
UPDOWN_GetBuddyInt
(
infoPtr
);
int
val
=
infoPtr
->
CurVal
;
if
(
!
UPDOWN_InBounds
(
infoPtr
,
val
))
{
if
((
infoPtr
->
MinVal
<
infoPtr
->
MaxVal
&&
val
<
infoPtr
->
MinVal
)
||
(
infoPtr
->
MinVal
>
infoPtr
->
MaxVal
&&
val
>
infoPtr
->
MinVal
))
val
=
infoPtr
->
MinVal
;
else
val
=
infoPtr
->
MaxVal
;
succ
=
FALSE
;
}
if
(
err
)
*
err
=
!
succ
;
return
val
;
}
static
int
UPDOWN_SetPos
(
UPDOWN_INFO
*
infoPtr
,
int
pos
)
{
int
ret
=
infoPtr
->
CurVal
;
...
...
@@ -1090,8 +1109,11 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
case
UDM_GETPOS
:
{
BOOL
ret
=
UPDOWN_GetBuddyInt
(
infoPtr
);
return
MAKELONG
(
infoPtr
->
CurVal
,
ret
?
0
:
1
);
BOOL
err
;
int
pos
;
pos
=
UPDOWN_GetPos
(
infoPtr
,
&
err
);
return
MAKELONG
(
pos
,
err
);
}
case
UDM_SETPOS
:
{
...
...
@@ -1119,9 +1141,7 @@ static LRESULT WINAPI UpDownWindowProc(HWND hwnd, UINT message, WPARAM wParam, L
case
UDM_GETPOS32
:
{
BOOL
ret
=
UPDOWN_GetBuddyInt
(
infoPtr
);
if
((
LPBOOL
)
lParam
)
*
((
LPBOOL
)
lParam
)
=
!
ret
;
return
infoPtr
->
CurVal
;
return
UPDOWN_GetPos
(
infoPtr
,
(
BOOL
*
)
lParam
);
}
case
UDM_SETPOS32
:
{
...
...
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