reactos/drivers/parallel/parport/misc.c
Victor Perevertkin 7ed1883c8e
[DRIVERS] Use IoForwardIrpSynchronously in drivers
Instead of having an own routine in each driver
IoForwardIrpSynchronously can be used.
2022-01-05 02:17:56 +03:00

43 lines
1,013 B
C

/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: Parallel Port Function Driver
* FILE: drivers/parallel/parport/misc.c
* PURPOSE: Miscellaneous functions
*/
#include "parport.h"
/* FUNCTIONS ****************************************************************/
NTSTATUS
NTAPI
ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject,
IN PIRP Irp)
{
PDEVICE_OBJECT LowerDevice;
if (((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
else
LowerDevice = ((PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->AttachedFdo;
ASSERT(LowerDevice);
IoSkipCurrentIrpStackLocation(Irp);
return IoCallDriver(LowerDevice, Irp);
}
PVOID
GetUserBuffer(IN PIRP Irp)
{
ASSERT(Irp);
if (Irp->MdlAddress)
return Irp->MdlAddress;
else
return Irp->AssociatedIrp.SystemBuffer;
}
/* EOF */