[POWERPROF] ValidatePowerPolicies: Do not fail because of legal power states which...
authorEric Kohl <eric.kohl@reactos.org>
Thu, 2 May 2019 18:21:32 +0000 (20:21 +0200)
committerEric Kohl <eric.kohl@reactos.org>
Thu, 2 May 2019 18:39:58 +0000 (20:39 +0200)
dll/win32/powrprof/powrprof.c

index d176c2a..287c097 100644 (file)
@@ -874,7 +874,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP)
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
         }
-        if ((int)pGPP->mach.LidOpenWakeAc >= PowerSystemShutdown)
+        if ((int)pGPP->mach.LidOpenWakeAc > PowerSystemShutdown)
         {
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
@@ -884,7 +884,7 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP)
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
         }
-        if ((int)pGPP->mach.LidOpenWakeDc >= PowerSystemShutdown)
+        if ((int)pGPP->mach.LidOpenWakeDc > PowerSystemShutdown)
         {
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
@@ -963,22 +963,22 @@ ValidatePowerPolicies(PGLOBAL_POWER_POLICY pGPP, PPOWER_POLICY pPP)
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
         }
-        if (pPP->mach.ReducedLatencySleepAc == PowerSystemUnspecified)
+        if ((int)pPP->mach.ReducedLatencySleepAc == PowerSystemUnspecified)
         {
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
         }
-        if ((int)pPP->mach.ReducedLatencySleepAc >= PowerSystemShutdown)
+        if ((int)pPP->mach.ReducedLatencySleepAc > PowerSystemShutdown)
         {
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
         }
-        if (pPP->mach.ReducedLatencySleepDc < PowerSystemWorking)
+        if ((int)pPP->mach.ReducedLatencySleepDc < PowerSystemWorking)
         {
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;
         }
-        if ((int)pPP->mach.ReducedLatencySleepDc >= PowerSystemShutdown)
+        if ((int)pPP->mach.ReducedLatencySleepDc > PowerSystemShutdown)
         {
             SetLastError(ERROR_GEN_FAILURE);
             return FALSE;