win32u: Move NtUserSetTimer implementation from user32.
Signed-off-by: Jacek Caban <jacek@codeweavers.com> Signed-off-by: Huw Davies <huw@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
ea764fbd3e
commit
ac8e0ce255
|
@ -4408,45 +4408,12 @@ BOOL WINAPI MessageBeep( UINT i )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* SetCoalescableTimer (USER32.@)
|
|
||||||
*/
|
|
||||||
UINT_PTR WINAPI SetCoalescableTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc, ULONG tolerance )
|
|
||||||
{
|
|
||||||
UINT_PTR ret;
|
|
||||||
WNDPROC winproc = 0;
|
|
||||||
|
|
||||||
if (proc) winproc = WINPROC_AllocProc( (WNDPROC)proc, FALSE );
|
|
||||||
|
|
||||||
timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM );
|
|
||||||
|
|
||||||
SERVER_START_REQ( set_win_timer )
|
|
||||||
{
|
|
||||||
req->win = wine_server_user_handle( hwnd );
|
|
||||||
req->msg = WM_TIMER;
|
|
||||||
req->id = id;
|
|
||||||
req->rate = timeout;
|
|
||||||
req->lparam = (ULONG_PTR)winproc;
|
|
||||||
if (!wine_server_call_err( req ))
|
|
||||||
{
|
|
||||||
ret = reply->id;
|
|
||||||
if (!ret) ret = TRUE;
|
|
||||||
}
|
|
||||||
else ret = 0;
|
|
||||||
}
|
|
||||||
SERVER_END_REQ;
|
|
||||||
|
|
||||||
TRACE("Added %p %lx %p timeout %d\n", hwnd, id, winproc, timeout );
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/******************************************************************
|
/******************************************************************
|
||||||
* SetTimer (USER32.@)
|
* SetTimer (USER32.@)
|
||||||
*/
|
*/
|
||||||
UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
|
UINT_PTR WINAPI SetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc )
|
||||||
{
|
{
|
||||||
return SetCoalescableTimer( hwnd, id, timeout, proc, TIMERV_DEFAULT_COALESCING );
|
return NtUserSetTimer( hwnd, id, timeout, proc, TIMERV_DEFAULT_COALESCING );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -655,7 +655,7 @@
|
||||||
@ stdcall SetClassWord(long long long) NtUserSetClassWord
|
@ stdcall SetClassWord(long long long) NtUserSetClassWord
|
||||||
@ stdcall SetClipboardData(long long)
|
@ stdcall SetClipboardData(long long)
|
||||||
@ stdcall SetClipboardViewer(long)
|
@ stdcall SetClipboardViewer(long)
|
||||||
@ stdcall SetCoalescableTimer(long long long ptr long)
|
@ stdcall SetCoalescableTimer(long long long ptr long) NtUserSetTimer
|
||||||
# @ stub SetConsoleReserveKeys
|
# @ stub SetConsoleReserveKeys
|
||||||
@ stdcall -import SetCursor(long) NtUserSetCursor
|
@ stdcall -import SetCursor(long) NtUserSetCursor
|
||||||
@ stub SetCursorContents
|
@ stub SetCursorContents
|
||||||
|
|
|
@ -128,6 +128,38 @@ BOOL WINAPI NtUserGetGUIThreadInfo( DWORD id, GUITHREADINFO *info )
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/***********************************************************************
|
||||||
|
* NtUserSetTimer (win32u.@)
|
||||||
|
*/
|
||||||
|
UINT_PTR WINAPI NtUserSetTimer( HWND hwnd, UINT_PTR id, UINT timeout, TIMERPROC proc, ULONG tolerance )
|
||||||
|
{
|
||||||
|
UINT_PTR ret;
|
||||||
|
WNDPROC winproc = 0;
|
||||||
|
|
||||||
|
if (proc) winproc = alloc_winproc( (WNDPROC)proc, TRUE );
|
||||||
|
|
||||||
|
timeout = min( max( USER_TIMER_MINIMUM, timeout ), USER_TIMER_MAXIMUM );
|
||||||
|
|
||||||
|
SERVER_START_REQ( set_win_timer )
|
||||||
|
{
|
||||||
|
req->win = wine_server_user_handle( hwnd );
|
||||||
|
req->msg = WM_TIMER;
|
||||||
|
req->id = id;
|
||||||
|
req->rate = timeout;
|
||||||
|
req->lparam = (ULONG_PTR)winproc;
|
||||||
|
if (!wine_server_call_err( req ))
|
||||||
|
{
|
||||||
|
ret = reply->id;
|
||||||
|
if (!ret) ret = TRUE;
|
||||||
|
}
|
||||||
|
else ret = 0;
|
||||||
|
}
|
||||||
|
SERVER_END_REQ;
|
||||||
|
|
||||||
|
TRACE( "Added %p %lx %p timeout %d\n", hwnd, id, winproc, timeout );
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
/* see SendMessageW */
|
/* see SendMessageW */
|
||||||
LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
|
LRESULT send_message( HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam )
|
||||||
{
|
{
|
||||||
|
|
|
@ -154,6 +154,7 @@ static void * const syscalls[] =
|
||||||
NtUserSetProcessWindowStation,
|
NtUserSetProcessWindowStation,
|
||||||
NtUserSetProp,
|
NtUserSetProp,
|
||||||
NtUserSetThreadDesktop,
|
NtUserSetThreadDesktop,
|
||||||
|
NtUserSetTimer,
|
||||||
NtUserSetWinEventHook,
|
NtUserSetWinEventHook,
|
||||||
NtUserSetWindowsHookEx,
|
NtUserSetWindowsHookEx,
|
||||||
NtUserUnhookWinEvent,
|
NtUserUnhookWinEvent,
|
||||||
|
|
|
@ -1236,7 +1236,7 @@
|
||||||
@ stub NtUserSetThreadInputBlocked
|
@ stub NtUserSetThreadInputBlocked
|
||||||
@ stub NtUserSetThreadLayoutHandles
|
@ stub NtUserSetThreadLayoutHandles
|
||||||
@ stub NtUserSetThreadState
|
@ stub NtUserSetThreadState
|
||||||
@ stub NtUserSetTimer
|
@ stdcall -syscall NtUserSetTimer(long long long ptr long)
|
||||||
@ stdcall -syscall NtUserSetWinEventHook(long long long ptr ptr long long long)
|
@ stdcall -syscall NtUserSetWinEventHook(long long long ptr ptr long long long)
|
||||||
@ stub NtUserSetWindowArrangement
|
@ stub NtUserSetWindowArrangement
|
||||||
@ stub NtUserSetWindowBand
|
@ stub NtUserSetWindowBand
|
||||||
|
|
|
@ -139,6 +139,7 @@
|
||||||
SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \
|
SYSCALL_ENTRY( NtUserSetProcessWindowStation ) \
|
||||||
SYSCALL_ENTRY( NtUserSetProp ) \
|
SYSCALL_ENTRY( NtUserSetProp ) \
|
||||||
SYSCALL_ENTRY( NtUserSetThreadDesktop ) \
|
SYSCALL_ENTRY( NtUserSetThreadDesktop ) \
|
||||||
|
SYSCALL_ENTRY( NtUserSetTimer ) \
|
||||||
SYSCALL_ENTRY( NtUserSetWinEventHook ) \
|
SYSCALL_ENTRY( NtUserSetWinEventHook ) \
|
||||||
SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \
|
SYSCALL_ENTRY( NtUserSetWindowsHookEx ) \
|
||||||
SYSCALL_ENTRY( NtUserUnhookWinEvent ) \
|
SYSCALL_ENTRY( NtUserUnhookWinEvent ) \
|
||||||
|
|
|
@ -533,6 +533,17 @@ NTSTATUS WINAPI wow64_NtUserGetGUIThreadInfo( UINT *args )
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
NTSTATUS WINAPI wow64_NtUserSetTimer( UINT *args )
|
||||||
|
{
|
||||||
|
HWND hwnd = get_handle( &args );
|
||||||
|
UINT_PTR id = get_ulong( &args );
|
||||||
|
UINT timeout = get_ulong( &args );
|
||||||
|
TIMERPROC proc = get_ptr( &args );
|
||||||
|
ULONG tolerance = get_ulong( &args );
|
||||||
|
|
||||||
|
return NtUserSetTimer( hwnd, id, timeout, proc, tolerance );
|
||||||
|
}
|
||||||
|
|
||||||
NTSTATUS WINAPI wow64_NtUserCopyAcceleratorTable( UINT *args )
|
NTSTATUS WINAPI wow64_NtUserCopyAcceleratorTable( UINT *args )
|
||||||
{
|
{
|
||||||
HACCEL src = get_handle( &args );
|
HACCEL src = get_handle( &args );
|
||||||
|
|
|
@ -403,6 +403,7 @@ BOOL WINAPI NtUserSetProcessWindowStation( HWINSTA handle );
|
||||||
BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle );
|
BOOL WINAPI NtUserSetProp( HWND hwnd, const WCHAR *str, HANDLE handle );
|
||||||
BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values );
|
BOOL WINAPI NtUserSetSysColors( INT count, const INT *colors, const COLORREF *values );
|
||||||
BOOL WINAPI NtUserSetThreadDesktop( HDESK handle );
|
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 );
|
LONG WINAPI NtUserSetWindowLong( HWND hwnd, INT offset, LONG newval, BOOL ansi );
|
||||||
LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
|
LONG_PTR WINAPI NtUserSetWindowLongPtr( HWND hwnd, INT offset, LONG_PTR newval, BOOL ansi );
|
||||||
BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags );
|
BOOL WINAPI NtUserSetWindowPos( HWND hwnd, HWND after, INT x, INT y, INT cx, INT cy, UINT flags );
|
||||||
|
|
Loading…
Reference in New Issue