[9/11] kernel32: Implement ChangeTimerQueueTimer.
Dan Hipschman
dsh at linux.ucla.edu
Fri Jul 18 19:19:48 CDT 2008
---
dlls/kernel32/sync.c | 17 +++++++++++++++--
dlls/kernel32/tests/sync.c | 2 +-
2 files changed, 16 insertions(+), 3 deletions(-)
diff --git a/dlls/kernel32/sync.c b/dlls/kernel32/sync.c
index 4df5b44..4076859 100644
--- a/dlls/kernel32/sync.c
+++ b/dlls/kernel32/sync.c
@@ -1334,8 +1334,21 @@ BOOL WINAPI CreateTimerQueueTimer( PHANDLE phNewTimer, HANDLE TimerQueue,
BOOL WINAPI ChangeTimerQueueTimer( HANDLE TimerQueue, HANDLE Timer,
ULONG DueTime, ULONG Period )
{
- FIXME("stub\n");
- SetLastError(ERROR_CALL_NOT_IMPLEMENTED);
+ struct queue_timer *t = Timer;
+ struct timer_queue *q = t->q;
+
+ RtlEnterCriticalSection(&q->cs);
+ t->period = Period;
+ {
+ /* FIXME: Solve this, here or in timer_queue_update. */
+ DWORD tick = GetTickCount();
+ t->expire = tick + DueTime;
+ if (t->expire < tick)
+ ERR("due time wrapped\n");
+ }
+ SetEvent(q->event);
+ RtlLeaveCriticalSection(&q->cs);
+
return TRUE;
}
diff --git a/dlls/kernel32/tests/sync.c b/dlls/kernel32/tests/sync.c
index 71c02a0..b77d57f 100644
--- a/dlls/kernel32/tests/sync.c
+++ b/dlls/kernel32/tests/sync.c
@@ -752,8 +752,8 @@ static void test_timer_queue(void)
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");
}
More information about the wine-patches
mailing list