00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00020 #include <wdm.h>
00021 #include "cbm_driver.h"
00022
00039 NTSTATUS
00040 cbm_startio(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
00041 {
00042 PIO_STACK_LOCATION irpSp;
00043 PDEVICE_EXTENSION pdx;
00044 NTSTATUS ntStatus;
00045
00046 FUNC_ENTER();
00047
00048
00049
00050 irpSp = IoGetCurrentIrpStackLocation(Irp);
00051
00052
00053
00054 pdx = Fdo->DeviceExtension;
00055
00056 PERF_EVENT_STARTIO(Irp);
00057
00058
00059
00060 switch (irpSp->MajorFunction)
00061 {
00062 case IRP_MJ_CREATE:
00063 ntStatus = cbm_execute_createopen(pdx, Irp);
00064 break;
00065
00066 case IRP_MJ_CLOSE:
00067 ntStatus = cbm_execute_close(pdx, Irp);
00068 break;
00069
00070 case IRP_MJ_READ:
00071
00072
00073 case IRP_MJ_WRITE:
00074 ntStatus = cbm_execute_readwrite(pdx, Irp);
00075 break;
00076
00077 case IRP_MJ_DEVICE_CONTROL:
00078 ntStatus = cbm_execute_devicecontrol(pdx, Irp);
00079 break;
00080
00081 default:
00082 DBG_ERROR((DBG_PREFIX "THIS SHOULD NOT HAPPEN: UNKNOWN MAJORFUNCTION %08x",
00083 irpSp->MajorFunction));
00084 DBG_ASSERT(1==0);
00085 ntStatus = STATUS_NOT_SUPPORTED;
00086 }
00087
00088 FUNC_LEAVE_NTSTATUS(ntStatus);
00089 }