[NTOS:EX]

- Correctly return STATUS_TIMER_RESOLUTION_NOT_SET if the resolution was not changed in NtSetTimerResolution. Patch by Aleksandar Andrejevic.
CORE-7387

svn path=/trunk/; revision=60407
This commit is contained in:
Thomas Faber
2013-09-28 11:37:08 +00:00
parent 1e8f970eaa
commit 401b9f6652
+13 -6
View File
@@ -527,6 +527,7 @@ NtSetTimerResolution(IN ULONG DesiredResolution,
IN BOOLEAN SetResolution,
OUT PULONG CurrentResolution)
{
NTSTATUS Status;
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
PEPROCESS Process = PsGetCurrentProcess();
ULONG NewResolution;
@@ -551,15 +552,21 @@ NtSetTimerResolution(IN ULONG DesiredResolution,
NewResolution = ExSetTimerResolution(DesiredResolution, SetResolution);
*CurrentResolution = NewResolution;
if (SetResolution)
if (SetResolution || Process->SetTimerResolution)
{
/* Set the flag that the resolution has been changed */
Process->SetTimerResolution = TRUE;
/* The resolution has been changed now or in an earlier call */
Status = STATUS_SUCCESS;
}
else
{
/* The resolution hasn't been changed */
Status = STATUS_TIMER_RESOLUTION_NOT_SET;
}
/* Return success if the process changed its timer resolution */
if (Process->SetTimerResolution) return STATUS_SUCCESS;
else return STATUS_TIMER_RESOLUTION_NOT_SET;
/* Update the flag */
Process->SetTimerResolution = SetResolution;
return Status;
}
/* EOF */