win32u: Remove the "proc" parameter to NtUserSetSystemTimer().

Testing on 32-bit Windows 10 suggests that the function only has three
parameters. The test fixed in this patch (which still succeeds on e.g. Windows
2003) suggests that the final parameter to SetSystemTimer() is not a callback,
either.

Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Jacek Caban <jacek@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2022-04-20 19:15:31 -05:00 committed by Alexandre Julliard
parent 079b0423b5
commit 5e4dedff8e
13 changed files with 29 additions and 22 deletions

View File

@ -2404,7 +2404,7 @@ static void LISTBOX_HandleMouseMove( LB_DESCR *descr,
/* Start/stop the system timer */
if (dir != LB_TIMER_NONE)
SetSystemTimer( descr->self, LB_TIMER_ID, LB_SCROLL_TIMEOUT, NULL);
SetSystemTimer( descr->self, LB_TIMER_ID, LB_SCROLL_TIMEOUT, 0 );
else if (LISTBOX_Timer != LB_TIMER_NONE)
KillSystemTimer( descr->self, LB_TIMER_ID );
LISTBOX_Timer = dir;

View File

@ -270,7 +270,7 @@ BOOL WINAPI SetCaretPos( INT x, INT y )
r.left = x;
r.top = y;
CARET_DisplayCaret( hwnd, &r );
NtUserSetSystemTimer( hwnd, SYSTEM_TIMER_CARET, Caret.timeout, NULL );
NtUserSetSystemTimer( hwnd, SYSTEM_TIMER_CARET, Caret.timeout );
}
return ret;
}
@ -348,7 +348,7 @@ BOOL WINAPI ShowCaret( HWND hwnd )
if (ret && (hidden == 1)) /* hidden was 1 so it's now 0 */
{
CARET_DisplayCaret( hwnd, &r );
NtUserSetSystemTimer( hwnd, SYSTEM_TIMER_CARET, Caret.timeout, NULL );
NtUserSetSystemTimer( hwnd, SYSTEM_TIMER_CARET, Caret.timeout );
}
return ret;
}

View File

@ -742,7 +742,7 @@ TrackMouseEvent (TRACKMOUSEEVENT *ptme)
/* Initialize HoverInfo variables even if not hover tracking */
tracking_info.pos = pos;
NtUserSetSystemTimer( tracking_info.tme.hwndTrack, SYSTEM_TIMER_TRACK_MOUSE, hover_time, NULL );
NtUserSetSystemTimer( tracking_info.tme.hwndTrack, SYSTEM_TIMER_TRACK_MOUSE, hover_time );
}
}

View File

@ -2413,7 +2413,7 @@ static void LISTBOX_HandleMouseMove( LB_DESCR *descr,
/* Start/stop the system timer */
if (dir != LB_TIMER_NONE)
NtUserSetSystemTimer( descr->self, LB_TIMER_ID, LB_SCROLL_TIMEOUT, NULL);
NtUserSetSystemTimer( descr->self, LB_TIMER_ID, LB_SCROLL_TIMEOUT );
else if (LISTBOX_Timer != LB_TIMER_NONE)
KillSystemTimer( descr->self, LB_TIMER_ID );
LISTBOX_Timer = dir;

View File

@ -1269,6 +1269,17 @@ UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
}
/******************************************************************
* SetSystemTimer (USER32.@)
*/
UINT_PTR WINAPI SetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, void *unknown )
{
if (unknown) FIXME( "ignoring unknown parameter %p\n", unknown );
return NtUserSetSystemTimer( hwnd, id, timeout );
}
/***********************************************************************
* KillSystemTimer (USER32.@)
*/

View File

@ -950,7 +950,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
}
NtUserSetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL );
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY );
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
break;
@ -965,7 +965,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
SB_PAGEUP, (LPARAM)hwndCtl );
}
NtUserSetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL );
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY );
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
break;
@ -1023,7 +1023,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
SB_PAGEDOWN, (LPARAM)hwndCtl );
}
NtUserSetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL );
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY );
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
break;
@ -1039,7 +1039,7 @@ void SCROLL_HandleScrollEvent( HWND hwnd, INT nBar, UINT msg, POINT pt )
}
NtUserSetSystemTimer( hwnd, SCROLL_TIMER, (msg == WM_LBUTTONDOWN) ?
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY, NULL );
SCROLL_FIRST_DELAY : SCROLL_REPEAT_DELAY );
}
else KillSystemTimer( hwnd, SCROLL_TIMER );
break;

View File

@ -10735,8 +10735,7 @@ static void test_timers(void)
|| broken(syscount > 4000 && syscount < 12000) /* win2k3sp0 */,
"did not get expected count for minimum timeout (%d != ~%d).\n",
syscount, TIMER_COUNT_EXPECTED);
todo_wine ok(count == 0, "did not get expected count for callback timeout (%d != 0).\n",
count);
ok(count == 0, "did not get expected count for callback timeout (%d != 0).\n", count);
ok(pKillSystemTimer(info.hWnd, id), "KillSystemTimer failed\n");
}

View File

@ -708,7 +708,7 @@
@ stdcall SetSysColorsTemp(ptr ptr long)
@ stdcall SetSystemCursor(long long)
@ stdcall SetSystemMenu(long long)
@ stdcall SetSystemTimer(long long long ptr) NtUserSetSystemTimer
@ stdcall SetSystemTimer(long long long ptr)
@ stdcall SetTaskmanWindow (long)
@ stdcall SetThreadDesktop(long) NtUserSetThreadDesktop
@ stdcall SetThreadDpiAwarenessContext(ptr)

View File

@ -2651,12 +2651,11 @@ UINT_PTR WINAPI NtUserSetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC
/***********************************************************************
* NtUserSetSystemTimer (win32u.@)
*/
UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout )
{
UINT_PTR ret;
WNDPROC winproc = 0;
if (proc) winproc = alloc_winproc( (WNDPROC)proc, TRUE );
TRACE( "window %p, id %#lx, timeout %u\n", hwnd, id, timeout );
timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM );
@ -2666,7 +2665,7 @@ UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIME
req->msg = WM_SYSTIMER;
req->id = id;
req->rate = timeout;
req->lparam = (ULONG_PTR)winproc;
req->lparam = 0;
if (!wine_server_call_err( req ))
{
ret = reply->id;
@ -2676,7 +2675,6 @@ UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIME
}
SERVER_END_REQ;
TRACE( "Added %p %lx %p timeout %d\n", hwnd, id, winproc, timeout );
return ret;
}

View File

@ -1230,7 +1230,7 @@
@ stdcall NtUserSetSysColors(long ptr ptr)
@ stub NtUserSetSystemCursor
@ stub NtUserSetSystemMenu
@ stdcall -syscall NtUserSetSystemTimer(long long long ptr)
@ stdcall -syscall NtUserSetSystemTimer(long long long)
@ stub NtUserSetTargetForResourceBrokering
@ stdcall -syscall NtUserSetThreadDesktop(long)
@ stub NtUserSetThreadInputBlocked

View File

@ -585,9 +585,8 @@ NTSTATUS WINAPI wow64_NtUserSetSystemTimer( UINT *args )
HWND hwnd = get_handle( &args );
UINT_PTR id = get_ulong( &args );
UINT timeout = get_ulong( &args );
TIMERPROC proc = get_ptr( &args );
return NtUserSetSystemTimer( hwnd, id, timeout, proc );
return NtUserSetSystemTimer( hwnd, id, timeout );
}
NTSTATUS WINAPI wow64_NtUserSetTimer( UINT *args )

View File

@ -562,7 +562,7 @@ BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle );
BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values );
BOOL WINAPI NtUserSetSystemMenu( HWND hwnd, HMENU menu );
UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc );
UINT_PTR WINAPI NtUserSetSystemTimer( HWND hwnd, UINT_PTR id, UINT timeout );
BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );
UINT_PTR WINAPI NtUserSetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc, ULONG tolerance );
LONG WINAPI NtUserSetWindowLong( HWND hwnd, INT offset, LONG newval, BOOL ansi );

View File

@ -4217,7 +4217,7 @@ WINUSERAPI BOOL WINAPI SetScrollRange(HWND,INT,INT,INT,BOOL);
#define SetSysModalWindow(hwnd) ((HWND)0)
WINUSERAPI BOOL WINAPI SetSystemCursor(HCURSOR,DWORD);
WINUSERAPI BOOL WINAPI SetSystemMenu(HWND,HMENU);
WINUSERAPI UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,TIMERPROC);
WINUSERAPI UINT_PTR WINAPI SetSystemTimer(HWND,UINT_PTR,UINT,void*);
WINUSERAPI BOOL WINAPI SetThreadDesktop(HDESK);
WINUSERAPI DPI_AWARENESS_CONTEXT WINAPI SetThreadDpiAwarenessContext(DPI_AWARENESS_CONTEXT);
WINUSERAPI UINT_PTR WINAPI SetTimer(HWND,UINT_PTR,UINT,TIMERPROC);