mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 09:00:27 +00:00
don't leak a reference to the timer object when copying to the buffer failed in NtQueryTimer() and don't use uninitialized variable in NtSetTimer()
svn path=/trunk/; revision=13556
This commit is contained in:
parent
be2fa40d3e
commit
31a913fde7
1 changed files with 20 additions and 15 deletions
|
@ -483,22 +483,27 @@ NtQueryTimer(IN HANDLE TimerHandle,
|
|||
/* Check for Success */
|
||||
if(NT_SUCCESS(Status)) {
|
||||
|
||||
/* Return the Basic Information */
|
||||
_SEH_TRY {
|
||||
|
||||
/* FIXME: Interrupt correction based on Interrupt Time */
|
||||
DPRINT("Returning Information for Timer: %x. Time Remaining: %d\n", Timer, Timer->KeTimer.DueTime.QuadPart);
|
||||
BasicInfo->TimeRemaining.QuadPart = Timer->KeTimer.DueTime.QuadPart;
|
||||
BasicInfo->SignalState = KeReadStateTimer(&Timer->KeTimer);
|
||||
ObDereferenceObject(Timer);
|
||||
switch(TimerInformationClass) {
|
||||
case TimerBasicInformation: {
|
||||
/* Return the Basic Information */
|
||||
_SEH_TRY {
|
||||
|
||||
if(ReturnLength != NULL) {
|
||||
*ReturnLength = sizeof(TIMER_BASIC_INFORMATION);
|
||||
}
|
||||
/* FIXME: Interrupt correction based on Interrupt Time */
|
||||
DPRINT("Returning Information for Timer: %x. Time Remaining: %d\n", Timer, Timer->KeTimer.DueTime.QuadPart);
|
||||
BasicInfo->TimeRemaining.QuadPart = Timer->KeTimer.DueTime.QuadPart;
|
||||
BasicInfo->SignalState = KeReadStateTimer(&Timer->KeTimer);
|
||||
|
||||
if(ReturnLength != NULL) {
|
||||
*ReturnLength = sizeof(TIMER_BASIC_INFORMATION);
|
||||
}
|
||||
|
||||
} _SEH_HANDLE {
|
||||
Status = _SEH_GetExceptionCode();
|
||||
} _SEH_END;
|
||||
}
|
||||
}
|
||||
|
||||
} _SEH_HANDLE {
|
||||
Status = _SEH_GetExceptionCode();
|
||||
} _SEH_END;
|
||||
ObDereferenceObject(Timer);
|
||||
}
|
||||
|
||||
/* Return Status */
|
||||
|
@ -517,7 +522,7 @@ NtSetTimer(IN HANDLE TimerHandle,
|
|||
{
|
||||
PETIMER Timer;
|
||||
KIRQL OldIrql;
|
||||
BOOLEAN KillTimer;
|
||||
BOOLEAN KillTimer = FALSE;
|
||||
BOOLEAN State;
|
||||
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
|
||||
PETHREAD CurrentThread = PsGetCurrentThread();
|
||||
|
|
Loading…
Reference in a new issue