Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Johnny Cai
wine
Commits
9bf3ac61
Commit
9bf3ac61
authored
21 years ago
by
Alexandre Julliard
Browse files
Options
Downloads
Patches
Plain Diff
Moved timer functions to dlls/kernel.
parent
fd9cbb6c
No related branches found
Branches containing commit
Tags
wine-0.9.54
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
dlls/kernel/sync.c
+191
-0
191 additions, 0 deletions
dlls/kernel/sync.c
dlls/ntdll/Makefile.in
+0
-1
0 additions, 1 deletion
dlls/ntdll/Makefile.in
scheduler/timer.c
+0
-223
0 additions, 223 deletions
scheduler/timer.c
with
191 additions
and
224 deletions
dlls/kernel/sync.c
+
191
−
0
View file @
9bf3ac61
...
...
@@ -478,6 +478,197 @@ BOOL WINAPI ReleaseSemaphore( HANDLE handle, LONG count, LONG *previous )
}
/*
* Timers
*/
/***********************************************************************
* CreateWaitableTimerA (KERNEL32.@)
*/
HANDLE
WINAPI
CreateWaitableTimerA
(
SECURITY_ATTRIBUTES
*
sa
,
BOOL
manual
,
LPCSTR
name
)
{
WCHAR
buffer
[
MAX_PATH
];
if
(
!
name
)
return
CreateWaitableTimerW
(
sa
,
manual
,
NULL
);
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
buffer
,
MAX_PATH
))
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
return
0
;
}
return
CreateWaitableTimerW
(
sa
,
manual
,
buffer
);
}
/***********************************************************************
* CreateWaitableTimerW (KERNEL32.@)
*/
HANDLE
WINAPI
CreateWaitableTimerW
(
SECURITY_ATTRIBUTES
*
sa
,
BOOL
manual
,
LPCWSTR
name
)
{
HANDLE
handle
;
NTSTATUS
status
;
UNICODE_STRING
us
;
DWORD
attr
=
0
;
OBJECT_ATTRIBUTES
oa
;
if
(
name
)
RtlInitUnicodeString
(
&
us
,
name
);
if
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
)
attr
|=
OBJ_INHERIT
;
InitializeObjectAttributes
(
&
oa
,
name
?
&
us
:
NULL
,
attr
,
NULL
/* FIXME */
,
NULL
/* FIXME */
);
status
=
NtCreateTimer
(
&
handle
,
TIMER_ALL_ACCESS
,
&
oa
,
manual
?
NotificationTimer
:
SynchronizationTimer
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
0
;
}
return
handle
;
}
/***********************************************************************
* OpenWaitableTimerA (KERNEL32.@)
*/
HANDLE
WINAPI
OpenWaitableTimerA
(
DWORD
access
,
BOOL
inherit
,
LPCSTR
name
)
{
WCHAR
buffer
[
MAX_PATH
];
if
(
!
name
)
return
OpenWaitableTimerW
(
access
,
inherit
,
NULL
);
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
buffer
,
MAX_PATH
))
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
return
0
;
}
return
OpenWaitableTimerW
(
access
,
inherit
,
buffer
);
}
/***********************************************************************
* OpenWaitableTimerW (KERNEL32.@)
*/
HANDLE
WINAPI
OpenWaitableTimerW
(
DWORD
access
,
BOOL
inherit
,
LPCWSTR
name
)
{
NTSTATUS
status
;
ULONG
attr
=
0
;
UNICODE_STRING
us
;
HANDLE
handle
;
OBJECT_ATTRIBUTES
oa
;
if
(
inherit
)
attr
|=
OBJ_INHERIT
;
if
(
name
)
RtlInitUnicodeString
(
&
us
,
name
);
InitializeObjectAttributes
(
&
oa
,
name
?
&
us
:
NULL
,
attr
,
NULL
/* FIXME */
,
NULL
/* FIXME */
);
status
=
NtOpenTimer
(
&
handle
,
access
,
&
oa
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
0
;
}
return
handle
;
}
/***********************************************************************
* SetWaitableTimer (KERNEL32.@)
*/
BOOL
WINAPI
SetWaitableTimer
(
HANDLE
handle
,
const
LARGE_INTEGER
*
when
,
LONG
period
,
PTIMERAPCROUTINE
callback
,
LPVOID
arg
,
BOOL
resume
)
{
NTSTATUS
status
=
NtSetTimer
(
handle
,
when
,
callback
,
arg
,
resume
,
period
,
NULL
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
if
(
status
!=
STATUS_TIMER_RESUME_IGNORED
)
return
FALSE
;
}
return
TRUE
;
}
/***********************************************************************
* CancelWaitableTimer (KERNEL32.@)
*/
BOOL
WINAPI
CancelWaitableTimer
(
HANDLE
handle
)
{
NTSTATUS
status
;
status
=
NtCancelTimer
(
handle
,
NULL
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
return
TRUE
;
}
/***********************************************************************
* CreateTimerQueue (KERNEL32.@)
*/
HANDLE
WINAPI
CreateTimerQueue
(
void
)
{
FIXME
(
"stub
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
NULL
;
}
/***********************************************************************
* DeleteTimerQueueEx (KERNEL32.@)
*/
BOOL
WINAPI
DeleteTimerQueueEx
(
HANDLE
TimerQueue
,
HANDLE
CompletionEvent
)
{
FIXME
(
"(%p, %p): stub
\n
"
,
TimerQueue
,
CompletionEvent
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
}
/***********************************************************************
* 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 faillure
*
* BUGS
* Unimplemented
*/
BOOL
WINAPI
CreateTimerQueueTimer
(
PHANDLE
phNewTimer
,
HANDLE
TimerQueue
,
WAITORTIMERCALLBACK
Callback
,
PVOID
Parameter
,
DWORD
DueTime
,
DWORD
Period
,
ULONG
Flags
)
{
FIXME
(
"stub
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
TRUE
;
}
/***********************************************************************
* DeleteTimerQueueTimer (KERNEL32.@)
*
* Cancels a timer-queue timer.
*
* RETURNS
* nonzero on success or zero on faillure
*
* BUGS
* Unimplemented
*/
BOOL
WINAPI
DeleteTimerQueueTimer
(
HANDLE
TimerQueue
,
HANDLE
Timer
,
HANDLE
CompletionEvent
)
{
FIXME
(
"stub
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
TRUE
;
}
/*
* Pipes
*/
...
...
This diff is collapsed.
Click to expand it.
dlls/ntdll/Makefile.in
+
0
−
1
View file @
9bf3ac61
...
...
@@ -59,7 +59,6 @@ C_SRCS = \
$(
TOPOBJDIR
)
/scheduler/sysdeps.c
\
$(
TOPOBJDIR
)
/scheduler/syslevel.c
\
$(
TOPOBJDIR
)
/scheduler/thread.c
\
$(
TOPOBJDIR
)
/scheduler/timer.c
\
$(
TOPOBJDIR
)
/win32/device.c
\
$(
TOPOBJDIR
)
/win32/except.c
\
$(
TOPOBJDIR
)
/win32/kernel32.c
\
...
...
This diff is collapsed.
Click to expand it.
scheduler/timer.c
deleted
100644 → 0
+
0
−
223
View file @
fd9cbb6c
/*
* Win32 waitable timers
*
* Copyright 1999 Alexandre Julliard
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#include
"config.h"
#include
"wine/port.h"
#include
<assert.h>
#include
<string.h>
#define NONAMELESSUNION
#define NONAMELESSSTRUCT
#include
"winerror.h"
#include
"winnls.h"
#include
"wine/unicode.h"
#include
"wine/server.h"
#include
"wine/debug.h"
#include
"ntdll_misc.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
timer
);
/***********************************************************************
* CreateWaitableTimerA (KERNEL32.@)
*/
HANDLE
WINAPI
CreateWaitableTimerA
(
SECURITY_ATTRIBUTES
*
sa
,
BOOL
manual
,
LPCSTR
name
)
{
WCHAR
buffer
[
MAX_PATH
];
if
(
!
name
)
return
CreateWaitableTimerW
(
sa
,
manual
,
NULL
);
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
buffer
,
MAX_PATH
))
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
return
0
;
}
return
CreateWaitableTimerW
(
sa
,
manual
,
buffer
);
}
/***********************************************************************
* CreateWaitableTimerW (KERNEL32.@)
*/
HANDLE
WINAPI
CreateWaitableTimerW
(
SECURITY_ATTRIBUTES
*
sa
,
BOOL
manual
,
LPCWSTR
name
)
{
HANDLE
handle
;
NTSTATUS
status
;
UNICODE_STRING
us
;
DWORD
attr
=
0
;
OBJECT_ATTRIBUTES
oa
;
if
(
name
)
RtlInitUnicodeString
(
&
us
,
name
);
if
(
sa
&&
(
sa
->
nLength
>=
sizeof
(
*
sa
))
&&
sa
->
bInheritHandle
)
attr
|=
OBJ_INHERIT
;
InitializeObjectAttributes
(
&
oa
,
name
?
&
us
:
NULL
,
attr
,
NULL
/* FIXME */
,
NULL
/* FIXME */
);
status
=
NtCreateTimer
(
&
handle
,
TIMER_ALL_ACCESS
,
&
oa
,
manual
?
NotificationTimer
:
SynchronizationTimer
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
NULL
;
}
return
handle
;
}
/***********************************************************************
* OpenWaitableTimerA (KERNEL32.@)
*/
HANDLE
WINAPI
OpenWaitableTimerA
(
DWORD
access
,
BOOL
inherit
,
LPCSTR
name
)
{
WCHAR
buffer
[
MAX_PATH
];
if
(
!
name
)
return
OpenWaitableTimerW
(
access
,
inherit
,
NULL
);
if
(
!
MultiByteToWideChar
(
CP_ACP
,
0
,
name
,
-
1
,
buffer
,
MAX_PATH
))
{
SetLastError
(
ERROR_FILENAME_EXCED_RANGE
);
return
0
;
}
return
OpenWaitableTimerW
(
access
,
inherit
,
buffer
);
}
/***********************************************************************
* OpenWaitableTimerW (KERNEL32.@)
*/
HANDLE
WINAPI
OpenWaitableTimerW
(
DWORD
access
,
BOOL
inherit
,
LPCWSTR
name
)
{
NTSTATUS
status
;
ULONG
attr
=
0
;
UNICODE_STRING
us
;
HANDLE
handle
;
OBJECT_ATTRIBUTES
oa
;
if
(
inherit
)
attr
|=
OBJ_INHERIT
;
if
(
name
)
RtlInitUnicodeString
(
&
us
,
name
);
InitializeObjectAttributes
(
&
oa
,
name
?
&
us
:
NULL
,
attr
,
NULL
/* FIXME */
,
NULL
/* FIXME */
);
status
=
NtOpenTimer
(
&
handle
,
access
,
&
oa
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
NULL
;
}
return
handle
;
}
/***********************************************************************
* SetWaitableTimer (KERNEL32.@)
*/
BOOL
WINAPI
SetWaitableTimer
(
HANDLE
handle
,
const
LARGE_INTEGER
*
when
,
LONG
period
,
PTIMERAPCROUTINE
callback
,
LPVOID
arg
,
BOOL
resume
)
{
NTSTATUS
status
;
status
=
NtSetTimer
(
handle
,
when
,
callback
,
arg
,
resume
,
period
,
NULL
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
if
(
status
!=
STATUS_TIMER_RESUME_IGNORED
)
return
FALSE
;
}
return
TRUE
;
}
/***********************************************************************
* CancelWaitableTimer (KERNEL32.@)
*/
BOOL
WINAPI
CancelWaitableTimer
(
HANDLE
handle
)
{
NTSTATUS
status
;
status
=
NtCancelTimer
(
handle
,
NULL
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
return
TRUE
;
}
/***********************************************************************
* CreateTimerQueue (KERNEL32.@)
*/
HANDLE
WINAPI
CreateTimerQueue
(
void
)
{
FIXME
(
"stub
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
NULL
;
}
/***********************************************************************
* DeleteTimerQueueEx (KERNEL32.@)
*/
BOOL
WINAPI
DeleteTimerQueueEx
(
HANDLE
TimerQueue
,
HANDLE
CompletionEvent
)
{
FIXME
(
"(%p, %p): stub
\n
"
,
TimerQueue
,
CompletionEvent
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
0
;
}
/***********************************************************************
* 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 faillure
*
* BUGS
* Unimplemented
*/
BOOL
WINAPI
CreateTimerQueueTimer
(
PHANDLE
phNewTimer
,
HANDLE
TimerQueue
,
WAITORTIMERCALLBACK
Callback
,
PVOID
Parameter
,
DWORD
DueTime
,
DWORD
Period
,
ULONG
Flags
)
{
FIXME
(
"stub
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
TRUE
;
}
/***********************************************************************
* DeleteTimerQueueTimer (KERNEL32.@)
*
* Cancels a timer-queue timer.
*
* RETURNS
* nonzero on success or zero on faillure
*
* BUGS
* Unimplemented
*/
BOOL
WINAPI
DeleteTimerQueueTimer
(
HANDLE
TimerQueue
,
HANDLE
Timer
,
HANDLE
CompletionEvent
)
{
FIXME
(
"stub
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
TRUE
;
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment