Commit d33d05ce authored by Alexandre Julliard's avatar Alexandre Julliard

kernel32: Move timer queue functions to kernelbase.

parent 8c63d02d
......@@ -213,7 +213,7 @@
# @ stub CancelThreadpoolIo
@ stdcall CancelTimerQueueTimer(ptr ptr)
@ stdcall -import CancelWaitableTimer(long)
@ stdcall ChangeTimerQueueTimer(ptr ptr long long)
@ stdcall -import ChangeTimerQueueTimer(ptr ptr long long)
# @ stub CheckElevation
# @ stub CheckElevationEnabled
# @ stub CheckForReadOnlyResource
......@@ -335,8 +335,8 @@
@ stdcall CreateThreadpoolTimer(ptr ptr ptr)
@ stdcall CreateThreadpoolWait(ptr ptr ptr)
@ stdcall CreateThreadpoolWork(ptr ptr ptr)
@ stdcall CreateTimerQueue ()
@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long)
@ stdcall -import CreateTimerQueue()
@ stdcall -import CreateTimerQueueTimer(ptr long ptr ptr long long long)
@ stdcall CreateToolhelp32Snapshot(long long)
@ stdcall -arch=x86_64 CreateUmsCompletionList(ptr)
@ stdcall -arch=x86_64 CreateUmsThreadContext(ptr)
......@@ -369,8 +369,8 @@
# @ stub DisableThreadProfiling
@ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback
@ stdcall DeleteTimerQueue(long)
@ stdcall DeleteTimerQueueEx (long long)
@ stdcall DeleteTimerQueueTimer(long long long)
@ stdcall -import DeleteTimerQueueEx(long long)
@ stdcall -import DeleteTimerQueueTimer(long long long)
@ stdcall -arch=x86_64 DeleteUmsCompletionList(ptr)
@ stdcall -arch=x86_64 DeleteUmsThreadContext(ptr)
@ stdcall DeleteVolumeMountPointA(str)
......
......@@ -682,40 +682,6 @@ HANDLE WINAPI OpenWaitableTimerA( DWORD access, BOOL inherit, LPCSTR name )
/***********************************************************************
* CreateTimerQueue (KERNEL32.@)
*/
HANDLE WINAPI CreateTimerQueue(void)
{
HANDLE q;
NTSTATUS status = RtlCreateTimerQueue(&q);
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return NULL;
}
return q;
}
/***********************************************************************
* DeleteTimerQueueEx (KERNEL32.@)
*/
BOOL WINAPI DeleteTimerQueueEx(HANDLE TimerQueue, HANDLE CompletionEvent)
{
NTSTATUS status = RtlDeleteTimerQueueEx(TimerQueue, CompletionEvent);
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
return TRUE;
}
/***********************************************************************
* DeleteTimerQueue (KERNEL32.@)
*/
BOOL WINAPI DeleteTimerQueue(HANDLE TimerQueue)
......@@ -724,81 +690,13 @@ BOOL WINAPI DeleteTimerQueue(HANDLE TimerQueue)
}
/***********************************************************************
* CreateTimerQueueTimer (KERNEL32.@)
*
* Creates a timer-queue timer. This timer expires at the specified due
* time (in ms), then after every specified period (in ms). When the timer
* expires, the callback function is called.
*
* RETURNS
* nonzero on success or zero on failure
*/
BOOL WINAPI CreateTimerQueueTimer( PHANDLE phNewTimer, HANDLE TimerQueue,
WAITORTIMERCALLBACK Callback, PVOID Parameter,
DWORD DueTime, DWORD Period, ULONG Flags )
{
NTSTATUS status = RtlCreateTimer(phNewTimer, TimerQueue, Callback,
Parameter, DueTime, Period, Flags);
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
return TRUE;
}
/***********************************************************************
* ChangeTimerQueueTimer (KERNEL32.@)
*
* Changes the times at which the timer expires.
*
* RETURNS
* nonzero on success or zero on failure
*/
BOOL WINAPI ChangeTimerQueueTimer( HANDLE TimerQueue, HANDLE Timer,
ULONG DueTime, ULONG Period )
{
NTSTATUS status = RtlUpdateTimer(TimerQueue, Timer, DueTime, Period);
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
return TRUE;
}
/***********************************************************************
* CancelTimerQueueTimer (KERNEL32.@)
*/
BOOL WINAPI CancelTimerQueueTimer(HANDLE queue, HANDLE timer)
{
FIXME("stub: %p %p\n", queue, timer);
return FALSE;
return DeleteTimerQueueTimer( queue, timer, NULL );
}
/***********************************************************************
* DeleteTimerQueueTimer (KERNEL32.@)
*
* Cancels a timer-queue timer.
*
* RETURNS
* nonzero on success or zero on failure
*/
BOOL WINAPI DeleteTimerQueueTimer( HANDLE TimerQueue, HANDLE Timer,
HANDLE CompletionEvent )
{
NTSTATUS status = RtlDeleteTimer(TimerQueue, Timer, CompletionEvent);
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError(status) );
return FALSE;
}
return TRUE;
}
/*
......
......@@ -108,7 +108,7 @@
@ stub CancelThreadpoolIo
@ stdcall CancelWaitableTimer(long)
# @ stub CeipIsOptedIn
@ stdcall ChangeTimerQueueTimer(ptr ptr long long) kernel32.ChangeTimerQueueTimer
@ stdcall ChangeTimerQueueTimer(ptr ptr long long)
@ stdcall CharLowerA(str)
@ stdcall CharLowerBuffA(str long)
@ stdcall CharLowerBuffW(wstr long)
......@@ -229,8 +229,8 @@
@ stdcall CreateThreadpoolTimer(ptr ptr ptr) kernel32.CreateThreadpoolTimer
@ stdcall CreateThreadpoolWait(ptr ptr ptr) kernel32.CreateThreadpoolWait
@ stdcall CreateThreadpoolWork(ptr ptr ptr) kernel32.CreateThreadpoolWork
@ stdcall CreateTimerQueue() kernel32.CreateTimerQueue
@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) kernel32.CreateTimerQueueTimer
@ stdcall CreateTimerQueue()
@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long)
@ stdcall CreateWaitableTimerExW(ptr wstr long long)
@ stdcall CreateWaitableTimerW(ptr long wstr)
@ stdcall CreateWellKnownSid(long ptr ptr ptr)
......@@ -257,8 +257,8 @@
# @ stub DeleteStateContainer
# @ stub DeleteStateContainerValue
# @ stub DeleteSynchronizationBarrier
@ stdcall DeleteTimerQueueEx(long long) kernel32.DeleteTimerQueueEx
@ stdcall DeleteTimerQueueTimer(long long long) kernel32.DeleteTimerQueueTimer
@ stdcall DeleteTimerQueueEx(long long)
@ stdcall DeleteTimerQueueTimer(long long long)
@ stdcall DeleteVolumeMountPointW(wstr) kernel32.DeleteVolumeMountPointW
@ stdcall DestroyPrivateObjectSecurity(ptr)
@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) kernel32.DeviceIoControl
......
......@@ -531,3 +531,64 @@ BOOL WINAPI DECLSPEC_HOTPATCH CancelWaitableTimer( HANDLE handle )
{
return set_ntstatus( NtCancelTimer( handle, NULL ));
}
/***********************************************************************
* Timer queues
***********************************************************************/
/***********************************************************************
* CreateTimerQueue (kernelbase.@)
*/
HANDLE WINAPI DECLSPEC_HOTPATCH CreateTimerQueue(void)
{
HANDLE q;
NTSTATUS status = RtlCreateTimerQueue( &q );
if (status != STATUS_SUCCESS)
{
SetLastError( RtlNtStatusToDosError( status ));
return NULL;
}
return q;
}
/***********************************************************************
* CreateTimerQueueTimer (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH CreateTimerQueueTimer( PHANDLE timer, HANDLE queue,
WAITORTIMERCALLBACK callback, PVOID arg,
DWORD when, DWORD period, ULONG flags )
{
return set_ntstatus( RtlCreateTimer( timer, queue, callback, arg, when, period, flags ));
}
/***********************************************************************
* ChangeTimerQueueTimer (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH ChangeTimerQueueTimer( HANDLE queue, HANDLE timer,
ULONG when, ULONG period )
{
return set_ntstatus( RtlUpdateTimer( queue, timer, when, period ));
}
/***********************************************************************
* DeleteTimerQueueEx (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH DeleteTimerQueueEx( HANDLE queue, HANDLE event )
{
return set_ntstatus( RtlDeleteTimerQueueEx( queue, event ));
}
/***********************************************************************
* DeleteTimerQueueTimer (kernelbase.@)
*/
BOOL WINAPI DECLSPEC_HOTPATCH DeleteTimerQueueTimer( HANDLE queue, HANDLE timer, HANDLE event )
{
return set_ntstatus( RtlDeleteTimer( queue, timer, event ));
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment