ntoskrnl.exe: Implement KeSetTimerEx() and waiting on timers.

Signed-off-by: Zebediah Figura <z.figura12@gmail.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Zebediah Figura 2018-11-27 19:43:06 -06:00 committed by Alexandre Julliard
parent 2e4ffcd861
commit 55778f4d8a
3 changed files with 32 additions and 9 deletions

View File

@ -3824,15 +3824,6 @@ void WINAPI IoInvalidateDeviceRelations( DEVICE_OBJECT *device_object, DEVICE_RE
} }
} }
/***********************************************************************
* KeSetTimerEx (NTOSKRNL.EXE.@)
*/
BOOL WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period, KDPC *dpc )
{
FIXME("stub: %p %s %u %p\n", timer, wine_dbgstr_longlong(duetime.QuadPart), period, dpc);
return TRUE;
}
/*********************************************************************** /***********************************************************************
* IoCreateFile (NTOSKRNL.EXE.@) * IoCreateFile (NTOSKRNL.EXE.@)
*/ */

View File

@ -94,6 +94,9 @@ NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG count, void *pobjs[],
semaphore->Header.SignalState, semaphore->Limit, NULL ); semaphore->Header.SignalState, semaphore->Limit, NULL );
break; break;
} }
case TYPE_MANUAL_TIMER:
case TYPE_AUTO_TIMER:
break;
} }
} }
@ -111,6 +114,7 @@ NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG count, void *pobjs[],
switch (objs[i]->Type) switch (objs[i]->Type)
{ {
case TYPE_AUTO_EVENT: case TYPE_AUTO_EVENT:
case TYPE_AUTO_TIMER:
objs[i]->SignalState = FALSE; objs[i]->SignalState = FALSE;
break; break;
case TYPE_MUTEX: case TYPE_MUTEX:
@ -317,3 +321,30 @@ void WINAPI KeInitializeTimer( KTIMER *timer )
{ {
KeInitializeTimerEx(timer, NotificationTimer); KeInitializeTimerEx(timer, NotificationTimer);
} }
/***********************************************************************
* KeSetTimerEx (NTOSKRNL.EXE.@)
*/
BOOLEAN WINAPI KeSetTimerEx( KTIMER *timer, LARGE_INTEGER duetime, LONG period, KDPC *dpc )
{
BOOL manual = timer->Header.Type == TYPE_MANUAL_TIMER;
BOOL ret;
TRACE("timer %p, duetime %s, period %d, dpc %p.\n",
timer, wine_dbgstr_longlong(duetime.QuadPart), period, dpc);
if (dpc)
{
FIXME("Unhandled DPC %p.\n", dpc);
return FALSE;
}
EnterCriticalSection( &sync_cs );
ret = timer->Header.Inserted;
timer->Header.Inserted = TRUE;
timer->Header.WaitListHead.Blink = CreateWaitableTimerW( NULL, manual, NULL );
SetWaitableTimer( timer->Header.WaitListHead.Blink, &duetime, period, NULL, NULL, FALSE );
LeaveCriticalSection( &sync_cs );
return ret;
}

View File

@ -1435,6 +1435,7 @@ LONG WINAPI KeResetEvent(PRKEVENT);
LONG WINAPI KeSetEvent(PRKEVENT,KPRIORITY,BOOLEAN); LONG WINAPI KeSetEvent(PRKEVENT,KPRIORITY,BOOLEAN);
KPRIORITY WINAPI KeSetPriorityThread(PKTHREAD,KPRIORITY); KPRIORITY WINAPI KeSetPriorityThread(PKTHREAD,KPRIORITY);
void WINAPI KeSetSystemAffinityThread(KAFFINITY); void WINAPI KeSetSystemAffinityThread(KAFFINITY);
BOOLEAN WINAPI KeSetTimerEx(KTIMER*,LARGE_INTEGER,LONG,KDPC*);
NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG,void*[],WAIT_TYPE,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*,KWAIT_BLOCK*); NTSTATUS WINAPI KeWaitForMultipleObjects(ULONG,void*[],WAIT_TYPE,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*,KWAIT_BLOCK*);
NTSTATUS WINAPI KeWaitForSingleObject(void*,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*); NTSTATUS WINAPI KeWaitForSingleObject(void*,KWAIT_REASON,KPROCESSOR_MODE,BOOLEAN,LARGE_INTEGER*);