Update of /cvsroot/com0com/com0com
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8116
Modified Files:
io.c com0com.h initunlo.c startirp.c write.c
Log Message:
Implemented IRP_MJ_FLUSH_BUFFERS
Index: startirp.c
===================================================================
RCS file: /cvsroot/com0com/com0com/startirp.c,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** startirp.c 6 Sep 2005 07:23:44 -0000 1.4
--- startirp.c 13 Sep 2005 14:56:16 -0000 1.5
***************
*** 20,23 ****
--- 20,26 ----
*
* $Log$
+ * Revision 1.5 2005/09/13 14:56:16 vfrolov
+ * Implemented IRP_MJ_FLUSH_BUFFERS
+ *
* Revision 1.4 2005/09/06 07:23:44 vfrolov
* Implemented overrun emulation
***************
*** 56,59 ****
--- 59,64 ----
}
break;
+ case IRP_MJ_FLUSH_BUFFERS:
+ return (PC0C_IRP_STATE)&pIrpStack->Parameters.Others.Argument1;
}
Index: io.c
===================================================================
RCS file: /cvsroot/com0com/com0com/io.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** io.c 13 Sep 2005 08:55:41 -0000 1.13
--- io.c 13 Sep 2005 14:56:16 -0000 1.14
***************
*** 20,23 ****
--- 20,26 ----
*
* $Log$
+ * Revision 1.14 2005/09/13 14:56:16 vfrolov
+ * Implemented IRP_MJ_FLUSH_BUFFERS
+ *
* Revision 1.13 2005/09/13 08:55:41 vfrolov
* Disabled modem status tracing by default
***************
*** 487,511 ****
statusWrite = STATUS_PENDING;
-
doneWrite = 0;
! if (statusRead == STATUS_PENDING)
! ReadWriteDirect(
! pIrpRead, pIrpWrite,
! &statusRead, &statusWrite,
! pIoPortRead,
! pQueueToComplete,
! pWriteLimit,
! &doneRead, &doneWrite);
! if (statusWrite == STATUS_PENDING) {
! statusWrite = WriteBuffer(pIrpWrite, pIoPortRead, pQueueToComplete, pWriteLimit, &doneWrite);
! if (pIoPortRead->emuOverrun && !pIrpRead && statusWrite == STATUS_PENDING)
! statusWrite = WriteOverrun(pIrpWrite, pIoPortRead, pQueueToComplete, pWriteLimit, &doneWrite);
! }
! if (pWriteDelay)
! pWriteDelay->sentFrames += doneWrite;
if (startWrite) {
--- 490,518 ----
statusWrite = STATUS_PENDING;
doneWrite = 0;
! if (IoGetCurrentIrpStackLocation(pIrpWrite)->MajorFunction == IRP_MJ_FLUSH_BUFFERS) {
! pIrpWrite->IoStatus.Information = 0;
! statusWrite = STATUS_SUCCESS;
! } else {
! if (statusRead == STATUS_PENDING)
! ReadWriteDirect(
! pIrpRead, pIrpWrite,
! &statusRead, &statusWrite,
! pIoPortRead,
! pQueueToComplete,
! pWriteLimit,
! &doneRead, &doneWrite);
! if (statusWrite == STATUS_PENDING) {
! statusWrite = WriteBuffer(pIrpWrite, pIoPortRead, pQueueToComplete, pWriteLimit, &doneWrite);
! if (pIoPortRead->emuOverrun && !pIrpRead && statusWrite == STATUS_PENDING)
! statusWrite = WriteOverrun(pIrpWrite, pIoPortRead, pQueueToComplete, pWriteLimit, &doneWrite);
! }
! if (pWriteDelay)
! pWriteDelay->sentFrames += doneWrite;
! }
if (startWrite) {
Index: initunlo.c
===================================================================
RCS file: /cvsroot/com0com/com0com/initunlo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** initunlo.c 13 Jul 2005 16:12:36 -0000 1.3
--- initunlo.c 13 Sep 2005 14:56:16 -0000 1.4
***************
*** 20,23 ****
--- 20,26 ----
*
* $Log$
+ * Revision 1.4 2005/09/13 14:56:16 vfrolov
+ * Implemented IRP_MJ_FLUSH_BUFFERS
+ *
* Revision 1.3 2005/07/13 16:12:36 vfrolov
* Added c0cGlobal struct for global driver's data
***************
*** 61,65 ****
pDrvObj->MajorFunction[IRP_MJ_CLOSE] = c0cClose;
pDrvObj->MajorFunction[IRP_MJ_CLEANUP] = c0cCleanup;
! pDrvObj->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = c0cFlush;
pDrvObj->MajorFunction[IRP_MJ_WRITE] = c0cWrite;
pDrvObj->MajorFunction[IRP_MJ_READ] = c0cRead;
--- 64,68 ----
pDrvObj->MajorFunction[IRP_MJ_CLOSE] = c0cClose;
pDrvObj->MajorFunction[IRP_MJ_CLEANUP] = c0cCleanup;
! pDrvObj->MajorFunction[IRP_MJ_FLUSH_BUFFERS] = c0cWrite;
pDrvObj->MajorFunction[IRP_MJ_WRITE] = c0cWrite;
pDrvObj->MajorFunction[IRP_MJ_READ] = c0cRead;
***************
*** 84,104 ****
}
- NTSTATUS c0cFlush(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp)
- {
- NTSTATUS status;
-
- UNREFERENCED_PARAMETER(pDevObj);
-
- status = STATUS_INVALID_DEVICE_REQUEST;
-
- TraceIrp("c0cFlush", pIrp, &status, TRACE_FLAG_PARAMS);
-
- pIrp->IoStatus.Information = 0;
- pIrp->IoStatus.Status = status;
- IoCompleteRequest(pIrp, IO_NO_INCREMENT);
-
- return status;
- }
-
NTSTATUS c0cInternalIoControl(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp)
{
--- 87,90 ----
Index: com0com.h
===================================================================
RCS file: /cvsroot/com0com/com0com/com0com.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -C2 -d -r1.12 -r1.13
*** com0com.h 6 Sep 2005 07:23:44 -0000 1.12
--- com0com.h 13 Sep 2005 14:56:16 -0000 1.13
***************
*** 20,23 ****
--- 20,26 ----
*
* $Log$
+ * Revision 1.13 2005/09/13 14:56:16 vfrolov
+ * Implemented IRP_MJ_FLUSH_BUFFERS
+ *
* Revision 1.12 2005/09/06 07:23:44 vfrolov
* Implemented overrun emulation
***************
*** 228,232 ****
DeclareMajorFunction(c0cOpen);
DeclareMajorFunction(c0cClose);
- DeclareMajorFunction(c0cFlush);
DeclareMajorFunction(c0cWrite);
DeclareMajorFunction(c0cRead);
--- 231,234 ----
Index: write.c
===================================================================
RCS file: /cvsroot/com0com/com0com/write.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** write.c 6 Sep 2005 07:23:44 -0000 1.3
--- write.c 13 Sep 2005 14:56:16 -0000 1.4
***************
*** 20,23 ****
--- 20,26 ----
*
* $Log$
+ * Revision 1.4 2005/09/13 14:56:16 vfrolov
+ * Implemented IRP_MJ_FLUSH_BUFFERS
+ *
* Revision 1.3 2005/09/06 07:23:44 vfrolov
* Implemented overrun emulation
***************
*** 56,60 ****
status = STATUS_CANCELLED;
} else {
! if (IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length)
status = FdoPortStartIrp(pDevExt, pIrp, C0C_QUEUE_WRITE, StartIrpWrite);
else
--- 59,64 ----
status = STATUS_CANCELLED;
} else {
! if (IoGetCurrentIrpStackLocation(pIrp)->MajorFunction == IRP_MJ_FLUSH_BUFFERS ||
! IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length)
status = FdoPortStartIrp(pDevExt, pIrp, C0C_QUEUE_WRITE, StartIrpWrite);
else
|