https://git.reactos.org/?p=reactos.git;a=commitdiff;h=2416c31a30aa6bd88ff9548d48b224813296f7d7

commit 2416c31a30aa6bd88ff9548d48b224813296f7d7
Author:     George Bișoc <[email protected]>
AuthorDate: Sat Dec 14 14:46:36 2024 +0100
Commit:     George Bișoc <[email protected]>
CommitDate: Mon Dec 16 17:24:56 2024 +0100

    [BATTC] Fix the wait timeout conversion
    
    KeWaitForSingleObject takes 100ns unit for timeout. Both 
IOCTL_BATTERY_QUERY_TAG and IOCTL_BATTERY_QUERY_STATUS take a wait for the 
timeout in milliseconds.
    Supposedly a miniport driver wants to supply a wait of 5000 ms (which is 
equivalent to 5 s), the miniport driver WON'T BE WAITING 5 seconds but 0.5!!!
    
    CORE-18969
    CORE-19452
---
 drivers/battery/battc/battc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/battery/battc/battc.c b/drivers/battery/battc/battc.c
index dd08a9cd956..84ae9df061e 100644
--- a/drivers/battery/battc/battc.c
+++ b/drivers/battery/battc/battc.c
@@ -223,7 +223,7 @@ BatteryClassIoctl(PVOID ClassData,
 
             WaitTime = IrpSp->Parameters.DeviceIoControl.InputBufferLength == 
sizeof(ULONG) ? *(PULONG)Irp->AssociatedIrp.SystemBuffer : 0;
 
-            Timeout.QuadPart = Int32x32To64(WaitTime, -1000);
+            Timeout.QuadPart = Int32x32To64(WaitTime, -10000);
 
             Status = 
BattClass->MiniportInfo.QueryTag(BattClass->MiniportInfo.Context,
                                                       
(PULONG)Irp->AssociatedIrp.SystemBuffer);
@@ -272,7 +272,7 @@ BatteryClassIoctl(PVOID ClassData,
 
             BattWait = *(PBATTERY_WAIT_STATUS)Irp->AssociatedIrp.SystemBuffer;
 
-            Timeout.QuadPart = Int32x32To64(BattWait.Timeout, -1000);
+            Timeout.QuadPart = Int32x32To64(BattWait.Timeout, -10000);
 
             BattStatus = Irp->AssociatedIrp.SystemBuffer;
             Status = 
BattClass->MiniportInfo.QueryStatus(BattClass->MiniportInfo.Context,

Reply via email to