35 cbm_checkbuffer(IN PIO_STACK_LOCATION IrpSp)
45 DBG_ASSERT(&IrpSp->Parameters.Read.ByteOffset == &IrpSp->Parameters.Write.ByteOffset);
47 if ((IrpSp->Parameters.Write.ByteOffset.HighPart != 0) ||
48 (IrpSp->Parameters.Write.ByteOffset.LowPart != 0))
50 ntStatus = STATUS_INVALID_PARAMETER;
54 ntStatus = STATUS_SUCCESS;
56 FUNC_LEAVE_NTSTATUS(ntStatus);
86 PIO_STACK_LOCATION irpSp;
87 PDEVICE_EXTENSION pdx;
89 ULONG readWriteBytesProcessed;
90 ULONG readWriteLength;
91 PUCHAR readWriteBuffer;
97 pdx = Fdo->DeviceExtension;
101 irpSp = IoGetCurrentIrpStackLocation(Irp);
105 ntStatus = cbm_checkbuffer(irpSp);
115 if (NT_SUCCESS(ntStatus))
121 DBG_ASSERT(&irpSp->Parameters.Read.Length == &irpSp->Parameters.Write.Length);
125 readWriteLength = irpSp->Parameters.Read.Length;
129 if (irpSp->MajorFunction == IRP_MJ_READ)
141 if (readWriteLength != 0)
149 if (!NT_SUCCESS(ntStatus) || readWriteLength == 0)
157 FUNC_LEAVE_NTSTATUS(ntStatus);
180 PIO_STACK_LOCATION irpSp;
182 ULONG readWriteBytesProcessed;
183 ULONG readWriteLength;
184 PUCHAR readWriteBuffer;
190 irpSp = IoGetCurrentIrpStackLocation(Irp);
196 DBG_ASSERT(&irpSp->Parameters.Read.Length == &irpSp->Parameters.Write.Length);
200 readWriteLength = irpSp->Parameters.Read.Length;
205 readWriteBuffer = Irp->AssociatedIrp.SystemBuffer;
209 if (irpSp->MajorFunction == IRP_MJ_READ)
226 if (readWriteLength != 0)
230 switch (irpSp->MajorFunction)
234 &readWriteBytesProcessed);
239 &readWriteBytesProcessed);
244 ntStatus = STATUS_INTERNAL_ERROR;
245 readWriteBytesProcessed = 0;
259 if (ntStatus != STATUS_PENDING)
264 FUNC_LEAVE_NTSTATUS(ntStatus);
NTSTATUS cbm_readwrite(IN PDEVICE_OBJECT Fdo, IN PIRP Irp)
Services reads from or writes to the driver.
#define DBG_IRPPATH_PROCESS(_Where_)
Debug IRPPATH: Processing of the IRP.
Definitions for the libiec library.
NTSTATUS QueueStartPacket(PQUEUE Queue, PIRP Irp, BOOLEAN FastStart, PDEVICE_OBJECT Fdo)
Insert an IRP into a QUEUE object.
#define PERF_EVENT_WRITE_QUEUE(_x_)
NTSTATUS cbmiec_raw_write(IN PDEVICE_EXTENSION Pdx, IN const PUCHAR Buffer, IN ULONG BufferLength, OUT ULONG *Written)
Write some bytes to the IEC bus.
NTSTATUS cbmiec_raw_read(IN PDEVICE_EXTENSION Pdx, OUT PUCHAR Buffer, IN ULONG BufferLength, OUT ULONG *Read)
Read some bytes from the IEC bus.
#define PERF_EVENT_WRITE_EXECUTE(_x_)
NTSTATUS cbm_execute_readwrite(IN PDEVICE_EXTENSION Pdx, IN PIRP Irp)
Executes reads from or writes to the driver.
Definitions for the opencbm driver.
#define DBG_IRPPATH_EXECUTE(_Where_)
Debug IRPPATH: Executing of the IRP.
#define PERF_EVENT_READ_EXECUTE(_x_)
#define PERF_EVENT_READ_QUEUE(_x_)
NTSTATUS QueueCompleteIrp(PQUEUE Queue, PIRP Irp, NTSTATUS StatusCode, ULONG_PTR Information)
Complete an IRP which is on a QUEUE.