ReactOS  0.4.15-dev-1201-gb2cf5a4
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 
125  if ((IoGetCurrentIrpStackLocation(Irp))->MajorFunction == IRP_MJ_POWER) {
127  }
128  Irp->IoStatus.Status = STATUS_INVALID_DEVICE_REQUEST;
131 }
_In_ PIRP Irp
Definition: csq.h:116
#define UNREFERENCED_PARAMETER(P)
Definition: ntbasedef.h:317
#define STATUS_INVALID_DEVICE_REQUEST
Definition: udferr_usr.h:138
#define IoCompleteRequest
Definition: irp.c:1240
#define IRP_MJ_POWER
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
VOID NTAPI PoStartNextPowerIrp(IN PIRP Irp)
Definition: power.c:737
_In_ PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2464
#define IO_NO_INCREMENT
Definition: iotypes.h:581

◆ 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 }
_In_ PIRP Irp
Definition: csq.h:116
#define FALSE
Definition: types.h:117
__drv_aliasesMem FORCEINLINE PIO_STACK_LOCATION IoGetCurrentIrpStackLocation(_In_ PIRP Irp)
Definition: iofuncs.h:2789
_In_ PDEVICE_OBJECT DeviceObject
Definition: iotypes.h:2464
PDRIVER_DISPATCH * DispatchTable
Definition: classpnp.h:638
#define _Analysis_assume_(expr)
Definition: no_sal2.h:10

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 IRP_MJ_CREATE
Definition: rdpdr.c:44
NTSTATUS NTAPI ClassCreateClose(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: create.c:57
#define IRP_MJ_FLUSH_BUFFERS
#define IRP_MJ_SHUTDOWN
#define IRP_MJ_PNP
Definition: cdrw_usr.h:52
#define IRP_MJ_MAXIMUM_FUNCTION
DRIVER_DISPATCH ClassDispatchUnimplemented
Definition: dispatch.c:30
#define IRP_MJ_SCSI
unsigned int idx
Definition: utils.c:41
NTSTATUS NTAPI ClassShutdownFlush(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:8773
NTSTATUS NTAPI ClassDeviceControlDispatch(PDEVICE_OBJECT DeviceObject, PIRP Irp)
Definition: class.c:7258
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 ClassDispatchPower(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: power.c:105
#define IRP_MJ_POWER
#define IRP_MJ_CLOSE
Definition: rdpdr.c:45
PPCI_DRIVER_EXTENSION DriverExtension
Definition: pci.c:41
#define IRP_MJ_SYSTEM_CONTROL
NTSTATUS NTAPI ClassDispatchPnp(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: class.c:894
#define IRP_MJ_READ
Definition: rdpdr.c:46
NTSTATUS NTAPI ClassSystemControl(IN PDEVICE_OBJECT DeviceObject, IN PIRP Irp)
Definition: classwmi.c:221
unsigned int ULONG
Definition: retypes.h:1
#define IRP_MJ_WRITE
Definition: rdpdr.c:47
#define IRP_MJ_DEVICE_CONTROL
Definition: rdpdr.c:52
#define PAGED_CODE()

Referenced by _IRQL_requires_max_().

Variable Documentation

◆ ClassDispatchUnimplemented

DRIVER_DISPATCH ClassDispatchUnimplemented

Definition at line 30 of file dispatch.c.

Referenced by ClassInitializeDispatchTables().