Reactos
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: Parallel Port Function Driver
4 * FILE: drivers/parallel/parport/misc.c
5 * PURPOSE: Miscellaneous functions
6 */
7
8#include "parport.h"
9#define NDEBUG
10#include <debug.h>
11
12/* FUNCTIONS ****************************************************************/
13
14NTSTATUS
15NTAPI
16ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject,
17 IN PIRP Irp)
18{
19 PDEVICE_OBJECT LowerDevice;
20
21 if (((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
22 LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
23 else
24 LowerDevice = ((PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->AttachedFdo;
25 ASSERT(LowerDevice);
26
27 IoSkipCurrentIrpStackLocation(Irp);
28 return IoCallDriver(LowerDevice, Irp);
29}
30
31
32PVOID
33GetUserBuffer(IN PIRP Irp)
34{
35 ASSERT(Irp);
36
37 if (Irp->MdlAddress)
38 return Irp->MdlAddress;
39 else
40 return Irp->AssociatedIrp.SystemBuffer;
41}
42
43/* EOF */