mirror of
https://github.com/winfsp/winfsp.git
synced 2025-07-03 09:22:57 -05:00
sys: statistics: implement FSCTL_FILESYSTEM_GET_STATISTICS
This commit is contained in:
@ -281,6 +281,28 @@ VOID FspIopCompleteIrpEx(PIRP Irp, NTSTATUS Result, BOOLEAN DeviceDereference)
|
||||
PIO_STACK_LOCATION IrpSp = IoGetCurrentIrpStackLocation(Irp);
|
||||
PDEVICE_OBJECT DeviceObject = IrpSp->DeviceObject;
|
||||
|
||||
/*
|
||||
* HACK:
|
||||
*
|
||||
* We update the Create statistics here to avoid doing it in multiple places.
|
||||
*/
|
||||
if (IRP_MJ_CREATE == IrpSp->MajorFunction)
|
||||
{
|
||||
FSP_DEVICE_EXTENSION *DeviceExtension = FspDeviceExtension(DeviceObject);
|
||||
|
||||
if (FspFsvolDeviceExtensionKind == FspDeviceExtension(DeviceObject)->Kind)
|
||||
{
|
||||
FSP_STATISTICS *Statistics = FspStatistics(
|
||||
((FSP_FSVOL_DEVICE_EXTENSION *)DeviceExtension)->Statistics);
|
||||
|
||||
FspStatisticsInc(Statistics, Specific.CreateHits);
|
||||
if (STATUS_SUCCESS == Result)
|
||||
FspStatisticsInc(Statistics, Specific.SuccessfulCreates);
|
||||
else
|
||||
FspStatisticsInc(Statistics, Specific.FailedCreates);
|
||||
}
|
||||
}
|
||||
else
|
||||
/*
|
||||
* HACK:
|
||||
*
|
||||
|
Reference in New Issue
Block a user