xref: /reactos/drivers/parallel/parport/misc.c (revision b36d9bd9)
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 
10 
11 /* FUNCTIONS ****************************************************************/
12 
13 NTSTATUS
14 NTAPI
15 ForwardIrpAndForget(IN PDEVICE_OBJECT DeviceObject,
16                     IN PIRP Irp)
17 {
18     PDEVICE_OBJECT LowerDevice;
19 
20     if (((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Common.IsFDO)
21         LowerDevice = ((PFDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice;
22     else
23         LowerDevice = ((PPDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->AttachedFdo;
24     ASSERT(LowerDevice);
25 
26     IoSkipCurrentIrpStackLocation(Irp);
27     return IoCallDriver(LowerDevice, Irp);
28 }
29 
30 
31 PVOID
32 GetUserBuffer(IN PIRP Irp)
33 {
34     ASSERT(Irp);
35 
36     if (Irp->MdlAddress)
37         return Irp->MdlAddress;
38     else
39         return Irp->AssociatedIrp.SystemBuffer;
40 }
41 
42 /* EOF */
43