Zebediah Figura : user.exe: Implement SetSystemTimer() using SetTimer().

Alexandre Julliard julliard at winehq.org
Thu Apr 21 15:21:37 CDT 2022


Module: wine
Branch: master
Commit: 33087806a637b608367897310fda4b2b922e974b
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=33087806a637b608367897310fda4b2b922e974b

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Apr 20 19:15:28 2022 -0500

user.exe: Implement SetSystemTimer() using SetTimer().

Avoid using SetSystemTimer() to specify a callback; it does not support one.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/user.exe16/message.c      | 5 +++++
 dlls/user.exe16/user_private.h | 2 ++
 dlls/user.exe16/window.c       | 4 ++--
 3 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/dlls/user.exe16/message.c b/dlls/user.exe16/message.c
index 819d9d9b837..46561d722ed 100644
--- a/dlls/user.exe16/message.c
+++ b/dlls/user.exe16/message.c
@@ -1292,6 +1292,11 @@ LRESULT WINPROC_CallProc32ATo16( winproc_callback16_t callback, HWND hwnd, UINT
         lParam = MAKELPARAM( 0, convert_handle_32_to_16( lParam, GMEM_DDESHARE ));
         ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
         break; /* FIXME don't know how to free allocated memory (handle) !! */
+    case WM_TIMER:
+        if (wParam & SYSTEM_TIMER_FLAG)
+            msg = WM_SYSTIMER;
+        ret = callback( HWND_16(hwnd), msg, wParam, lParam, result, arg );
+        break;
     case SBM_SETRANGE:
         ret = callback( HWND_16(hwnd), SBM_SETRANGE16, 0, MAKELPARAM(wParam, lParam), result, arg );
         break;
diff --git a/dlls/user.exe16/user_private.h b/dlls/user.exe16/user_private.h
index 8a325cf9fb2..0805997246b 100644
--- a/dlls/user.exe16/user_private.h
+++ b/dlls/user.exe16/user_private.h
@@ -95,6 +95,8 @@ extern void call_WH_CALLWNDPROC_hook( HWND16 hwnd, UINT16 msg, WPARAM16 wp, LPAR
 
 #define WM_SYSTIMER 0x0118
 
+#define SYSTEM_TIMER_FLAG 0x10000
+
 /* Dialog info structure (must match the user32 one) */
 typedef struct tagDIALOGINFO
 {
diff --git a/dlls/user.exe16/window.c b/dlls/user.exe16/window.c
index 590b8ae9f7c..e54dd6a803e 100644
--- a/dlls/user.exe16/window.c
+++ b/dlls/user.exe16/window.c
@@ -111,7 +111,7 @@ UINT16 WINAPI SetTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, TIMERPROC16 pr
 UINT16 WINAPI SetSystemTimer16( HWND16 hwnd, UINT16 id, UINT16 timeout, TIMERPROC16 proc )
 {
     TIMERPROC proc32 = (TIMERPROC)WINPROC_AllocProc16( (WNDPROC16)proc );
-    return SetSystemTimer( WIN_Handle32(hwnd), id, timeout, proc32 );
+    return SetTimer( WIN_Handle32(hwnd), (UINT_PTR)id | SYSTEM_TIMER_FLAG, timeout, proc32 );
 }
 
 
@@ -1087,7 +1087,7 @@ void WINAPI SwitchToThisWindow16( HWND16 hwnd, BOOL16 restore )
  */
 BOOL16 WINAPI KillSystemTimer16( HWND16 hwnd, UINT16 id )
 {
-    return KillSystemTimer( WIN_Handle32(hwnd), id );
+    return KillTimer( WIN_Handle32(hwnd), (UINT_PTR)id | SYSTEM_TIMER_FLAG );
 }
 
 




More information about the wine-cvs mailing list