Author: tfaber
Date: Sat Sep 28 11:37:08 2013
New Revision: 60407
URL:
http://svn.reactos.org/svn/reactos?rev=60407&view=rev
Log:
[NTOS:EX]
- Correctly return STATUS_TIMER_RESOLUTION_NOT_SET if the resolution was not changed in
NtSetTimerResolution. Patch by Aleksandar Andrejevic.
CORE-7387
Modified:
trunk/reactos/ntoskrnl/ex/time.c
Modified: trunk/reactos/ntoskrnl/ex/time.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/ntoskrnl/ex/time.c?rev=604…
==============================================================================
--- trunk/reactos/ntoskrnl/ex/time.c [iso-8859-1] (original)
+++ trunk/reactos/ntoskrnl/ex/time.c [iso-8859-1] Sat Sep 28 11:37:08 2013
@@ -527,6 +527,7 @@
IN BOOLEAN SetResolution,
OUT PULONG CurrentResolution)
{
+ NTSTATUS Status;
KPROCESSOR_MODE PreviousMode = ExGetPreviousMode();
PEPROCESS Process = PsGetCurrentProcess();
ULONG NewResolution;
@@ -551,15 +552,21 @@
NewResolution = ExSetTimerResolution(DesiredResolution, SetResolution);
*CurrentResolution = NewResolution;
- if (SetResolution)
- {
- /* Set the flag that the resolution has been changed */
- Process->SetTimerResolution = TRUE;
- }
-
- /* Return success if the process changed its timer resolution */
- if (Process->SetTimerResolution) return STATUS_SUCCESS;
- else return STATUS_TIMER_RESOLUTION_NOT_SET;
+ if (SetResolution || Process->SetTimerResolution)
+ {
+ /* 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;
+ }
+
+ /* Update the flag */
+ Process->SetTimerResolution = SetResolution;
+
+ return Status;
}
/* EOF */