diff --git a/reactos/include/win32k/ntuser.h b/reactos/include/win32k/ntuser.h index 7d68454f0a7..06f48b9b983 100644 --- a/reactos/include/win32k/ntuser.h +++ b/reactos/include/win32k/ntuser.h @@ -899,11 +899,11 @@ STDCALL NtUserIsClipboardFormatAvailable( DWORD Unknown0); -DWORD +NTSTATUS STDCALL NtUserKillTimer( - DWORD Unknown0, - DWORD Unknown1); + HWND hWnd, + UINT_PTR IDEvent); DWORD STDCALL @@ -1415,13 +1415,13 @@ NtUserSetThreadState( DWORD Unknown0, DWORD Unknown1); -DWORD +NTSTATUS STDCALL NtUserSetTimer( - DWORD Unknown0, - DWORD Unknown1, - DWORD Unknown2, - DWORD Unknown3); + HWND hWnd, + UINT_PTR * IDEvent, + UINT Period, + TIMERPROC TimerFunc); DWORD STDCALL diff --git a/reactos/lib/user32/misc/timer.c b/reactos/lib/user32/misc/timer.c index dd9dea26fdb..30d7aec4efe 100644 --- a/reactos/lib/user32/misc/timer.c +++ b/reactos/lib/user32/misc/timer.c @@ -16,7 +16,7 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -/* $Id: timer.c,v 1.4 2002/09/08 10:23:10 chorns Exp $ +/* $Id: timer.c,v 1.5 2003/04/02 23:29:04 gdalsnes Exp $ * * PROJECT: ReactOS user32.dll * FILE: lib/user32/misc/dde.c @@ -29,6 +29,7 @@ /* INCLUDES ******************************************************************/ #include +#include #include #include @@ -38,18 +39,44 @@ WINBOOL STDCALL KillTimer( HWND hWnd, - UINT_PTR uIDEvent) + UINT_PTR IDEvent) { - return FALSE; + + NTSTATUS Status; + + Status = NtUserKillTimer(hWnd, IDEvent); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + return TRUE; + } + UINT_PTR STDCALL SetTimer( HWND hWnd, - UINT_PTR nIDEvent, - UINT uElapse, - TIMERPROC lpTimerFunc) + UINT_PTR IDEvent, + UINT Period, + TIMERPROC TimerFunc) { - return (UINT_PTR)0; + NTSTATUS Status; + + Status = NtUserSetTimer(hWnd, &IDEvent, Period, TimerFunc); + + if (!NT_SUCCESS(Status)) + { + SetLastErrorByStatus(Status); + return FALSE; + } + + if (hWnd == NULL) + return IDEvent; + + return TRUE; }