kernel32: Move timer queue functions to kernelbase.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
8c63d02d5f
commit
d33d05ce27
|
@ -213,7 +213,7 @@
|
||||||
# @ stub CancelThreadpoolIo
|
# @ stub CancelThreadpoolIo
|
||||||
@ stdcall CancelTimerQueueTimer(ptr ptr)
|
@ stdcall CancelTimerQueueTimer(ptr ptr)
|
||||||
@ stdcall -import CancelWaitableTimer(long)
|
@ stdcall -import CancelWaitableTimer(long)
|
||||||
@ stdcall ChangeTimerQueueTimer(ptr ptr long long)
|
@ stdcall -import ChangeTimerQueueTimer(ptr ptr long long)
|
||||||
# @ stub CheckElevation
|
# @ stub CheckElevation
|
||||||
# @ stub CheckElevationEnabled
|
# @ stub CheckElevationEnabled
|
||||||
# @ stub CheckForReadOnlyResource
|
# @ stub CheckForReadOnlyResource
|
||||||
|
@ -335,8 +335,8 @@
|
||||||
@ stdcall CreateThreadpoolTimer(ptr ptr ptr)
|
@ stdcall CreateThreadpoolTimer(ptr ptr ptr)
|
||||||
@ stdcall CreateThreadpoolWait(ptr ptr ptr)
|
@ stdcall CreateThreadpoolWait(ptr ptr ptr)
|
||||||
@ stdcall CreateThreadpoolWork(ptr ptr ptr)
|
@ stdcall CreateThreadpoolWork(ptr ptr ptr)
|
||||||
@ stdcall CreateTimerQueue ()
|
@ stdcall -import CreateTimerQueue()
|
||||||
@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long)
|
@ stdcall -import CreateTimerQueueTimer(ptr long ptr ptr long long long)
|
||||||
@ stdcall CreateToolhelp32Snapshot(long long)
|
@ stdcall CreateToolhelp32Snapshot(long long)
|
||||||
@ stdcall -arch=x86_64 CreateUmsCompletionList(ptr)
|
@ stdcall -arch=x86_64 CreateUmsCompletionList(ptr)
|
||||||
@ stdcall -arch=x86_64 CreateUmsThreadContext(ptr)
|
@ stdcall -arch=x86_64 CreateUmsThreadContext(ptr)
|
||||||
|
@ -369,8 +369,8 @@
|
||||||
# @ stub DisableThreadProfiling
|
# @ stub DisableThreadProfiling
|
||||||
@ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback
|
@ stdcall DisassociateCurrentThreadFromCallback(ptr) ntdll.TpDisassociateCallback
|
||||||
@ stdcall DeleteTimerQueue(long)
|
@ stdcall DeleteTimerQueue(long)
|
||||||
@ stdcall DeleteTimerQueueEx (long long)
|
@ stdcall -import DeleteTimerQueueEx(long long)
|
||||||
@ stdcall DeleteTimerQueueTimer(long long long)
|
@ stdcall -import DeleteTimerQueueTimer(long long long)
|
||||||
@ stdcall -arch=x86_64 DeleteUmsCompletionList(ptr)
|
@ stdcall -arch=x86_64 DeleteUmsCompletionList(ptr)
|
||||||
@ stdcall -arch=x86_64 DeleteUmsThreadContext(ptr)
|
@ stdcall -arch=x86_64 DeleteUmsThreadContext(ptr)
|
||||||
@ stdcall DeleteVolumeMountPointA(str)
|
@ stdcall DeleteVolumeMountPointA(str)
|
||||||
|
|
|
@ -681,40 +681,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.@)
|
* DeleteTimerQueue (KERNEL32.@)
|
||||||
*/
|
*/
|
||||||
|
@ -723,82 +689,14 @@ BOOL WINAPI DeleteTimerQueue(HANDLE TimerQueue)
|
||||||
return DeleteTimerQueueEx(TimerQueue, NULL);
|
return DeleteTimerQueueEx(TimerQueue, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* 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.@)
|
* CancelTimerQueueTimer (KERNEL32.@)
|
||||||
*/
|
*/
|
||||||
BOOL WINAPI CancelTimerQueueTimer(HANDLE queue, HANDLE timer)
|
BOOL WINAPI CancelTimerQueueTimer(HANDLE queue, HANDLE timer)
|
||||||
{
|
{
|
||||||
FIXME("stub: %p %p\n", queue, timer);
|
return DeleteTimerQueueTimer( queue, timer, NULL );
|
||||||
return FALSE;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/***********************************************************************
|
|
||||||
* 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
|
@ stub CancelThreadpoolIo
|
||||||
@ stdcall CancelWaitableTimer(long)
|
@ stdcall CancelWaitableTimer(long)
|
||||||
# @ stub CeipIsOptedIn
|
# @ stub CeipIsOptedIn
|
||||||
@ stdcall ChangeTimerQueueTimer(ptr ptr long long) kernel32.ChangeTimerQueueTimer
|
@ stdcall ChangeTimerQueueTimer(ptr ptr long long)
|
||||||
@ stdcall CharLowerA(str)
|
@ stdcall CharLowerA(str)
|
||||||
@ stdcall CharLowerBuffA(str long)
|
@ stdcall CharLowerBuffA(str long)
|
||||||
@ stdcall CharLowerBuffW(wstr long)
|
@ stdcall CharLowerBuffW(wstr long)
|
||||||
|
@ -229,8 +229,8 @@
|
||||||
@ stdcall CreateThreadpoolTimer(ptr ptr ptr) kernel32.CreateThreadpoolTimer
|
@ stdcall CreateThreadpoolTimer(ptr ptr ptr) kernel32.CreateThreadpoolTimer
|
||||||
@ stdcall CreateThreadpoolWait(ptr ptr ptr) kernel32.CreateThreadpoolWait
|
@ stdcall CreateThreadpoolWait(ptr ptr ptr) kernel32.CreateThreadpoolWait
|
||||||
@ stdcall CreateThreadpoolWork(ptr ptr ptr) kernel32.CreateThreadpoolWork
|
@ stdcall CreateThreadpoolWork(ptr ptr ptr) kernel32.CreateThreadpoolWork
|
||||||
@ stdcall CreateTimerQueue() kernel32.CreateTimerQueue
|
@ stdcall CreateTimerQueue()
|
||||||
@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long) kernel32.CreateTimerQueueTimer
|
@ stdcall CreateTimerQueueTimer(ptr long ptr ptr long long long)
|
||||||
@ stdcall CreateWaitableTimerExW(ptr wstr long long)
|
@ stdcall CreateWaitableTimerExW(ptr wstr long long)
|
||||||
@ stdcall CreateWaitableTimerW(ptr long wstr)
|
@ stdcall CreateWaitableTimerW(ptr long wstr)
|
||||||
@ stdcall CreateWellKnownSid(long ptr ptr ptr)
|
@ stdcall CreateWellKnownSid(long ptr ptr ptr)
|
||||||
|
@ -257,8 +257,8 @@
|
||||||
# @ stub DeleteStateContainer
|
# @ stub DeleteStateContainer
|
||||||
# @ stub DeleteStateContainerValue
|
# @ stub DeleteStateContainerValue
|
||||||
# @ stub DeleteSynchronizationBarrier
|
# @ stub DeleteSynchronizationBarrier
|
||||||
@ stdcall DeleteTimerQueueEx(long long) kernel32.DeleteTimerQueueEx
|
@ stdcall DeleteTimerQueueEx(long long)
|
||||||
@ stdcall DeleteTimerQueueTimer(long long long) kernel32.DeleteTimerQueueTimer
|
@ stdcall DeleteTimerQueueTimer(long long long)
|
||||||
@ stdcall DeleteVolumeMountPointW(wstr) kernel32.DeleteVolumeMountPointW
|
@ stdcall DeleteVolumeMountPointW(wstr) kernel32.DeleteVolumeMountPointW
|
||||||
@ stdcall DestroyPrivateObjectSecurity(ptr)
|
@ stdcall DestroyPrivateObjectSecurity(ptr)
|
||||||
@ stdcall DeviceIoControl(long long ptr long ptr long ptr ptr) kernel32.DeviceIoControl
|
@ 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 ));
|
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 ));
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue