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
6bac4f2c
Commit
6bac4f2c
authored
Sep 29, 2000
by
Stephane Lussier
Committed by
Alexandre Julliard
Sep 29, 2000
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Before calling the timer window proc, make sure it is valid.
parent
cc9cfdff
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
0 deletions
+46
-0
message.h
include/message.h
+2
-0
message.c
windows/message.c
+20
-0
timer.c
windows/timer.c
+24
-0
No files found.
include/message.h
View file @
6bac4f2c
...
...
@@ -9,6 +9,7 @@
#include "windef.h"
#include "wine/windef16.h"
#include "winproc.h"
struct
tagMSG
;
...
...
@@ -22,6 +23,7 @@ extern void TIMER_RemoveWindowTimers( HWND hwnd );
extern
void
TIMER_RemoveQueueTimers
(
HQUEUE16
hqueue
);
extern
BOOL
TIMER_GetTimerMsg
(
struct
tagMSG
*
msg
,
HWND
hwnd
,
HQUEUE16
hQueue
,
BOOL
remove
);
extern
BOOL
TIMER_IsTimerValid
(
HWND
hwnd
,
UINT
id
,
HWINDOWPROC
hProc
);
/* event.c */
extern
void
EVENT_Synchronize
(
void
);
...
...
windows/message.c
View file @
6bac4f2c
...
...
@@ -2283,6 +2283,12 @@ LONG WINAPI DispatchMessage16( const MSG16* msg )
{
if
(
msg
->
lParam
)
{
/* before calling window proc, verify it the timer is still valid,
there's a slim chance the application kill the timer between
getMessage and DisaptachMessage API calls */
if
(
!
TIMER_IsTimerValid
(
msg
->
hwnd
,
(
UINT
)
msg
->
wParam
,
(
HWINDOWPROC
)
msg
->
lParam
))
return
0
;
/* invalid winproc */
return
CallWindowProc16
(
(
WNDPROC16
)
msg
->
lParam
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
GetTickCount
()
);
}
...
...
@@ -2359,6 +2365,13 @@ LONG WINAPI DispatchMessageA( const MSG* msg )
if
(
msg
->
lParam
)
{
/* HOOK_CallHooks32A( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
/* before calling window proc, verify it the timer is still valid,
there's a slim chance the application kill the timer between
getMessage and DisaptachMessage API calls */
if
(
!
TIMER_IsTimerValid
(
msg
->
hwnd
,
(
UINT
)
msg
->
wParam
,
(
HWINDOWPROC
)
msg
->
lParam
))
return
0
;
/* invalid winproc */
return
CallWindowProcA
(
(
WNDPROC
)
msg
->
lParam
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
GetTickCount
()
);
}
...
...
@@ -2434,6 +2447,13 @@ LONG WINAPI DispatchMessageW( const MSG* msg )
if
(
msg
->
lParam
)
{
/* HOOK_CallHooks32W( WH_CALLWNDPROC, HC_ACTION, 0, FIXME ); */
/* before calling window proc, verify it the timer is still valid,
there's a slim chance the application kill the timer between
getMessage and DisaptachMessage API calls */
if
(
!
TIMER_IsTimerValid
(
msg
->
hwnd
,
(
UINT
)
msg
->
wParam
,
(
HWINDOWPROC
)
msg
->
lParam
))
return
0
;
/* invalid winproc */
return
CallWindowProcW
(
(
WNDPROC
)
msg
->
lParam
,
msg
->
hwnd
,
msg
->
message
,
msg
->
wParam
,
GetTickCount
()
);
}
...
...
windows/timer.c
View file @
6bac4f2c
...
...
@@ -317,6 +317,30 @@ UINT WINAPI SetTimer( HWND hwnd, UINT id, UINT timeout,
/***********************************************************************
* TIMER_IsTimerValid
*/
BOOL
TIMER_IsTimerValid
(
HWND
hwnd
,
UINT
id
,
HWINDOWPROC
hProc
)
{
int
i
;
TIMER
*
pTimer
;
BOOL
ret
=
FALSE
;
EnterCriticalSection
(
&
csTimer
);
for
(
i
=
0
,
pTimer
=
TimersArray
;
i
<
NB_TIMERS
;
i
++
,
pTimer
++
)
if
((
pTimer
->
hwnd
==
hwnd
)
&&
(
pTimer
->
id
==
id
)
&&
(
pTimer
->
proc
==
hProc
))
{
ret
=
TRUE
;
break
;
}
LeaveCriticalSection
(
&
csTimer
);
return
ret
;
}
/***********************************************************************
* SetSystemTimer16 (USER.11)
*/
UINT16
WINAPI
SetSystemTimer16
(
HWND16
hwnd
,
UINT16
id
,
UINT16
timeout
,
...
...
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