[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
This commit is contained in:
George Bișoc
2024-12-16 17:24:56 +01:00
parent 5ebd478325
commit 2416c31a30
+2 -2
View File
@@ -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,