com0com-cvs Mailing List for Null-modem emulator (Page 38)
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
You can subscribe to this list here.
2005 |
Jan
|
Feb
(7) |
Mar
|
Apr
|
May
(13) |
Jun
(18) |
Jul
(9) |
Aug
(10) |
Sep
(15) |
Oct
(6) |
Nov
(9) |
Dec
(6) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(6) |
Feb
(4) |
Mar
(4) |
Apr
(2) |
May
(7) |
Jun
(11) |
Jul
(6) |
Aug
(9) |
Sep
(1) |
Oct
(27) |
Nov
(22) |
Dec
(3) |
2007 |
Jan
(13) |
Feb
(16) |
Mar
(2) |
Apr
(3) |
May
(7) |
Jun
(17) |
Jul
(9) |
Aug
(1) |
Sep
(13) |
Oct
(20) |
Nov
(18) |
Dec
(1) |
2008 |
Jan
|
Feb
(3) |
Mar
(46) |
Apr
(40) |
May
(4) |
Jun
(9) |
Jul
(7) |
Aug
(62) |
Sep
(25) |
Oct
(51) |
Nov
(67) |
Dec
(81) |
2009 |
Jan
(13) |
Feb
(31) |
Mar
(12) |
Apr
|
May
(10) |
Jun
|
Jul
(5) |
Aug
(2) |
Sep
(10) |
Oct
|
Nov
(3) |
Dec
(1) |
2010 |
Jan
|
Feb
(1) |
Mar
(4) |
Apr
|
May
(12) |
Jun
(9) |
Jul
(12) |
Aug
(7) |
Sep
(6) |
Oct
|
Nov
|
Dec
(1) |
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(11) |
Jun
|
Jul
(26) |
Aug
|
Sep
|
Oct
|
Nov
(2) |
Dec
(23) |
2012 |
Jan
(7) |
Feb
(3) |
Mar
|
Apr
|
May
(2) |
Jun
(9) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: Vyacheslav F. <vf...@us...> - 2005-02-28 12:10:19
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14743 Modified Files: trace.c Log Message: Log skipped lines to trace file (was to syslog) Fixed missing trace file close Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/trace.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** trace.c 1 Feb 2005 16:39:35 -0000 1.2 --- trace.c 28 Feb 2005 12:10:08 -0000 1.3 *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.3 2005/02/28 12:10:08 vfrolov + * Log skipped lines to trace file (was to syslog) + * Fixed missing trace file close + * * Revision 1.2 2005/02/01 16:39:35 vfrolov * Added AnsiStrCopyCommStatus() *************** *** 59,62 **** --- 63,67 ---- static KSPIN_LOCK bufsLock; static TRACE_BUFFER traceBufs[TRACE_BUFS_NUM]; + static LONG skippedTraces; /********************************************************************/ #define TRACE_FILE_OK (traceFileName.Buffer != NULL) *************** *** 190,194 **** if (!pBuf) ! SysLog(pDrvObj, STATUS_INSUFFICIENT_RESOURCES, L"AllocTraceBuf traceBufs busy"); return pBuf; --- 195,199 ---- if (!pBuf) ! InterlockedIncrement(&skippedTraces); return pBuf; *************** *** 638,642 **** (long)pCommStatus->AmountInInQueue); } - /********************************************************************/ --- 643,646 ---- *************** *** 676,689 **** (unsigned)pTimeFields->Milliseconds); } NTSTATUS TraceWrite( IN PVOID pIoObject, IN HANDLE handle, ! IN PCHAR pStr, ! IN USHORT len) { NTSTATUS status; IO_STATUS_BLOCK ioStatusBlock; status = ZwWriteFile( handle, --- 680,696 ---- (unsigned)pTimeFields->Milliseconds); } + /********************************************************************/ NTSTATUS TraceWrite( IN PVOID pIoObject, IN HANDLE handle, ! IN PCHAR pStr) { NTSTATUS status; + ANSI_STRING str; IO_STATUS_BLOCK ioStatusBlock; + RtlInitAnsiString(&str, pStr); + status = ZwWriteFile( handle, *************** *** 692,697 **** NULL, &ioStatusBlock, ! pStr, ! len, NULL, NULL); --- 699,704 ---- NULL, &ioStatusBlock, ! str.Buffer, ! str.Length, NULL, NULL); *************** *** 770,813 **** if (NT_SUCCESS(status)) { PTRACE_BUFFER pBuf; - ANSI_STRING str; - PCHAR pDestStr; - SIZE_T size; pBuf = AllocTraceBuf(); - if (!pBuf) - return; - size = TRACE_BUF_SIZE; - pDestStr = pBuf->buf; ! while (InterlockedExchangeAdd(&strOldFreeInd, 0)) { ! SIZE_T lenBuf; ! KIRQL oldIrql; ! KeAcquireSpinLock(&strOldLock, &oldIrql); ! lenBuf = strOldFreeInd - strOldBusyInd; ! if (lenBuf) { ! if (lenBuf > size - 1) ! lenBuf = size - 1; ! RtlCopyMemory(pDestStr, &strOld[strOldBusyInd], lenBuf); ! pDestStr[lenBuf] = 0; ! strOldBusyInd += lenBuf; ! ASSERT(strOldBusyInd <= strOldFreeInd); ! if (strOldBusyInd == strOldFreeInd) ! InterlockedExchange(&strOldFreeInd, strOldBusyInd = 0); } - KeReleaseSpinLock(&strOldLock, oldIrql); ! if (lenBuf) { ! RtlInitAnsiString(&str, pBuf->buf); ! TraceWrite(pIoObject, handle, str.Buffer, str.Length); } - } ! pDestStr = AnsiStrCopyTimeFields(pDestStr, &size, &timeFields); ! pDestStr = AnsiStrFormat(pDestStr, &size, " %s\r\n", pStr); ! RtlInitAnsiString(&str, pBuf->buf); ! TraceWrite(pIoObject, handle, str.Buffer, str.Length); ! FreeTraceBuf(pBuf); status = ZwClose(handle); --- 777,829 ---- if (NT_SUCCESS(status)) { PTRACE_BUFFER pBuf; pBuf = AllocTraceBuf(); ! if (pBuf) { ! PCHAR pDestStr; ! SIZE_T size; ! LONG skipped; ! size = TRACE_BUF_SIZE; ! pDestStr = pBuf->buf; ! ! while (InterlockedExchangeAdd(&strOldFreeInd, 0)) { ! SIZE_T lenBuf; ! KIRQL oldIrql; ! ! KeAcquireSpinLock(&strOldLock, &oldIrql); ! lenBuf = strOldFreeInd - strOldBusyInd; ! if (lenBuf) { ! if (lenBuf > size - 1) ! lenBuf = size - 1; ! RtlCopyMemory(pDestStr, &strOld[strOldBusyInd], lenBuf); ! pDestStr[lenBuf] = 0; ! strOldBusyInd += lenBuf; ! ASSERT(strOldBusyInd <= strOldFreeInd); ! if (strOldBusyInd == strOldFreeInd) ! InterlockedExchange(&strOldFreeInd, strOldBusyInd = 0); ! } ! KeReleaseSpinLock(&strOldLock, oldIrql); ! ! if (lenBuf) ! TraceWrite(pIoObject, handle, pBuf->buf); } ! skipped = InterlockedExchange(&skippedTraces, 0); ! ! if (skipped) { ! SIZE_T tmp_size = size; ! ! AnsiStrFormat(pDestStr, &tmp_size, "*** skipped %lu lines ***\r\n", skipped); ! TraceWrite(pIoObject, handle, pBuf->buf); } ! pDestStr = AnsiStrCopyTimeFields(pDestStr, &size, &timeFields); ! pDestStr = AnsiStrFormat(pDestStr, &size, " %s\r\n", pStr); ! TraceWrite(pIoObject, handle, pBuf->buf); ! ! FreeTraceBuf(pBuf); ! } status = ZwClose(handle); *************** *** 858,861 **** --- 874,878 ---- KeInitializeSpinLock(&strOldLock); KeInitializeSpinLock(&bufsLock); + skippedTraces = 0; RtlZeroMemory(traceBufs, sizeof(traceBufs)); |
From: Vyacheslav F. <vf...@us...> - 2005-02-04 10:58:47
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24514 Modified Files: ReadMe.txt Log Message: Fixed wrong characters Index: ReadMe.txt =================================================================== RCS file: /cvsroot/com0com/com0com/ReadMe.txt,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ReadMe.txt 4 Feb 2005 10:47:34 -0000 1.1 --- ReadMe.txt 4 Feb 2005 10:58:37 -0000 1.2 *************** *** 35,44 **** 5. For the first time (if the driver is not installed yet): 1. Select "Other Devices" and then click Next. ! 2. Click Have Disk. 3. Enter path to the directory with com0com.inf and com0com.sys files and then click OK. For the next time (adding one more port pair) select "com0com - serial port emulators" and then click Next. ! 6. Select com0com - bus for serial port pair emulator and then click Next. --- 35,44 ---- 5. For the first time (if the driver is not installed yet): 1. Select "Other Devices" and then click Next. ! 2. Click "Have Disk". 3. Enter path to the directory with com0com.inf and com0com.sys files and then click OK. For the next time (adding one more port pair) select "com0com - serial port emulators" and then click Next. ! 6. Select "com0com - bus for serial port pair emulator" and then click Next. |
From: Vyacheslav F. <vf...@us...> - 2005-02-04 10:47:43
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22485 Added Files: ReadMe.txt Log Message: Initial revision --- NEW FILE: ReadMe.txt --- ============================= Null-modem emulator (com0com) ============================= INTRODUCTION The null-modem emulator is a kernel-mode serial driver for Windows. You can create an unlimited number of virtual COM port pairs and use any pair to connect one application to another. Each COM port pair provides two COM ports with names starting at CNCA0 and CNCB0. The output to one port is the input from other port and vice versa. Usually one port of the pair is used by Windows application that requires a COM port to communicate with a device and other port is used by device emulation program. For example, to send/receive faxes over IP you can connect Windows Fax application to CNCA0 port and t38modem (part of the OpenH323 project) to CNCB0 port. BUILDING 1. Set up the DDK environment on your machine. 2. Run the build -wcZ command in the com0com directory to build com0com.sys. 3. Copy com0com.inf and com0com.sys files to a temporary directory. INSTALLING 1. Start the "Add/Remove Hardware" wizard in Control Panel. 2. Click "Add/Troubleshoot a Device". 3. Select "Add a new device" and then click Next. 4. Select "No, I Want to Select the Hardware from a list". 5. For the first time (if the driver is not installed yet): 1. Select "Other Devices" and then click Next. 2. Click Have Disk. 3. Enter path to the directory with com0com.inf and com0com.sys files and then click OK. For the next time (adding one more port pair) select "com0com - serial port emulators" and then click Next. 6. Select com0com - bus for serial port pair emulator and then click Next. The system will create 3 new virtual devices. One of the devices has name "com0com - bus for serial port pair emulator" and other two of them have name "com0com - serial port emulator" and located on CNCA0 and CNCB0 ports (or CNCA1 and CNCB1 or ...). TESTING 1. Start the HyperTerminal on CNCA0 port. 2. Start the HyperTerminal on CNCB0 port. 3. The output to CNCA0 port should be the input from CNCB0 port and vice versa. |
From: Vyacheslav F. <vf...@us...> - 2005-02-01 16:52:04
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17021 Modified Files: openclos.c Log Message: Used C0C_BUFFER_PURGE() Index: openclos.c =================================================================== RCS file: /cvsroot/com0com/com0com/openclos.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** openclos.c 1 Feb 2005 08:37:55 -0000 1.2 --- openclos.c 1 Feb 2005 16:51:51 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/02/01 16:51:51 vfrolov + * Used C0C_BUFFER_PURGE() + * * Revision 1.2 2005/02/01 08:37:55 vfrolov * Changed SetModemStatus() to set multiple bits *************** *** 64,70 **** } - readBufNew.pFree = readBufNew.pBusy = readBufNew.pBase; readBufNew.pEnd = readBufNew.pBase + size; ! readBufNew.busy = 0; InitializeListHead(&queueToComplete); --- 67,73 ---- } readBufNew.pEnd = readBufNew.pBase + size; ! ! C0C_BUFFER_PURGE(readBufNew); InitializeListHead(&queueToComplete); |
From: Vyacheslav F. <vf...@us...> - 2005-02-01 16:48:15
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15935 Modified Files: ioctl.c com0com.h Log Message: Implemented SERIAL_PURGE_RXCLEAR and IOCTL_SERIAL_GET_COMMSTATUS Index: ioctl.c =================================================================== RCS file: /cvsroot/com0com/com0com/ioctl.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** ioctl.c 26 Jan 2005 12:18:54 -0000 1.1 --- ioctl.c 1 Feb 2005 16:47:57 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2005/02/01 16:47:57 vfrolov + * Implemented SERIAL_PURGE_RXCLEAR and IOCTL_SERIAL_GET_COMMSTATUS + * * Revision 1.1 2005/01/26 12:18:54 vfrolov * Initial revision *************** *** 141,148 **** FdoPortCancelQueue(pDevExt, &pDevExt->pIoPortLocal->irpQueues[C0C_QUEUE_WRITE]); pIrp->IoStatus.Information = sizeof(ULONG); break; } ! case IOCTL_SERIAL_GET_COMMSTATUS: if (pIrpStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(SERIAL_STATUS)) { status = STATUS_BUFFER_TOO_SMALL; --- 144,159 ---- FdoPortCancelQueue(pDevExt, &pDevExt->pIoPortLocal->irpQueues[C0C_QUEUE_WRITE]); + if (*pSysBuf & SERIAL_PURGE_RXCLEAR) { + KeAcquireSpinLock(pDevExt->pIoLock, &oldIrql); + C0C_BUFFER_PURGE(pDevExt->pIoPortLocal->readBuf); + KeReleaseSpinLock(pDevExt->pIoLock, oldIrql); + } + pIrp->IoStatus.Information = sizeof(ULONG); break; } ! case IOCTL_SERIAL_GET_COMMSTATUS: { ! PSERIAL_STATUS pSysBuf; ! if (pIrpStack->Parameters.DeviceIoControl.OutputBufferLength < sizeof(SERIAL_STATUS)) { status = STATUS_BUFFER_TOO_SMALL; *************** *** 150,158 **** } ! KeAcquireSpinLock(&pDevExt->controlLock, &oldIrql); ! *(PSERIAL_STATUS)pIrp->AssociatedIrp.SystemBuffer = pDevExt->commStatus; ! KeReleaseSpinLock(&pDevExt->controlLock, oldIrql); pIrp->IoStatus.Information = sizeof(SERIAL_STATUS); break; case IOCTL_SERIAL_SET_HANDFLOW: { LIST_ENTRY queueToComplete; --- 161,176 ---- } ! pSysBuf = (PSERIAL_STATUS)pIrp->AssociatedIrp.SystemBuffer; ! ! KeAcquireSpinLock(pDevExt->pIoLock, &oldIrql); ! RtlZeroMemory(pSysBuf, sizeof(*pSysBuf)); ! pSysBuf->AmountInInQueue = pDevExt->pIoPortLocal->readBuf.busy; ! KeReleaseSpinLock(pDevExt->pIoLock, oldIrql); pIrp->IoStatus.Information = sizeof(SERIAL_STATUS); + + TraceIrp("FdoPortIoCtl", pIrp, &status, TRACE_FLAG_RESULTS); + break; + } case IOCTL_SERIAL_SET_HANDFLOW: { LIST_ENTRY queueToComplete; Index: com0com.h =================================================================== RCS file: /cvsroot/com0com/com0com/com0com.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** com0com.h 1 Feb 2005 08:37:55 -0000 1.2 --- com0com.h 1 Feb 2005 16:47:57 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/02/01 16:47:57 vfrolov + * Implemented SERIAL_PURGE_RXCLEAR and IOCTL_SERIAL_GET_COMMSTATUS + * * Revision 1.2 2005/02/01 08:37:55 vfrolov * Changed SetModemStatus() to set multiple bits *************** *** 79,82 **** --- 82,89 ---- } C0C_BUFFER, *PC0C_BUFFER; + #define C0C_BUFFER_PURGE(buf) \ + (buf).pFree = (buf).pBusy = (buf).pBase; \ + (buf).busy = 0 + struct _C0C_FDOPORT_EXTENSION; *************** *** 142,146 **** SERIAL_BAUD_RATE baudRate; SERIAL_LINE_CONTROL lineControl; - SERIAL_STATUS commStatus; SERIAL_CHARS specialChars; SERIAL_TIMEOUTS timeouts; --- 149,152 ---- |
From: Vyacheslav F. <vf...@us...> - 2005-02-01 16:39:48
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13963 Modified Files: trace.c Log Message: Added AnsiStrCopyCommStatus() Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/trace.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** trace.c 26 Jan 2005 12:18:54 -0000 1.1 --- trace.c 1 Feb 2005 16:39:35 -0000 1.2 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2005/02/01 16:39:35 vfrolov + * Added AnsiStrCopyCommStatus() + * * Revision 1.1 2005/01/26 12:18:54 vfrolov * Initial revision *************** *** 625,628 **** --- 628,642 ---- (long)pQueueSize->InSize, (long)pQueueSize->OutSize); } + + PCHAR AnsiStrCopyCommStatus( + PCHAR pDestStr, + PSIZE_T pSize, + IN PSERIAL_STATUS pCommStatus) + { + return AnsiStrFormat(pDestStr, pSize, + " AmountInInQueue=%lu", + (long)pCommStatus->AmountInInQueue); + } + /********************************************************************/ *************** *** 1138,1141 **** --- 1152,1159 ---- pDestStr = AnsiStrCopyQueueSize(pDestStr, &size, (PSERIAL_QUEUE_SIZE)pSysBuf); break; + case IOCTL_SERIAL_GET_COMMSTATUS: + if ((flags & TRACE_FLAG_RESULTS) && inform >= sizeof(SERIAL_STATUS)) + pDestStr = AnsiStrCopyCommStatus(pDestStr, &size, (PSERIAL_STATUS)pSysBuf); + break; } break; |
From: Vyacheslav F. <vf...@us...> - 2005-02-01 09:09:37
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3179 Modified Files: com0com.rc Log Message: Added version info Index: com0com.rc =================================================================== RCS file: /cvsroot/com0com/com0com/com0com.rc,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** com0com.rc 26 Jan 2005 12:18:54 -0000 1.1 --- com0com.rc 1 Feb 2005 09:09:28 -0000 1.2 *************** *** 1,2 **** --- 1,68 ---- + /* + * $Id$ + * + * Copyright (c) 2004-2005 Vyacheslav Frolov + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + * + * + * $Log$ + * Revision 1.2 2005/02/01 09:09:28 vfrolov + * Added version info + * + * + */ + #include <windows.h> + #include <ntverp.h> #include "c0clog.rc" + + #define VER_VERSION 1,0,0,0 + #define VER_VERSION_STR "1.0.0.0" + + #define VER_PODUCT_NAME_STR "Null-modem emulator" + + #if DBG + #define VER_DEBUG_STR " (debug version)" + #else + #define VER_DEBUG_STR "" + #endif + + VS_VERSION_INFO VERSIONINFO + FILEVERSION VER_VERSION + PRODUCTVERSION VER_VERSION + FILEFLAGSMASK VER_FILEFLAGSMASK + FILEFLAGS VER_FILEFLAGS + FILEOS VER_FILEOS + FILETYPE VFT_DRV + FILESUBTYPE VFT2_DRV_COMM + { + BLOCK "StringFileInfo" { + BLOCK "040904B0" { + VALUE "CompanyName", "Vyacheslav Frolov\0" + VALUE "FileDescription", VER_PODUCT_NAME_STR VER_DEBUG_STR + VALUE "FileVersion", VER_VERSION_STR + VALUE "InternalName", "com0com\0" + VALUE "LegalCopyright", "Copyright (c) 2004-2005 Vyacheslav Frolov\0" + VALUE "OriginalFilename", "com0com.sys\0" + VALUE "ProductName", VER_PODUCT_NAME_STR + VALUE "ProductVersion", VER_VERSION_STR + } + } + + BLOCK "VarFileInfo" { + VALUE "Translation", 0x409, 0x4B0 + } + } |