Main Page | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

startio.c

Go to the documentation of this file.
00001 /*
00002  *  This program is free software; you can redistribute it and/or
00003  *  modify it under the terms of the GNU General Public License
00004  *  as published by the Free Software Foundation; either version
00005  *  2 of the License, or (at your option) any later version.
00006  *
00007  *  Copyright 2004 Spiro Trikaliotis
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     // get current stack location
00049 
00050     irpSp = IoGetCurrentIrpStackLocation(Irp);
00051 
00052     // get device extension
00053 
00054     pdx = Fdo->DeviceExtension;
00055 
00056     PERF_EVENT_STARTIO(Irp);
00057 
00058     // Execute the appropriate IRP
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             /* FALL THROUGH */
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 }

Generated on Sun Apr 30 18:45:59 2006 for opencbm by  doxygen 1.4.2