ReactOS 0.4.15-dev-8241-g63935f8
dispatch.c File Reference
#include "classp.h"
Include dependency graph for dispatch.c:

Go to the source code of this file.

Functions

VOID ClassInitializeDispatchTables (PCLASS_DRIVER_EXTENSION DriverExtension)
 
NTSTATUS NTAPI ClassGlobalDispatch (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 
NTSTATUS NTAPI ClassDispatchUnimplemented (IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
 

Variables

DRIVER_DISPATCH ClassDispatchUnimplemented
 

Function Documentation

◆ ClassDispatchUnimplemented()

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

Definition at line 89 of file dispatch.c.

117{
119
120 //
121 // Simply store the appropriate status, complete the request, and return
122 // the same status stored in the packet.
123 //
124
127 }
128 Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
131}
static PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(PIRP Irp)
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define IoCompleteRequest
Definition: irp.c:1240
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:758
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
_In_ PDEVICE_OBJECT DeviceObject
Definition: wdfdevice.h:2055
_In_ UCHAR MajorFunction
Definition: wdfdevice.h:1697
#define IO_NO_INCREMENT
Definition: iotypes.h:598
#define IRP_MJ_POWER

◆ ClassGlobalDispatch()

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

Definition at line 73 of file dispatch.c.

78{
79 PCOMMON_DEVICE_EXTENSION commonExtension = DeviceObject->DeviceExtension;
81 // Code Analysis cannot analyze the code paths specific to clients.
83 return (commonExtension->DispatchTable[irpStack->MajorFunction])(DeviceObject, Irp);
84
85}
#define FALSE
Definition: types.h:117
#define _Analysis_assume_(expr)
Definition: ms_sal.h:2901
PDRIVER_DISPATCH * DispatchTable
Definition: classpnp.h:638

Referenced by _IRQL_requires_max_().

◆ ClassInitializeDispatchTables()

VOID ClassInitializeDispatchTables ( PCLASS_DRIVER_EXTENSION  DriverExtension)

Definition at line 38 of file dispatch.c.

41{
42 ULONG idx;
43
44 PAGED_CODE();
45
46 //
47 // Initialize the standard device dispatch table
48 //
49
50 for (idx = 0; idx <= IRP_MJ_MAXIMUM_FUNCTION; idx++) {
51 DriverExtension->DeviceMajorFunctionTable[idx] = ClassDispatchUnimplemented;
52 }
53
54 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_CREATE] = ClassCreateClose;
55 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_CLOSE] = ClassCreateClose;
56 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_READ] = ClassReadWrite;
57 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_WRITE] = ClassReadWrite;
59 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_SCSI] = ClassInternalIoControl;
60 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_SHUTDOWN] = ClassShutdownFlush;
61 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_FLUSH_BUFFERS] = ClassShutdownFlush;
62 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_PNP] = ClassDispatchPnp;
63 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_POWER] = ClassDispatchPower;
64 DriverExtension->DeviceMajorFunctionTable[IRP_MJ_SYSTEM_CONTROL] = ClassSystemControl;
65
66
67 return;
68}
#define PAGED_CODE()
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
NTSTATUS NTAPI ClassSystemControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: classwmi.c:221
unsigned int idx
Definition: utils.c:41
NTSTATUS NTAPI ClassInternalIoControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:9394
NTSTATUS NTAPI ClassReadWrite(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:2431
NTSTATUS NTAPI ClassDeviceControlDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: class.c:7258
NTSTATUS NTAPI ClassDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:894
NTSTATUS NTAPI ClassShutdownFlush(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:8773
NTSTATUS NTAPI ClassCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: create.c:57
DRIVER_DISPATCH ClassDispatchUnimplemented
Definition: dispatch.c:30
NTSTATUS NTAPI ClassDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: power.c:105
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:31
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
#define IRP_MJ_READ
Definition: rdpdr.c:46
#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
uint32_t ULONG
Definition: typedefs.h:59
#define IRP_MJ_SCSI
#define IRP_MJ_SYSTEM_CONTROL
#define IRP_MJ_FLUSH_BUFFERS
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_MAXIMUM_FUNCTION

Referenced by _IRQL_requires_max_().

Variable Documentation

◆ ClassDispatchUnimplemented

DRIVER_DISPATCH ClassDispatchUnimplemented

Definition at line 30 of file dispatch.c.

Referenced by ClassInitializeDispatchTables().