mirror of
https://github.com/reactos/reactos.git
synced 2024-12-28 01:55:19 +00:00
[BATTC] Make input buffer on IOCTL_BATTERY_QUERY_TAG optional
In that case, don't wait to get battery tag.
This commit is contained in:
parent
385ac5d4d2
commit
6b5ee5ccc7
1 changed files with 2 additions and 2 deletions
|
@ -214,14 +214,14 @@ BatteryClassIoctl(PVOID ClassData,
|
||||||
switch (IrpSp->Parameters.DeviceIoControl.IoControlCode)
|
switch (IrpSp->Parameters.DeviceIoControl.IoControlCode)
|
||||||
{
|
{
|
||||||
case IOCTL_BATTERY_QUERY_TAG:
|
case IOCTL_BATTERY_QUERY_TAG:
|
||||||
if (IrpSp->Parameters.DeviceIoControl.InputBufferLength < sizeof(ULONG) ||
|
if ((IrpSp->Parameters.DeviceIoControl.InputBufferLength != sizeof(ULONG) && IrpSp->Parameters.DeviceIoControl.InputBufferLength != 0) ||
|
||||||
IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
|
IrpSp->Parameters.DeviceIoControl.OutputBufferLength < sizeof(ULONG))
|
||||||
{
|
{
|
||||||
Status = STATUS_BUFFER_TOO_SMALL;
|
Status = STATUS_BUFFER_TOO_SMALL;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
WaitTime = *(PULONG)Irp->AssociatedIrp.SystemBuffer;
|
WaitTime = IrpSp->Parameters.DeviceIoControl.InputBufferLength == sizeof(ULONG) ? *(PULONG)Irp->AssociatedIrp.SystemBuffer : 0;
|
||||||
|
|
||||||
Timeout.QuadPart = Int32x32To64(WaitTime, -1000);
|
Timeout.QuadPart = Int32x32To64(WaitTime, -1000);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue