ReactOS  0.4.15-dev-3324-gda4e15f
dispatch.c File Reference
#include "green.h"
#include <debug.h>
Include dependency graph for dispatch.c:

Go to the source code of this file.

Macros

#define NDEBUG
 

Functions

NTSTATUS NTAPI GreenDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Macro Definition Documentation

◆ NDEBUG

#define NDEBUG

Definition at line 11 of file dispatch.c.

Function Documentation

◆ GreenDispatch()

NTSTATUS NTAPI GreenDispatch ( IN PDEVICE_OBJECT  DeviceObject,
IN PIRP  Irp 
)

Definition at line 15 of file dispatch.c.

18 {
23 
25  DeviceType = ((PCOMMON_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->Type;
26 
27  Information = Irp->IoStatus.Information;
28  Status = Irp->IoStatus.Status;
29 
30  DPRINT("Dispatching major function 0x%lx, DeviceType %u\n",
32 
34  {
36  return IoCallDriver(((PCOMMON_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice, Irp);
37  }
39  return GreenCreate(DeviceObject, Irp);
41  return GreenClose(DeviceObject, Irp);
44  {
46  return IoCallDriver(((PCOMMON_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice, Irp);
47  }
49  {
51  ((PGREEN_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->KeyboardFdo,
52  Irp);
53  }
57  {
58  return ScreenDeviceControl(
59  ((PGREEN_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->ScreenFdo,
60  Irp);
61  }
65  return ScreenWrite(DeviceObject, Irp);
67  {
69  return IoCallDriver(((PCOMMON_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice, Irp);
70  }
72  return GreenPnp(DeviceObject, Irp);
74  return GreenPower(DeviceObject, Irp);
75  else
76  {
77  DPRINT1("Unknown combination: MajorFunction 0x%lx, DeviceType %d\n",
79  switch (DeviceType)
80  {
81  case KeyboardFDO:
82  case ScreenFDO:
83  {
85  return IoCallDriver(((PCOMMON_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice, Irp);
86  }
87  case GreenFDO:
88  {
91  DriverObject = DeviceObject->DriverObject;
94  return IoCallDriver(DriverExtension->LowerDevice, Irp);
95  }
96  default:
97  ASSERT(FALSE);
98  }
99  }
100 
101  Irp->IoStatus.Information = Information;
102  Irp->IoStatus.Status = Status;
104  return Status;
105 }
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
LONG NTSTATUS
Definition: precomp.h:26
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1044
uint32_t ULONG_PTR
Definition: typedefs.h:65
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
#define FALSE
Definition: types.h:117
_In_ PIRP Irp
Definition: csq.h:116
#define IoCompleteRequest
Definition: irp.c:1240
DeviceType
Definition: mmdrv.h:41
NTSTATUS GreenClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: createclose.c:28
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
Status
Definition: gdiplustypes.h:24
#define ASSERT(a)
Definition: mode.c:44
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
Definition: green.h:26
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
NTSTATUS ScreenWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: screen.c:265
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1877
NTSTATUS ScreenDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: screen.c:408
NTSTATUS GreenPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: power.c:15
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2793
GREEN_DEVICE_TYPE
Definition: green.h:21
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
NTSTATUS KeyboardInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: keyboard.c:272
NTSTATUS GreenPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pnp.c:408
NTSTATUS NTAPI IoCallDriver(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: irp.c:1218
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
NTSTATUS GreenCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: createclose.c:15
#define DPRINT1
Definition: precomp.h:8
#define IRP_MJ_CLEANUP
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
unsigned int ULONG
Definition: retypes.h:1
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define DPRINT
Definition: sndvol32.h:71
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52

Referenced by DriverEntry().