mirror of
https://github.com/reactos/reactos.git
synced 2024-12-29 10:35:28 +00:00
[SERIAL] Fix Serial{Get,Clear}PerfStats() to become proper PKSYNCHRONIZE_ROUTINE routines and get rid of the related casts. Brought to you by Thomas Faber. CORE-11799 (#94)
This commit is contained in:
parent
9556390f8f
commit
56cc2ca115
1 changed files with 27 additions and 26 deletions
|
@ -158,35 +158,36 @@ SerialSetLineControl(
|
||||||
return Status;
|
return Status;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOLEAN
|
static
|
||||||
SerialClearPerfStats(
|
BOOLEAN
|
||||||
IN PSERIAL_DEVICE_EXTENSION DeviceExtension)
|
NTAPI
|
||||||
|
SerialClearPerfStats(IN PVOID SynchronizeContext)
|
||||||
{
|
{
|
||||||
|
PSERIAL_DEVICE_EXTENSION DeviceExtension = SynchronizeContext;
|
||||||
ASSERT(DeviceExtension);
|
ASSERT(DeviceExtension);
|
||||||
|
|
||||||
RtlZeroMemory(&DeviceExtension->SerialPerfStats, sizeof(SERIALPERF_STATS));
|
RtlZeroMemory(&DeviceExtension->SerialPerfStats, sizeof(SERIALPERF_STATS));
|
||||||
DeviceExtension->BreakInterruptErrorCount = 0;
|
DeviceExtension->BreakInterruptErrorCount = 0;
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
static BOOLEAN
|
static
|
||||||
SerialGetPerfStats(IN PIRP pIrp)
|
BOOLEAN
|
||||||
|
NTAPI
|
||||||
|
SerialGetPerfStats(IN PVOID SynchronizeContext)
|
||||||
{
|
{
|
||||||
|
PIRP pIrp = SynchronizeContext;
|
||||||
PSERIAL_DEVICE_EXTENSION pDeviceExtension;
|
PSERIAL_DEVICE_EXTENSION pDeviceExtension;
|
||||||
|
|
||||||
ASSERT(pIrp);
|
ASSERT(pIrp);
|
||||||
pDeviceExtension = (PSERIAL_DEVICE_EXTENSION)
|
pDeviceExtension = IoGetCurrentIrpStackLocation(pIrp)->DeviceObject->DeviceExtension;
|
||||||
IoGetCurrentIrpStackLocation(pIrp)->DeviceObject->DeviceExtension;
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* we assume buffer is big enough to hold SerialPerfStats structure
|
* we assume buffer is big enough to hold SerialPerfStats structure
|
||||||
* caller must verify this
|
* caller must verify this
|
||||||
*/
|
*/
|
||||||
RtlCopyMemory(
|
RtlCopyMemory(pIrp->AssociatedIrp.SystemBuffer,
|
||||||
pIrp->AssociatedIrp.SystemBuffer,
|
|
||||||
&pDeviceExtension->SerialPerfStats,
|
&pDeviceExtension->SerialPerfStats,
|
||||||
sizeof(SERIALPERF_STATS)
|
sizeof(SERIALPERF_STATS));
|
||||||
);
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -309,7 +310,7 @@ SerialDeviceControl(
|
||||||
TRACE_(SERIAL, "IOCTL_SERIAL_CLEAR_STATS\n");
|
TRACE_(SERIAL, "IOCTL_SERIAL_CLEAR_STATS\n");
|
||||||
KeSynchronizeExecution(
|
KeSynchronizeExecution(
|
||||||
DeviceExtension->Interrupt,
|
DeviceExtension->Interrupt,
|
||||||
(PKSYNCHRONIZE_ROUTINE)SerialClearPerfStats,
|
SerialClearPerfStats,
|
||||||
DeviceExtension);
|
DeviceExtension);
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
break;
|
break;
|
||||||
|
@ -519,7 +520,7 @@ SerialDeviceControl(
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
KeSynchronizeExecution(DeviceExtension->Interrupt,
|
KeSynchronizeExecution(DeviceExtension->Interrupt,
|
||||||
(PKSYNCHRONIZE_ROUTINE)SerialGetPerfStats, Irp);
|
SerialGetPerfStats, Irp);
|
||||||
Information = sizeof(SERIALPERF_STATS);
|
Information = sizeof(SERIALPERF_STATS);
|
||||||
Status = STATUS_SUCCESS;
|
Status = STATUS_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue