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
675f701d
Commit
675f701d
authored
Nov 28, 2004
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed is_valid_winproc to avoid being optimized out by recent gcc
versions.
parent
eba27af4
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
7 deletions
+9
-7
winproc.c
windows/winproc.c
+9
-7
No files found.
windows/winproc.c
View file @
675f701d
...
...
@@ -138,10 +138,10 @@ static CRITICAL_SECTION winproc_cs = { &critsect_debug, -1, 0, 0, 0, 0 };
static
BOOL
is_valid_winproc
(
WINDOWPROC
*
proc
)
{
/* check alignment */
if
(((
BYTE
*
)
proc
-
(
BYTE
*
)
winproc_array
)
%
sizeof
(
*
proc
))
return
FALSE
;
/* check array limits */
if
(
proc
<
winproc_array
||
proc
>=
winproc_array
+
winproc_used
)
return
FALSE
;
/* check alignment */
if
(
proc
!=
winproc_array
+
(
proc
-
winproc_array
))
return
FALSE
;
return
(
proc
->
type
!=
WIN_PROC_INVALID
);
}
...
...
@@ -514,20 +514,22 @@ static WINDOWPROC *WINPROC_GetPtr( WNDPROC handle )
ptr
=
(
BYTE
*
)
handle
;
/* First check if it is the jmp address */
proc
=
(
WINDOWPROC
*
)(
ptr
-
(
int
)
&
((
WINDOWPROC
*
)
0
)
->
jmp
);
proc
=
(
WINDOWPROC
*
)(
ptr
-
FIELD_OFFSET
(
WINDOWPROC
,
jmp
)
);
if
(
is_valid_winproc
(
proc
))
return
proc
;
/* Now it must be the thunk address */
proc
=
(
WINDOWPROC
*
)(
ptr
-
(
int
)
&
((
WINDOWPROC
*
)
0
)
->
thunk
);
proc
=
(
WINDOWPROC
*
)(
ptr
-
FIELD_OFFSET
(
WINDOWPROC
,
thunk
)
);
if
(
is_valid_winproc
(
proc
))
return
proc
;
/* Check for a segmented pointer */
ptr
=
MapSL
(
(
SEGPTR
)
handle
);
if
(
HIWORD
(
handle
)
==
get_winproc_selector
())
{
ptr
=
(
BYTE
*
)
winproc_array
+
LOWORD
(
handle
);
/* It must be the thunk address */
proc
=
(
WINDOWPROC
*
)(
ptr
-
(
int
)
&
((
WINDOWPROC
*
)
0
)
->
thunk
);
proc
=
(
WINDOWPROC
*
)(
ptr
-
FIELD_OFFSET
(
WINDOWPROC
,
thunk
)
);
if
(
is_valid_winproc
(
proc
))
return
proc
;
}
return
NULL
;
}
...
...
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