Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
396e47ef
Commit
396e47ef
authored
Jul 24, 2008
by
Dan Hipschman
Committed by
Alexandre Julliard
Jul 25, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ntdll: Implement RtlUpdateTimer for kernel32's ChangeTimerQueueTimer.
parent
5ef54c4c
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
59 additions
and
10 deletions
+59
-10
sync.c
dlls/kernel32/sync.c
+9
-6
sync.c
dlls/kernel32/tests/sync.c
+12
-3
ntdll.spec
dlls/ntdll/ntdll.spec
+1
-1
threadpool.c
dlls/ntdll/threadpool.c
+36
-0
winternl.h
include/winternl.h
+1
-0
No files found.
dlls/kernel32/sync.c
View file @
396e47ef
...
...
@@ -1109,16 +1109,19 @@ BOOL WINAPI CreateTimerQueueTimer( PHANDLE phNewTimer, HANDLE TimerQueue,
*
* RETURNS
* nonzero on success or zero on failure
*
* BUGS
* Unimplemented
*/
BOOL
WINAPI
ChangeTimerQueueTimer
(
HANDLE
TimerQueue
,
HANDLE
Timer
,
ULONG
DueTime
,
ULONG
Period
)
{
FIXME
(
"stub
\n
"
);
SetLastError
(
ERROR_CALL_NOT_IMPLEMENTED
);
return
FALSE
;
NTSTATUS
status
=
RtlUpdateTimer
(
TimerQueue
,
Timer
,
DueTime
,
Period
);
if
(
status
!=
STATUS_SUCCESS
)
{
SetLastError
(
RtlNtStatusToDosError
(
status
)
);
return
FALSE
;
}
return
TRUE
;
}
/***********************************************************************
...
...
dlls/kernel32/tests/sync.c
View file @
396e47ef
...
...
@@ -583,7 +583,6 @@ static void CALLBACK timer_queue_cb3(PVOID p, BOOLEAN timedOut)
/* Basically kill the timer since it won't have time to run
again. */
BOOL
ret
=
pChangeTimerQueueTimer
(
d
->
q
,
d
->
t
,
10000
,
0
);
todo_wine
ok
(
ret
,
"ChangeTimerQueueTimer
\n
"
);
}
}
...
...
@@ -600,7 +599,6 @@ static void CALLBACK timer_queue_cb4(PVOID p, BOOLEAN timedOut)
fail if the timer is already flagged. Hence we really run
only once. Otherwise we will run multiple times. */
BOOL
ret
=
pChangeTimerQueueTimer
(
d
->
q
,
d
->
t
,
50
,
50
);
todo_wine
ok
(
ret
,
"ChangeTimerQueueTimer
\n
"
);
++
d
->
num_calls
;
}
...
...
@@ -707,6 +705,16 @@ static void test_timer_queue(void)
q
=
pCreateTimerQueue
();
ok
(
q
!=
NULL
,
"CreateTimerQueue
\n
"
);
/* Test changing a once-only timer before it fires (this is allowed,
whereas after it fires you cannot). */
n1
=
0
;
ret
=
pCreateTimerQueueTimer
(
&
t1
,
q
,
timer_queue_cb1
,
&
n1
,
10000
,
0
,
0
);
ok
(
ret
,
"CreateTimerQueueTimer
\n
"
);
ok
(
t1
!=
NULL
,
"CreateTimerQueueTimer
\n
"
);
ret
=
pChangeTimerQueueTimer
(
q
,
t1
,
0
,
0
);
ok
(
ret
,
"ChangeTimerQueueTimer
\n
"
);
d2
.
t
=
t2
=
NULL
;
d2
.
num_calls
=
0
;
d2
.
max_calls
=
3
;
...
...
@@ -740,11 +748,12 @@ static void test_timer_queue(void)
ret
=
pDeleteTimerQueueEx
(
q
,
INVALID_HANDLE_VALUE
);
ok
(
ret
,
"DeleteTimerQueueEx
\n
"
);
ok
(
n1
==
1
,
"ChangeTimerQueueTimer
\n
"
);
todo_wine
{
ok
(
d2
.
num_calls
==
d2
.
max_calls
,
"DeleteTimerQueueTimer
\n
"
);
ok
(
d3
.
num_calls
==
d3
.
max_calls
,
"ChangeTimerQueueTimer
\n
"
);
}
ok
(
d3
.
num_calls
==
d3
.
max_calls
,
"ChangeTimerQueueTimer
\n
"
);
ok
(
d4
.
num_calls
==
1
,
"Timer flagged for deletion incorrectly
\n
"
);
}
...
...
dlls/ntdll/ntdll.spec
View file @
396e47ef
...
...
@@ -895,7 +895,7 @@
@ stub RtlUpcaseUnicodeToCustomCPN
@ stdcall RtlUpcaseUnicodeToMultiByteN(ptr long ptr ptr long)
@ stdcall RtlUpcaseUnicodeToOemN(ptr long ptr ptr long)
# @ stub RtlUpdateTimer
@ stdcall RtlUpdateTimer(ptr ptr long long)
@ stdcall RtlUpperChar(long)
@ stdcall RtlUpperString(ptr ptr)
@ stub RtlUsageHeap
...
...
dlls/ntdll/threadpool.c
View file @
396e47ef
...
...
@@ -907,3 +907,39 @@ NTSTATUS WINAPI RtlCreateTimer(PHANDLE NewTimer, HANDLE TimerQueue,
return
status
;
}
/***********************************************************************
* RtlUpdateTimer (NTDLL.@)
*
* Changes the time at which a timer expires.
*
* PARAMS
* TimerQueue [I] The queue that holds the timer.
* Timer [I] The timer to update.
* DueTime [I] The delay, in milliseconds, before next firing the timer.
* Period [I] The period, in milliseconds, at which to fire the timer
* after the first callback. If zero, the timer will not
* refire once. It still needs to be deleted with
* RtlDeleteTimer.
*
* RETURNS
* Success: STATUS_SUCCESS.
* Failure: Any NTSTATUS code.
*/
NTSTATUS
WINAPI
RtlUpdateTimer
(
HANDLE
TimerQueue
,
HANDLE
Timer
,
DWORD
DueTime
,
DWORD
Period
)
{
struct
timer_queue
*
q
=
TimerQueue
;
struct
queue_timer
*
t
=
Timer
;
RtlEnterCriticalSection
(
&
q
->
cs
);
/* Can't change a timer if it was once-only or destroyed. */
if
(
t
->
expire
!=
EXPIRE_NEVER
)
{
t
->
period
=
Period
;
queue_move_timer
(
t
,
queue_current_time
()
+
DueTime
,
TRUE
);
}
RtlLeaveCriticalSection
(
&
q
->
cs
);
return
STATUS_SUCCESS
;
}
include/winternl.h
View file @
396e47ef
...
...
@@ -2340,6 +2340,7 @@ NTSYSAPI NTSTATUS WINAPI RtlUpcaseUnicodeStringToCountedOemString(STRING*,const
NTSYSAPI
NTSTATUS
WINAPI
RtlUpcaseUnicodeStringToOemString
(
STRING
*
,
const
UNICODE_STRING
*
,
BOOLEAN
);
NTSYSAPI
NTSTATUS
WINAPI
RtlUpcaseUnicodeToMultiByteN
(
LPSTR
,
DWORD
,
LPDWORD
,
LPCWSTR
,
DWORD
);
NTSYSAPI
NTSTATUS
WINAPI
RtlUpcaseUnicodeToOemN
(
LPSTR
,
DWORD
,
LPDWORD
,
LPCWSTR
,
DWORD
);
NTSYSAPI
NTSTATUS
WINAPI
RtlUpdateTimer
(
HANDLE
,
HANDLE
,
DWORD
,
DWORD
);
NTSYSAPI
CHAR
WINAPI
RtlUpperChar
(
CHAR
);
NTSYSAPI
void
WINAPI
RtlUpperString
(
STRING
*
,
const
STRING
*
);
NTSYSAPI
NTSTATUS
WINAPI
RtlValidSecurityDescriptor
(
PSECURITY_DESCRIPTOR
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment