ReactOS 0.4.15-dev-8344-g0574987
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 }
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 {
59 ((PGREEN_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->ScreenFdo,
60 Irp);
61 }
67 {
69 return IoCallDriver(((PCOMMON_FDO_DEVICE_EXTENSION)DeviceObject->DeviceExtension)->LowerDevice, Irp);
70 }
72 return GreenPnp(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:
98 }
99 }
100
101 Irp->IoStatus.Information = Information;
102 Irp->IoStatus.Status = Status;
104 return Status;
105}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
LONG NTSTATUS
Definition: precomp.h:26
#define DPRINT1
Definition: precomp.h:8
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
_In_ PIRP Irp
Definition: csq.h:116
#define FALSE
Definition: types.h:117
struct _COMMON_DEVICE_EXTENSION * PCOMMON_DEVICE_EXTENSION
Status
Definition: gdiplustypes.h:25
GREEN_DEVICE_TYPE
Definition: green.h:22
@ KeyboardFDO
Definition: green.h:28
@ KeyboardPDO
Definition: green.h:25
@ ScreenPDO
Definition: green.h:24
@ GreenFDO
Definition: green.h:26
@ PassThroughFDO
Definition: green.h:29
@ ScreenFDO
Definition: green.h:27
NTSTATUS ScreenWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: screen.c:265
NTSTATUS KeyboardInternalDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: keyboard.c:272
NTSTATUS GreenPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: power.c:15
NTSTATUS GreenPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: pnp.c:408
NTSTATUS ScreenDeviceControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: screen.c:408
DeviceType
Definition: mmdrv.h:42
#define ASSERT(a)
Definition: mode.c:44
NTSTATUS GreenCreate(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: createclose.c:15
NTSTATUS GreenClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: createclose.c:28
#define IoSkipCurrentIrpStackLocation(Irp)
Definition: ntifs_ex.h:421
PVOID NTAPI IoGetDriverObjectExtension(IN PDRIVER_OBJECT DriverObject, IN PVOID ClientIdentificationAddress)
Definition: driver.c:1904
#define IoCompleteRequest
Definition: irp.c:1240
#define IoCallDriver
Definition: irp.c:1225
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_CREATE
Definition: rdpdr.c:44
#define DPRINT
Definition: sndvol32.h:73
uint32_t ULONG_PTR
Definition: typedefs.h:65
uint32_t ULONG
Definition: typedefs.h:59
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
_Must_inspect_result_ _In_ PDRIVER_OBJECT DriverObject
Definition: wdfdriver.h:213
_In_ WDFREQUEST _In_ NTSTATUS _In_ ULONG_PTR Information
Definition: wdfrequest.h:1049
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MJ_INTERNAL_DEVICE_CONTROL
#define IRP_MJ_POWER
#define IRP_MJ_CLEANUP

Referenced by DriverEntry().