ReactOS  0.4.15-dev-1150-g593bcce
fdo.c
Go to the documentation of this file.
1 /*
2  * PROJECT: ReactOS ISA PnP Bus driver
3  * FILE: fdo.c
4  * PURPOSE: FDO-specific code
5  * PROGRAMMERS: Cameron Gutman (cameron.gutman@reactos.org)
6  * HervĂ© Poussineau
7  */
8 
9 #include <isapnp.h>
10 
11 #define NDEBUG
12 #include <debug.h>
13 
15 NTAPI
18  IN PIRP Irp,
20 {
23 
24  FdoExt->Common.State = dsStarted;
25 
26  return STATUS_SUCCESS;
27 }
28 
30 NTAPI
33  IN PIRP Irp,
35 {
36  if (IrpSp->Parameters.QueryDeviceRelations.Type != BusRelations)
37  return Irp->IoStatus.Status;
38 
39  return IsaPnpFillDeviceRelations(FdoExt, Irp, TRUE);
40 }
41 
43 NTAPI
46  IN PIRP Irp,
48 {
49  NTSTATUS Status = Irp->IoStatus.Status;
50 
51  switch (IrpSp->MinorFunction)
52  {
55 
56  if (NT_SUCCESS(Status))
57  Status = IsaFdoStartDevice(FdoExt, Irp, IrpSp);
58 
59  Irp->IoStatus.Status = Status;
60 
62  return Status;
63 
64  case IRP_MN_STOP_DEVICE:
65  FdoExt->Common.State = dsStopped;
66 
68  break;
69 
72 
73  Irp->IoStatus.Status = Status;
74 
76  return Status;
77 
79  DPRINT("IRP_MN_FILTER_RESOURCE_REQUIREMENTS\n");
80  break;
81 
82  default:
83  DPRINT1("Unknown PnP code: %x\n", IrpSp->MinorFunction);
84  break;
85  }
86 
88 
89  return IoCallDriver(FdoExt->Ldo, Irp);
90 }
NTSTATUS NTAPI IsaFdoQueryDeviceRelations(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:31
#define IN
Definition: typedefs.h:39
_In_ PIRP Irp
Definition: csq.h:116
#define TRUE
Definition: types.h:120
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IRP_MN_FILTER_RESOURCE_REQUIREMENTS
NTSTATUS NTAPI IsaPnpFillDeviceRelations(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN BOOLEAN IncludeDataPort)
Definition: isapnp.c:411
LONG NTSTATUS
Definition: precomp.h:26
NTSTATUS(* NTAPI)(IN PFILE_FULL_EA_INFORMATION EaBuffer, IN ULONG EaLength, OUT PULONG ErrorOffset)
Definition: IoEaTest.cpp:117
#define IoCompleteRequest
Definition: irp.c:1240
void DPRINT(...)
Definition: polytest.cpp:61
NTSTATUS NTAPI IsaForwardIrpSynchronous(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp)
Definition: isapnp.c:519
#define IRP_MN_STOP_DEVICE
#define NT_SUCCESS(StatCode)
Definition: apphelp.c:32
#define IRP_MN_START_DEVICE
Status
Definition: gdiplustypes.h:24
NTSTATUS NTAPI IsaFdoStartDevice(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:16
_In_ PIO_STACK_LOCATION IrpSp
Definition: create.c:4137
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IRP_MN_QUERY_DEVICE_RELATIONS
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
#define DPRINT1
Definition: precomp.h:8
#define IO_NO_INCREMENT
Definition: iotypes.h:581
struct _NAMED_PIPE_CREATE_PARAMETERS * Parameters
Definition: iotypes.h:3107
return STATUS_SUCCESS
Definition: btrfs.c:3014
NTSTATUS NTAPI IsaFdoPnp(IN PISAPNP_FDO_EXTENSION FdoExt, IN PIRP Irp, IN PIO_STACK_LOCATION IrpSp)
Definition: fdo.c:44