com0com-cvs Mailing List for Null-modem emulator (Page 35)
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-11-25 13:49:36
|
Update of /cvsroot/com0com/com2tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14195 Modified Files: com2tcp.cpp Log Message: Implemented --interface option for client mode Index: com2tcp.cpp =================================================================== RCS file: /cvsroot/com0com/com2tcp/com2tcp.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** com2tcp.cpp 18 Oct 2005 09:53:36 -0000 1.8 --- com2tcp.cpp 25 Nov 2005 13:49:23 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2005/11/25 13:49:23 vfrolov + * Implemented --interface option for client mode + * * Revision 1.8 2005/10/18 09:53:36 vfrolov * Added EVENT_ACCEPT *************** *** 602,610 **** sn.sin_family = AF_INET; ! struct servent *pServEnt; ! pServEnt = getservbyname(pPort, pProtoName); ! sn.sin_port = pServEnt ? pServEnt->s_port : htons((u_short)atoi(pPort)); sn.sin_addr.s_addr = pAddr ? inet_addr(pAddr) : INADDR_ANY; --- 605,615 ---- sn.sin_family = AF_INET; ! if (pPort) { ! struct servent *pServEnt; ! pServEnt = getservbyname(pPort, pProtoName); ! sn.sin_port = pServEnt ? pServEnt->s_port : htons((u_short)atoi(pPort)); ! } sn.sin_addr.s_addr = pAddr ? inet_addr(pAddr) : INADDR_ANY; *************** *** 623,627 **** } ! static SOCKET Socket() { const struct protoent *pProtoEnt; --- 628,634 ---- } ! static SOCKET Socket( ! const char *pIF, ! const char *pPort = NULL) { const struct protoent *pProtoEnt; *************** *** 641,644 **** --- 648,664 ---- } + if (pIF || pPort) { + struct sockaddr_in sn; + + if (!SetAddr(sn, pIF, pPort)) + return INVALID_SOCKET; + + if (bind(hSock, (struct sockaddr *)&sn, sizeof(sn)) == SOCKET_ERROR) { + TraceLastError("Socket(): bind(\"%s\", \"%s\")", pIF, pPort); + closesocket(hSock); + return INVALID_SOCKET; + } + } + return hSock; } *************** *** 685,704 **** Protocol &protocol) { ! struct sockaddr_in snl; ! ! if (!SetAddr(snl, pIF, pPort)) ! return 2; ! ! SOCKET hSockListen = Socket(); if (hSockListen == INVALID_SOCKET) return 2; - if (bind(hSockListen, (struct sockaddr *)&snl, sizeof(snl)) == SOCKET_ERROR) { - TraceLastError("tcp2com(): bind(\"%s\", \"%s\")", pIF, pPort); - closesocket(hSockListen); - return 2; - } - if (listen(hSockListen, SOMAXCONN) == SOCKET_ERROR) { TraceLastError("tcp2com(): listen(\"%s\", \"%s\")", pIF, pPort); --- 705,713 ---- Protocol &protocol) { ! SOCKET hSockListen = Socket(pIF, pPort); if (hSockListen == INVALID_SOCKET) return 2; if (listen(hSockListen, SOMAXCONN) == SOCKET_ERROR) { TraceLastError("tcp2com(): listen(\"%s\", \"%s\")", pIF, pPort); *************** *** 728,732 **** } /////////////////////////////////////////////////////////////// ! static SOCKET Connect(const char *pAddr, const char *pPort) { struct sockaddr_in sn; --- 737,744 ---- } /////////////////////////////////////////////////////////////// ! static SOCKET Connect( ! const char *pIF, ! const char *pAddr, ! const char *pPort) { struct sockaddr_in sn; *************** *** 735,739 **** return INVALID_SOCKET; ! SOCKET hSock = Socket(); if (hSock == INVALID_SOCKET) --- 747,751 ---- return INVALID_SOCKET; ! SOCKET hSock = Socket(pIF); if (hSock == INVALID_SOCKET) *************** *** 754,757 **** --- 766,770 ---- const char *pPath, BOOL ignoreDSR, + const char *pIF, const char *pAddr, const char *pPort, *************** *** 766,770 **** while (WaitComReady(hC0C, ignoreDSR, pAwakSeq)) { ! SOCKET hSock = Connect(pAddr, pPort); if (hSock == INVALID_SOCKET) --- 779,783 ---- while (WaitComReady(hC0C, ignoreDSR, pAwakSeq)) { ! SOCKET hSock = Connect(pIF, pAddr, pPort); if (hSock == INVALID_SOCKET) *************** *** 783,799 **** static void Usage(const char *pProgName) { ! fprintf(stderr, "Usage:\n"); fprintf(stderr, " %s [options] \\\\.\\<com port> <host addr> <host port>\n", pProgName); fprintf(stderr, " %s [options] \\\\.\\<com port> <listen port>\n", pProgName); fprintf(stderr, "Common options:\n"); fprintf(stderr, " --telnet - use Telnet protocol.\n"); ! fprintf(stderr, " --terminal type - use terminal type (RFC 1091).\n"); fprintf(stderr, " --ignore-dsr - ignore DSR state.\n"); ! fprintf(stderr, "Connect options:\n"); ! fprintf(stderr, " --awak-seq sequence - wait awakening sequence from com port\n" " before connecting to host. All data before\n" ! " sequence and sequence will be not sent.\n"); ! fprintf(stderr, "Listen options:\n"); ! fprintf(stderr, " --interface if - listen interface if.\n"); exit(1); } --- 796,818 ---- static void Usage(const char *pProgName) { ! fprintf(stderr, "Usage (client mode):\n"); fprintf(stderr, " %s [options] \\\\.\\<com port> <host addr> <host port>\n", pProgName); + fprintf(stderr, "\n"); + fprintf(stderr, "Usage (server mode):\n"); fprintf(stderr, " %s [options] \\\\.\\<com port> <listen port>\n", pProgName); + fprintf(stderr, "\n"); fprintf(stderr, "Common options:\n"); fprintf(stderr, " --telnet - use Telnet protocol.\n"); ! fprintf(stderr, " --terminal <type> - use terminal <type> (RFC 1091).\n"); fprintf(stderr, " --ignore-dsr - ignore DSR state.\n"); ! fprintf(stderr, "\n"); ! fprintf(stderr, "Client mode options:\n"); ! fprintf(stderr, " --awak-seq <sequence> - wait for awakening <sequence> from com port\n" " before connecting to host. All data before\n" ! " <sequence> and <sequence> itself will not be sent.\n"); ! fprintf(stderr, " --interface <if> - use interface <if> for connecting.\n"); ! fprintf(stderr, "\n"); ! fprintf(stderr, "Server mode options:\n"); ! fprintf(stderr, " --interface <if> - use interface <if> for listening.\n"); exit(1); } *************** *** 869,873 **** if (argc == 4) ! res = com2tcp(pArgs[0], ignoreDSR, pArgs[1], pArgs[2], *pProtocol, pAwakSeq); else res = tcp2com(pArgs[0], ignoreDSR, pIF, pArgs[1], *pProtocol); --- 888,892 ---- if (argc == 4) ! res = com2tcp(pArgs[0], ignoreDSR, pIF, pArgs[1], pArgs[2], *pProtocol, pAwakSeq); else res = tcp2com(pArgs[0], ignoreDSR, pIF, pArgs[1], *pProtocol); |
From: Vyacheslav F. <vf...@us...> - 2005-11-25 13:44:06
|
Update of /cvsroot/com0com/com2tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13270 Modified Files: version.h Log Message: Post-tagging version change Index: version.h =================================================================== RCS file: /cvsroot/com0com/com2tcp/version.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** version.h 18 Oct 2005 16:10:18 -0000 1.1 --- version.h 25 Nov 2005 13:43:56 -0000 1.2 *************** *** 28,32 **** #define C2T_V2 2 #define C2T_V3 0 ! #define C2T_V4 0 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 --- 28,32 ---- #define C2T_V2 2 #define C2T_V3 0 ! #define C2T_V4 1 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 |
From: Vyacheslav F. <vf...@us...> - 2005-11-25 08:59:46
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19188 Modified Files: io.c Log Message: Implemented SERIAL_EV_RXFLAG Index: io.c =================================================================== RCS file: /cvsroot/com0com/com0com/io.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** io.c 14 Sep 2005 13:14:47 -0000 1.16 --- io.c 25 Nov 2005 08:59:39 -0000 1.17 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.17 2005/11/25 08:59:39 vfrolov + * Implemented SERIAL_EV_RXFLAG + * * Revision 1.16 2005/09/14 13:14:47 vfrolov * Fixed possible tick loss *************** *** 109,117 **** } ! VOID WaitCompleteRxChar(PC0C_IO_PORT pReadIoPort, PLIST_ENTRY pQueueToComplete) { ! if (pReadIoPort->waitMask & SERIAL_EV_RXCHAR) { ! pReadIoPort->eventMask |= SERIAL_EV_RXCHAR; ! WaitComplete(pReadIoPort, pQueueToComplete); } } --- 112,136 ---- } ! VOID OnRxChars(PC0C_IO_PORT pReadIoPort, PVOID pBuf, SIZE_T size, PLIST_ENTRY pQueueToComplete) { ! if (pReadIoPort->waitMask & (SERIAL_EV_RXCHAR | SERIAL_EV_RXFLAG)) { ! if (pReadIoPort->waitMask & SERIAL_EV_RXCHAR) ! pReadIoPort->eventMask |= SERIAL_EV_RXCHAR; ! ! if (pReadIoPort->waitMask & SERIAL_EV_RXFLAG) { ! PUCHAR p = (PUCHAR)pBuf; ! SIZE_T s = size; ! UCHAR c = pReadIoPort->pDevExt->specialChars.EventChar; ! ! while (s--) { ! if (c == *p++) { ! pReadIoPort->eventMask |= SERIAL_EV_RXFLAG; ! break; ! } ! } ! } ! ! if (pReadIoPort->eventMask) ! WaitComplete(pReadIoPort, pQueueToComplete); } } *************** *** 127,135 **** SIZE_T writeLength, information; SIZE_T writeDone; PC0C_BUFFER pBuf; SIZE_T length; - writeLength = IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length; information = pIrp->IoStatus.Information; pBuf = &pReadIoPort->readBuf; length = writeLength - information; --- 146,158 ---- SIZE_T writeLength, information; SIZE_T writeDone; + PVOID pWriteBuf; PC0C_BUFFER pBuf; SIZE_T length; information = pIrp->IoStatus.Information; + + pWriteBuf = GET_REST_BUFFER(pIrp, information); + writeLength = IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length; + pBuf = &pReadIoPort->readBuf; length = writeLength - information; *************** *** 138,142 **** length = *pWriteLimit; ! writeDone = WriteToBuffer(pBuf, GET_REST_BUFFER(pIrp, information), length, pReadIoPort->escapeChar); if (writeDone) { --- 161,165 ---- length = *pWriteLimit; ! writeDone = WriteToBuffer(pBuf, pWriteBuf, length, pReadIoPort->escapeChar); if (writeDone) { *************** *** 148,152 **** *pWriteLimit -= writeDone; ! WaitCompleteRxChar(pReadIoPort, pQueueToComplete); } --- 171,175 ---- *pWriteLimit -= writeDone; ! OnRxChars(pReadIoPort, pWriteBuf, writeDone, pQueueToComplete); } *************** *** 182,188 **** SIZE_T writeLength, information; SIZE_T writeDone; - writeLength = IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length; information = pIrp->IoStatus.Information; writeDone = writeLength - information; --- 205,215 ---- SIZE_T writeLength, information; SIZE_T writeDone; + PVOID pWriteBuf; information = pIrp->IoStatus.Information; + + pWriteBuf = GET_REST_BUFFER(pIrp, information); + writeLength = IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length; + writeDone = writeLength - information; *************** *** 199,202 **** --- 226,230 ---- AlertOverrun(pReadIoPort, pQueueToComplete); + OnRxChars(pReadIoPort, pWriteBuf, writeDone, pQueueToComplete); } *************** *** 250,254 **** if (writeDone) ! WaitCompleteRxChar(pReadIoPort, pQueueToComplete); *pReadDone += readDone; --- 278,282 ---- if (writeDone) ! OnRxChars(pReadIoPort, pWriteBuf, writeDone, pQueueToComplete); *pReadDone += readDone; |
From: Vyacheslav F. <vf...@us...> - 2005-11-25 08:56:38
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18680 Modified Files: version.h Log Message: Post-tagging version change Index: version.h =================================================================== RCS file: /cvsroot/com0com/com0com/version.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** version.h 17 Oct 2005 07:42:55 -0000 1.2 --- version.h 25 Nov 2005 08:56:30 -0000 1.3 *************** *** 26,30 **** #define C0C_V2 4 #define C0C_V3 0 ! #define C0C_V4 0 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 --- 26,30 ---- #define C0C_V2 4 #define C0C_V3 0 ! #define C0C_V4 1 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 |
From: Vyacheslav F. <vf...@us...> - 2005-10-18 16:11:55
|
Update of /cvsroot/com0com/com2tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21347 Modified Files: com2tcp.rc Log Message: Variable info moved to version.h Index: com2tcp.rc =================================================================== RCS file: /cvsroot/com0com/com2tcp/com2tcp.rc,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** com2tcp.rc 22 Jun 2005 14:54:25 -0000 1.2 --- com2tcp.rc 18 Oct 2005 16:11:31 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/10/18 16:11:31 vfrolov + * Variable info moved to version.h + * * Revision 1.2 2005/06/22 14:54:25 vfrolov * Changed version *************** *** 30,38 **** #include <windows.h> ! ! #define VER_FILEVERSION 1,1,0,0 ! #define VER_PRODUCTVERSION_STR "1.1.0.0" ! #define VER_LEGALCOPYRIGHT_YEARS "2005" #define VER_COMPANYNAME_STR "Vyacheslav Frolov\0" --- 33,41 ---- #include <windows.h> + #include "version.h" ! #define VER_FILEVERSION C2T_V1,C2T_V2,C2T_V3,C2T_V4 ! #define VER_PRODUCTVERSION_STR C2T_VERSION_STR ! #define VER_LEGALCOPYRIGHT_YEARS C2T_COPYRIGHT_YEARS #define VER_COMPANYNAME_STR "Vyacheslav Frolov\0" |
From: Vyacheslav F. <vf...@us...> - 2005-10-18 16:10:32
|
Update of /cvsroot/com0com/com2tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20785 Added Files: version.h Log Message: Initial revision --- NEW FILE: version.h --- /* * $Id: version.h,v 1.1 2005/10/18 16:10:18 vfrolov Exp $ * * Copyright (c) 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 * */ #ifndef _C2T_VERSION_H_ #define _C2T_VERSION_H_ #define C2T_COPYRIGHT_YEARS "2005" #define C2T_V1 1 #define C2T_V2 2 #define C2T_V3 0 #define C2T_V4 0 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 #define MK_VERSION_STR(V1, V2, V3, V4) MK_VERSION_STR1(V1, V2, V3, V4) #define C2T_VERSION_STR MK_VERSION_STR(C2T_V1, C2T_V2, C2T_V3, C2T_V4) #endif /* _C2T_VERSION_H_ */ |
From: Vyacheslav F. <vf...@us...> - 2005-10-18 09:53:44
|
Update of /cvsroot/com0com/com2tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24141 Modified Files: com2tcp.cpp Log Message: Added EVENT_ACCEPT Index: com2tcp.cpp =================================================================== RCS file: /cvsroot/com0com/com2tcp/com2tcp.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** com2tcp.cpp 3 Oct 2005 13:48:08 -0000 1.7 --- com2tcp.cpp 18 Oct 2005 09:53:36 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2005/10/18 09:53:36 vfrolov + * Added EVENT_ACCEPT + * * Revision 1.7 2005/10/03 13:48:08 vfrolov * Added --ignore-dsr and listen options *************** *** 48,51 **** --- 51,57 ---- /////////////////////////////////////////////////////////////// + static SOCKET Accept(SOCKET hSockListen); + static void Disconnect(SOCKET hSock); + /////////////////////////////////////////////////////////////// static void TraceLastError(const char *pFmt, ...) { *************** *** 107,111 **** } /////////////////////////////////////////////////////////////// ! static void InOut(HANDLE hC0C, SOCKET hSock, Protocol &protocol, BOOL ignoreDSR) { printf("InOut() START\n"); --- 113,122 ---- } /////////////////////////////////////////////////////////////// ! static void InOut( ! HANDLE hC0C, ! SOCKET hSock, ! Protocol &protocol, ! BOOL ignoreDSR, ! SOCKET hSockListen = INVALID_SOCKET) { printf("InOut() START\n"); *************** *** 122,125 **** --- 133,137 ---- EVENT_STAT, EVENT_CLOSE, + EVENT_ACCEPT, EVENT_NUM }; *************** *** 138,141 **** --- 150,156 ---- WSAEventSelect(hSock, hEvents[EVENT_CLOSE], FD_CLOSE); + if (hSockListen != INVALID_SOCKET) + WSAEventSelect(hSockListen, hEvents[EVENT_ACCEPT], FD_ACCEPT); + DWORD not_used; *************** *** 334,337 **** --- 349,366 ---- stop = TRUE; break; + case WAIT_OBJECT_0 + EVENT_ACCEPT: { + ResetEvent(hEvents[EVENT_ACCEPT]); + printf("EVENT_ACCEPT\n"); + + SOCKET hSockTmp = Accept(hSockListen); + + if (hSockTmp != INVALID_SOCKET) { + char msg[] = "*** Serial port is busy ***\n"; + + send(hSockTmp, msg, strlen(msg), 0); + Disconnect(hSockTmp); + } + break; + } case WAIT_TIMEOUT: break; *************** *** 346,349 **** --- 375,386 ---- CancelIo((HANDLE)hSock); + if (hSockListen != INVALID_SOCKET) { + WSAEventSelect(hSockListen, hEvents[EVENT_ACCEPT], 0); + + u_long blocking = 0; + + ioctlsocket(hSockListen, FIONBIO, &blocking); + } + CloseEvents(EVENT_NUM, hEvents); *************** *** 618,621 **** --- 655,681 ---- } /////////////////////////////////////////////////////////////// + + static SOCKET Accept(SOCKET hSockListen) + { + struct sockaddr_in sn; + int snlen = sizeof(sn); + SOCKET hSock = accept(hSockListen, (struct sockaddr *)&sn, &snlen); + + if (hSock == INVALID_SOCKET) { + TraceLastError("tcp2com(): accept()"); + return INVALID_SOCKET; + } + + u_long addr = ntohl(sn.sin_addr.s_addr); + + printf("Accept(%d.%d.%d.%d) - OK\n", + (addr >> 24) & 0xFF, + (addr >> 16) & 0xFF, + (addr >> 8) & 0xFF, + addr & 0xFF); + + return hSock; + } + static int tcp2com( const char *pPath, *************** *** 646,672 **** return 2; } ! for (;;) { ! struct sockaddr_in sn; ! int snlen = sizeof(sn); ! SOCKET hSock = accept(hSockListen, (struct sockaddr *)&sn, &snlen); ! if (hSock == INVALID_SOCKET) { ! TraceLastError("tcp2com(): accept()"); break; - } - - u_long addr = ntohl(sn.sin_addr.s_addr); - - printf("Accept(%d.%d.%d.%d) - OK\n", - (addr >> 24) & 0xFF, - (addr >> 16) & 0xFF, - (addr >> 8) & 0xFF, - addr & 0xFF); HANDLE hC0C = OpenC0C(pPath, ignoreDSR); if (hC0C != INVALID_HANDLE_VALUE) { ! InOut(hC0C, hSock, protocol, ignoreDSR); CloseHandle(hC0C); } --- 706,720 ---- return 2; } ! for (;;) { ! SOCKET hSock = Accept(hSockListen); ! if (hSock == INVALID_SOCKET) break; HANDLE hC0C = OpenC0C(pPath, ignoreDSR); if (hC0C != INVALID_HANDLE_VALUE) { ! InOut(hC0C, hSock, protocol, ignoreDSR, hSockListen); CloseHandle(hC0C); } |
From: Vyacheslav F. <vf...@us...> - 2005-10-17 07:43:03
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv365 Modified Files: version.h Log Message: Pre-tagging version change Index: version.h =================================================================== RCS file: /cvsroot/com0com/com0com/version.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** version.h 5 Sep 2005 15:58:34 -0000 1.1 --- version.h 17 Oct 2005 07:42:55 -0000 1.2 *************** *** 24,30 **** #define C0C_V1 1 ! #define C0C_V2 3 #define C0C_V3 0 ! #define C0C_V4 1 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 --- 24,30 ---- #define C0C_V1 1 ! #define C0C_V2 4 #define C0C_V3 0 ! #define C0C_V4 0 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 |
From: Vyacheslav F. <vf...@us...> - 2005-10-03 13:48:17
|
Update of /cvsroot/com0com/com2tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4230 Modified Files: ReadMe.txt com2tcp.cpp Log Message: Added --ignore-dsr and listen options Index: com2tcp.cpp =================================================================== RCS file: /cvsroot/com0com/com2tcp/com2tcp.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** com2tcp.cpp 10 Jun 2005 15:55:10 -0000 1.6 --- com2tcp.cpp 3 Oct 2005 13:48:08 -0000 1.7 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2005/10/03 13:48:08 vfrolov + * Added --ignore-dsr and listen options + * * Revision 1.6 2005/06/10 15:55:10 vfrolov * Implemented --terminal option *************** *** 104,111 **** } /////////////////////////////////////////////////////////////// ! static void InOut(HANDLE hC0C, SOCKET hSock, Protocol &protocol) { printf("InOut() START\n"); BOOL stop = FALSE; --- 107,116 ---- } /////////////////////////////////////////////////////////////// ! static void InOut(HANDLE hC0C, SOCKET hSock, Protocol &protocol, BOOL ignoreDSR) { printf("InOut() START\n"); + protocol.Clean(); + BOOL stop = FALSE; *************** *** 116,119 **** --- 121,125 ---- EVENT_WRITTEN, EVENT_STAT, + EVENT_CLOSE, EVENT_NUM }; *************** *** 130,133 **** --- 136,141 ---- } + WSAEventSelect(hSock, hEvents[EVENT_CLOSE], FD_CLOSE); + DWORD not_used; *************** *** 149,152 **** --- 157,161 ---- BOOL waitingStat = FALSE; + int DSR = -1; while (!stop) { *************** *** 228,233 **** if (!(stat & MS_DSR_ON)) { ! printf("DSR is OFF\n"); ! break; } } --- 237,254 ---- if (!(stat & MS_DSR_ON)) { ! if (DSR != 0) { ! printf("DSR is OFF\n"); ! DSR = 0; ! } ! if (!ignoreDSR) { ! if (waitingSend) ! Sleep(1000); ! break; ! } ! } else { ! if (DSR != 1) { ! printf("DSR is ON\n"); ! DSR = 1; ! } } } *************** *** 306,309 **** --- 327,337 ---- waitingStat = FALSE; break; + case WAIT_OBJECT_0 + EVENT_CLOSE: + ResetEvent(hEvents[EVENT_CLOSE]); + printf("EVENT_CLOSE\n"); + if (waitingWrite) + Sleep(1000); + stop = TRUE; + break; case WAIT_TIMEOUT: break; *************** *** 323,328 **** } /////////////////////////////////////////////////////////////// ! static BOOL WaitComReady(HANDLE hC0C, const BYTE *pAwakSeq) { enum { EVENT_READ, --- 351,362 ---- } /////////////////////////////////////////////////////////////// ! static BOOL WaitComReady(HANDLE hC0C, BOOL ignoreDSR, const BYTE *pAwakSeq) { + BOOL waitAwakSeq = (pAwakSeq && *pAwakSeq); + BOOL waitDSR = (!ignoreDSR && !waitAwakSeq); + + if (!waitAwakSeq && !waitDSR) + return TRUE; + enum { EVENT_READ, *************** *** 349,354 **** BYTE cbufRead[1]; ! BOOL waitingRead = !(pAwakSeq && *pAwakSeq); ! BOOL waitingStat = !waitingRead; while (!fault) { --- 383,388 ---- BYTE cbufRead[1]; ! BOOL waitingRead = !waitAwakSeq; ! BOOL waitingStat = !waitDSR; while (!fault) { *************** *** 449,453 **** } /////////////////////////////////////////////////////////////// ! static HANDLE OpenC0C(const char *pPath) { HANDLE hC0C = CreateFile(pPath, --- 483,487 ---- } /////////////////////////////////////////////////////////////// ! static HANDLE OpenC0C(const char *pPath, BOOL ignoreDSR) { HANDLE hC0C = CreateFile(pPath, *************** *** 478,482 **** dcb.fOutxCtsFlow = FALSE; dcb.fOutxDsrFlow = FALSE; ! dcb.fDsrSensitivity = TRUE; dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; dcb.fDtrControl = DTR_CONTROL_ENABLE; --- 512,516 ---- dcb.fOutxCtsFlow = FALSE; dcb.fOutxDsrFlow = FALSE; ! dcb.fDsrSensitivity = !ignoreDSR; dcb.fRtsControl = RTS_CONTROL_HANDSHAKE; dcb.fDtrControl = DTR_CONTROL_ENABLE; *************** *** 489,492 **** --- 523,528 ---- dcb.fParity = FALSE; dcb.fNull = FALSE; + dcb.fAbortOnError = FALSE; + dcb.fErrorChar = FALSE; if (!mySetCommState(hC0C, &dcb)) { *************** *** 522,530 **** } /////////////////////////////////////////////////////////////// ! static SOCKET Connect(const char *pAddr, const char *pPort) ! { ! const char *pProtoName = "tcp"; ! struct sockaddr_in sn; memset(&sn, 0, sizeof(sn)); sn.sin_family = AF_INET; --- 558,565 ---- } /////////////////////////////////////////////////////////////// ! static const char *pProtoName = "tcp"; + static BOOL SetAddr(struct sockaddr_in &sn, const char *pAddr, const char *pPort) + { memset(&sn, 0, sizeof(sn)); sn.sin_family = AF_INET; *************** *** 536,558 **** sn.sin_port = pServEnt ? pServEnt->s_port : htons((u_short)atoi(pPort)); ! sn.sin_addr.S_un.S_addr = inet_addr(pAddr); ! if (sn.sin_addr.S_un.S_addr == INADDR_NONE) { const struct hostent *pHostEnt = gethostbyname(pAddr); if (!pHostEnt) { ! TraceLastError("Connect(): gethostbyname(\"%s\")", pAddr); ! return INVALID_SOCKET; } memcpy(&sn.sin_addr, pHostEnt->h_addr, pHostEnt->h_length); } const struct protoent *pProtoEnt; ! pProtoEnt = getprotobyname(pProtoName); if (!pProtoEnt) { ! TraceLastError("Connect(): getprotobyname(\"%s\")", pProtoName); return INVALID_SOCKET; } --- 571,597 ---- sn.sin_port = pServEnt ? pServEnt->s_port : htons((u_short)atoi(pPort)); ! sn.sin_addr.s_addr = pAddr ? inet_addr(pAddr) : INADDR_ANY; ! if (sn.sin_addr.s_addr == INADDR_NONE) { const struct hostent *pHostEnt = gethostbyname(pAddr); if (!pHostEnt) { ! TraceLastError("SetAddr(): gethostbyname(\"%s\")", pAddr); ! return FALSE; } memcpy(&sn.sin_addr, pHostEnt->h_addr, pHostEnt->h_length); } + return TRUE; + } + static SOCKET Socket() + { const struct protoent *pProtoEnt; ! pProtoEnt = getprotobyname(pProtoName); if (!pProtoEnt) { ! TraceLastError("Socket(): getprotobyname(\"%s\")", pProtoName); return INVALID_SOCKET; } *************** *** 561,570 **** if (hSock == INVALID_SOCKET) { ! TraceLastError("Connect(): socket()"); return INVALID_SOCKET; } if (connect(hSock, (struct sockaddr *)&sn, sizeof(sn)) == SOCKET_ERROR) { ! TraceLastError("Connect(): connect()"); closesocket(hSock); return INVALID_SOCKET; --- 600,697 ---- if (hSock == INVALID_SOCKET) { ! TraceLastError("Socket(): socket()"); return INVALID_SOCKET; } + return hSock; + } + + static void Disconnect(SOCKET hSock) + { + if (shutdown(hSock, SD_BOTH) != 0) + TraceLastError("Disconnect(): shutdown()"); + + if (closesocket(hSock) != 0) + TraceLastError("Disconnect(): closesocket()"); + + printf("Disconnect() - OK\n"); + } + /////////////////////////////////////////////////////////////// + static int tcp2com( + const char *pPath, + BOOL ignoreDSR, + const char *pIF, + const char *pPort, + Protocol &protocol) + { + struct sockaddr_in snl; + + if (!SetAddr(snl, pIF, pPort)) + return 2; + + SOCKET hSockListen = Socket(); + + if (hSockListen == INVALID_SOCKET) + return 2; + + if (bind(hSockListen, (struct sockaddr *)&snl, sizeof(snl)) == SOCKET_ERROR) { + TraceLastError("tcp2com(): bind(\"%s\", \"%s\")", pIF, pPort); + closesocket(hSockListen); + return 2; + } + + if (listen(hSockListen, SOMAXCONN) == SOCKET_ERROR) { + TraceLastError("tcp2com(): listen(\"%s\", \"%s\")", pIF, pPort); + closesocket(hSockListen); + return 2; + } + + for (;;) { + struct sockaddr_in sn; + int snlen = sizeof(sn); + SOCKET hSock = accept(hSockListen, (struct sockaddr *)&sn, &snlen); + + if (hSock == INVALID_SOCKET) { + TraceLastError("tcp2com(): accept()"); + break; + } + + u_long addr = ntohl(sn.sin_addr.s_addr); + + printf("Accept(%d.%d.%d.%d) - OK\n", + (addr >> 24) & 0xFF, + (addr >> 16) & 0xFF, + (addr >> 8) & 0xFF, + addr & 0xFF); + + HANDLE hC0C = OpenC0C(pPath, ignoreDSR); + + if (hC0C != INVALID_HANDLE_VALUE) { + InOut(hC0C, hSock, protocol, ignoreDSR); + CloseHandle(hC0C); + } + + Disconnect(hSock); + } + + closesocket(hSockListen); + + return 2; + } + /////////////////////////////////////////////////////////////// + static SOCKET Connect(const char *pAddr, const char *pPort) + { + struct sockaddr_in sn; + + if (!SetAddr(sn, pAddr, pPort)) + return INVALID_SOCKET; + + SOCKET hSock = Socket(); + + if (hSock == INVALID_SOCKET) + return INVALID_SOCKET; + if (connect(hSock, (struct sockaddr *)&sn, sizeof(sn)) == SOCKET_ERROR) { ! TraceLastError("Connect(): connect(\"%s\", \"%s\")", pAddr, pPort); closesocket(hSock); return INVALID_SOCKET; *************** *** 573,589 **** printf("Connect(\"%s\", \"%s\") - OK\n", pAddr, pPort); - return hSock; } ! static void Disconnect(SOCKET hSock) { ! if (shutdown(hSock, SD_BOTH) != 0) ! TraceLastError("Disconnect(): shutdown()"); ! if (closesocket(hSock) != 0) ! TraceLastError("Disconnect(): closesocket()"); ! printf("Disconnect() - OK\n"); } /////////////////////////////////////////////////////////////// --- 700,734 ---- printf("Connect(\"%s\", \"%s\") - OK\n", pAddr, pPort); return hSock; } ! static int com2tcp( ! const char *pPath, ! BOOL ignoreDSR, ! const char *pAddr, ! const char *pPort, ! Protocol &protocol, ! const BYTE *pAwakSeq) { ! HANDLE hC0C = OpenC0C(pPath, ignoreDSR); ! if (hC0C == INVALID_HANDLE_VALUE) { ! return 2; ! } ! while (WaitComReady(hC0C, ignoreDSR, pAwakSeq)) { ! SOCKET hSock = Connect(pAddr, pPort); ! ! if (hSock == INVALID_SOCKET) ! break; ! ! InOut(hC0C, hSock, protocol, ignoreDSR); ! ! Disconnect(hSock); ! } ! ! CloseHandle(hC0C); ! ! return 2; } /////////////////////////////////////////////////////////////// *************** *** 592,599 **** fprintf(stderr, "Usage:\n"); fprintf(stderr, " %s [options] \\\\.\\<com port> <host addr> <host port>\n", pProgName); ! fprintf(stderr, "Options:\n"); fprintf(stderr, " --telnet - use Telnet protocol.\n"); ! fprintf(stderr, " --terminal type - use terminal type.\n"); ! fprintf(stderr, " --awak-seq sequence - wait awakening sequence from com port.\n"); exit(1); } --- 737,751 ---- fprintf(stderr, "Usage:\n"); fprintf(stderr, " %s [options] \\\\.\\<com port> <host addr> <host port>\n", pProgName); ! fprintf(stderr, " %s [options] \\\\.\\<com port> <listen port>\n", pProgName); ! fprintf(stderr, "Common options:\n"); fprintf(stderr, " --telnet - use Telnet protocol.\n"); ! fprintf(stderr, " --terminal type - use terminal type (RFC 1091).\n"); ! fprintf(stderr, " --ignore-dsr - ignore DSR state.\n"); ! fprintf(stderr, "Connect options:\n"); ! fprintf(stderr, " --awak-seq sequence - wait awakening sequence from com port\n" ! " before connecting to host. All data before\n" ! " sequence and sequence will be not sent.\n"); ! fprintf(stderr, "Listen options:\n"); ! fprintf(stderr, " --interface if - listen interface if.\n"); exit(1); } *************** *** 604,608 **** --- 756,762 ---- const char *pTermType = NULL; const BYTE *pAwakSeq = NULL; + const char *pIF = NULL; char **pArgs = &argv[1]; + BOOL ignoreDSR = FALSE; while (argc > 1) { *************** *** 622,625 **** --- 776,784 ---- argc--; } else + if (!strcmp(*pArgs, "--ignore-dsr")) { + pArgs++; + argc--; + ignoreDSR = TRUE; + } else if (!strcmp(*pArgs, "--awak-seq")) { pArgs++; *************** *** 628,631 **** --- 787,797 ---- pArgs++; argc--; + } else + if (!strcmp(*pArgs, "--interface")) { + pArgs++; + argc--; + pIF = *pArgs; + pArgs++; + argc--; } else { fprintf(stderr, "Unknown option %s\n", *pArgs); *************** *** 634,677 **** } ! if (argc != 4) Usage(argv[0]); - HANDLE hC0C = OpenC0C(pArgs[0]); - - if (hC0C == INVALID_HANDLE_VALUE) { - return 2; - } - WSADATA wsaData; WSAStartup(MAKEWORD(1, 1), &wsaData); ! while (WaitComReady(hC0C, pAwakSeq)) { ! SOCKET hSock = Connect(pArgs[1], pArgs[2]); ! ! if (hSock == INVALID_SOCKET) ! break; ! ! Protocol *pProtocol; ! switch (protocol) { ! case prTelnet: ! pProtocol = new TelnetProtocol(10, 10); ! ((TelnetProtocol *)pProtocol)->SetTerminalType(pTermType); ! break; ! default: ! pProtocol = new Protocol(10, 10); ! }; ! InOut(hC0C, hSock, *pProtocol); ! delete pProtocol; ! Disconnect(hSock); ! } - CloseHandle(hC0C); WSACleanup(); ! return 0; } /////////////////////////////////////////////////////////////// --- 800,832 ---- } ! if (argc < 3 || argc > 4) Usage(argv[0]); WSADATA wsaData; WSAStartup(MAKEWORD(1, 1), &wsaData); ! Protocol *pProtocol; ! switch (protocol) { ! case prTelnet: ! pProtocol = new TelnetProtocol(10, 10); ! ((TelnetProtocol *)pProtocol)->SetTerminalType(pTermType); ! break; ! default: ! pProtocol = new Protocol(10, 10); ! }; ! int res; ! if (argc == 4) ! res = com2tcp(pArgs[0], ignoreDSR, pArgs[1], pArgs[2], *pProtocol, pAwakSeq); ! else ! res = tcp2com(pArgs[0], ignoreDSR, pIF, pArgs[1], *pProtocol); ! delete pProtocol; WSACleanup(); ! return res; } /////////////////////////////////////////////////////////////// Index: ReadMe.txt =================================================================== RCS file: /cvsroot/com0com/com2tcp/ReadMe.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** ReadMe.txt 10 Jun 2005 15:49:08 -0000 1.2 --- ReadMe.txt 3 Oct 2005 13:48:08 -0000 1.3 *************** *** 10,14 **** In conjunction with the Null-modem emulator (com0com) the com2tcp enables to use a COM port based applications to communicate with the ! TCP/IP servers. The homepage for com0com project is http://com0com.sourceforge.net/. --- 10,14 ---- In conjunction with the Null-modem emulator (com0com) the com2tcp enables to use a COM port based applications to communicate with the ! TCP/IP based applications. The homepage for com0com project is http://com0com.sourceforge.net/. |
From: Vyacheslav F. <vf...@us...> - 2005-10-03 13:44:38
|
Update of /cvsroot/com0com/com2tcp In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3096 Modified Files: telnet.cpp telnet.h utils.cxx utils.h Log Message: Added Clean() method Index: telnet.cpp =================================================================== RCS file: /cvsroot/com0com/com2tcp/telnet.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** telnet.cpp 10 Jun 2005 15:55:10 -0000 1.2 --- telnet.cpp 3 Oct 2005 13:44:17 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/10/03 13:44:17 vfrolov + * Added Clean() method + * * Revision 1.2 2005/06/10 15:55:10 vfrolov * Implemented --terminal option *************** *** 82,92 **** /////////////////////////////////////////////////////////////// TelnetProtocol::TelnetProtocol(int _thresholdSend, int _thresholdWrite) ! : Protocol(_thresholdSend, _thresholdWrite), ! state(stData) { SetTerminalType(NULL); ! ! options[opEcho].remoteOptionState = OptionState::osNo; ! options[opTerminalType].localOptionState = OptionState::osNo; } --- 85,92 ---- /////////////////////////////////////////////////////////////// TelnetProtocol::TelnetProtocol(int _thresholdSend, int _thresholdWrite) ! : Protocol(_thresholdSend, _thresholdWrite) { SetTerminalType(NULL); ! Clean(); } *************** *** 102,105 **** --- 102,120 ---- } + void TelnetProtocol::Clean() + { + state = stData; + + for(int i = 0 ; i < sizeof(options)/sizeof(options[0]) ; i++) { + options[i].remoteOptionState = OptionState::osCant; + options[i].localOptionState = OptionState::osCant; + } + + options[opEcho].remoteOptionState = OptionState::osNo; + options[opTerminalType].localOptionState = OptionState::osNo; + + Protocol::Clean(); + } + int TelnetProtocol::Write(const void *pBuf, int count) { Index: telnet.h =================================================================== RCS file: /cvsroot/com0com/com2tcp/telnet.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** telnet.h 10 Jun 2005 15:55:10 -0000 1.2 --- telnet.h 3 Oct 2005 13:44:17 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/10/03 13:44:17 vfrolov + * Added Clean() method + * * Revision 1.2 2005/06/10 15:55:10 vfrolov * Implemented --terminal option *************** *** 40,43 **** --- 43,47 ---- virtual int Write(const void *pBuf, int count); + virtual void Clean(); protected: void SendOption(BYTE code, BYTE option); *************** *** 51,55 **** struct OptionState { - OptionState() : localOptionState(osCant), remoteOptionState(osCant) {} enum {osCant, osNo, osYes}; int localOptionState : 2; --- 55,58 ---- Index: utils.cxx =================================================================== RCS file: /cvsroot/com0com/com2tcp/utils.cxx,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** utils.cxx 10 Jun 2005 15:51:26 -0000 1.2 --- utils.cxx 3 Oct 2005 13:44:17 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/10/03 13:44:17 vfrolov + * Added Clean() method + * * Revision 1.2 2005/06/10 15:51:26 vfrolov * Included precomp.h *************** *** 171,173 **** --- 174,182 ---- return WriteRaw(pBuf, count); } + + void Protocol::Clean() + { + streamSendRead.Clean(); + streamWriteRecv.Clean(); + } /////////////////////////////////////////////////////////////// Index: utils.h =================================================================== RCS file: /cvsroot/com0com/com2tcp/utils.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** utils.h 10 Jun 2005 15:55:10 -0000 1.3 --- utils.h 3 Oct 2005 13:44:17 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2005/10/03 13:44:17 vfrolov + * Added Clean() method + * * Revision 1.3 2005/06/10 15:55:10 vfrolov * Implemented --terminal option *************** *** 83,88 **** void PutEof() { eof = TRUE; } BOOL isFull() const { return threshold && threshold < busy; } - - protected: void Clean(); --- 86,89 ---- *************** *** 112,115 **** --- 113,117 ---- BOOL isWriteFull() const { return streamWriteRecv.isFull(); } int Recv(void *pBuf, int count) { return streamWriteRecv.GetData(pBuf, count); } + virtual void Clean(); private: |
From: Vyacheslav F. <vf...@us...> - 2005-09-28 10:07:20
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25810 Modified Files: com0com.h initunlo.c sources trace.c trace.h tracetbl.c Added Files: fileinfo.c Log Message: Implemented IRP_MJ_QUERY_INFORMATION and IRP_MJ_SET_INFORMATION --- NEW FILE: fileinfo.c --- /* * $Id: fileinfo.c,v 1.1 2005/09/28 10:06:42 vfrolov Exp $ * * Copyright (c) 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: fileinfo.c,v $ * Revision 1.1 2005/09/28 10:06:42 vfrolov * Implemented IRP_MJ_QUERY_INFORMATION and IRP_MJ_SET_INFORMATION * * */ #include "precomp.h" /* * FILE_ID used by HALT_UNLESS to put it on BSOD */ #define FILE_ID 0xA NTSTATUS FdoPortQueryInformation(PC0C_FDOPORT_EXTENSION pDevExt, IN PIRP pIrp) { NTSTATUS status; if ((pDevExt->handFlow.ControlHandShake & SERIAL_ERROR_ABORT) && pDevExt->pIoPortLocal->errors) { pIrp->IoStatus.Information = 0; status = STATUS_CANCELLED; } else { PIO_STACK_LOCATION pIrpStack; pIrpStack = IoGetCurrentIrpStackLocation(pIrp); switch (pIrpStack->Parameters.QueryFile.FileInformationClass) { case FileStandardInformation: RtlZeroMemory(pIrp->AssociatedIrp.SystemBuffer, sizeof(FILE_STANDARD_INFORMATION)); pIrp->IoStatus.Information = sizeof(FILE_STANDARD_INFORMATION); status = STATUS_SUCCESS; break; case FilePositionInformation: RtlZeroMemory(pIrp->AssociatedIrp.SystemBuffer, sizeof(FILE_POSITION_INFORMATION)); pIrp->IoStatus.Information = sizeof(FILE_POSITION_INFORMATION); status = STATUS_SUCCESS; break; default: pIrp->IoStatus.Information = 0; status = STATUS_INVALID_PARAMETER; } } TraceIrp("FdoPortQueryInformation", pIrp, &status, TRACE_FLAG_PARAMS); pIrp->IoStatus.Status = status; IoCompleteRequest(pIrp, IO_NO_INCREMENT); return status; } NTSTATUS FdoPortSetInformation(PC0C_FDOPORT_EXTENSION pDevExt, IN PIRP pIrp) { NTSTATUS status; if ((pDevExt->handFlow.ControlHandShake & SERIAL_ERROR_ABORT) && pDevExt->pIoPortLocal->errors) { status = STATUS_CANCELLED; } else { PIO_STACK_LOCATION pIrpStack; pIrpStack = IoGetCurrentIrpStackLocation(pIrp); switch (pIrpStack->Parameters.QueryFile.FileInformationClass) { case FileEndOfFileInformation: case FileAllocationInformation: status = STATUS_SUCCESS; break; default: status = STATUS_INVALID_PARAMETER; } } TraceIrp("FdoPortSetInformation", pIrp, &status, TRACE_FLAG_PARAMS); pIrp->IoStatus.Information = 0; pIrp->IoStatus.Status = status; IoCompleteRequest(pIrp, IO_NO_INCREMENT); return status; } NTSTATUS c0cFileInformation(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) { NTSTATUS status; PC0C_COMMON_EXTENSION pDevExt = pDevObj->DeviceExtension; ULONG code = IoGetCurrentIrpStackLocation(pIrp)->MajorFunction; switch (pDevExt->doType) { case C0C_DOTYPE_FP: if (code == IRP_MJ_QUERY_INFORMATION) status = FdoPortQueryInformation((PC0C_FDOPORT_EXTENSION)pDevExt, pIrp); else status = FdoPortSetInformation((PC0C_FDOPORT_EXTENSION)pDevExt, pIrp); break; default: status = STATUS_INVALID_DEVICE_REQUEST; pIrp->IoStatus.Information = 0; pIrp->IoStatus.Status = status; IoCompleteRequest(pIrp, IO_NO_INCREMENT); TraceCode(pDevExt, "IRP_MJ_", codeNameTableIrpMj, code, &status); } return status; } Index: sources =================================================================== RCS file: /cvsroot/com0com/com0com/sources,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** sources 25 Aug 2005 15:38:17 -0000 1.3 --- sources 28 Sep 2005 10:06:42 -0000 1.4 *************** *** 16,19 **** --- 16,20 ---- write.c \ wait.c \ + fileinfo.c \ io.c \ startirp.c \ Index: initunlo.c =================================================================== RCS file: /cvsroot/com0com/com0com/initunlo.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** initunlo.c 13 Sep 2005 14:56:16 -0000 1.4 --- initunlo.c 28 Sep 2005 10:06:42 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2005/09/28 10:06:42 vfrolov + * Implemented IRP_MJ_QUERY_INFORMATION and IRP_MJ_SET_INFORMATION + * * Revision 1.4 2005/09/13 14:56:16 vfrolov * Implemented IRP_MJ_FLUSH_BUFFERS *************** *** 69,74 **** pDrvObj->MajorFunction[IRP_MJ_DEVICE_CONTROL] = c0cIoControl; pDrvObj->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = c0cInternalIoControl; ! pDrvObj->MajorFunction[IRP_MJ_QUERY_INFORMATION] = c0cQueryInformation; ! pDrvObj->MajorFunction[IRP_MJ_SET_INFORMATION] = c0cSetInformation; pDrvObj->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = c0cSystemControlDispatch; pDrvObj->MajorFunction[IRP_MJ_PNP] = c0cPnpDispatch; --- 72,77 ---- pDrvObj->MajorFunction[IRP_MJ_DEVICE_CONTROL] = c0cIoControl; pDrvObj->MajorFunction[IRP_MJ_INTERNAL_DEVICE_CONTROL] = c0cInternalIoControl; ! pDrvObj->MajorFunction[IRP_MJ_QUERY_INFORMATION] = c0cFileInformation; ! pDrvObj->MajorFunction[IRP_MJ_SET_INFORMATION] = c0cFileInformation; pDrvObj->MajorFunction[IRP_MJ_SYSTEM_CONTROL] = c0cSystemControlDispatch; pDrvObj->MajorFunction[IRP_MJ_PNP] = c0cPnpDispatch; *************** *** 104,141 **** } - NTSTATUS c0cQueryInformation(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) - { - NTSTATUS status; - - UNREFERENCED_PARAMETER(pDevObj); - - status = STATUS_INVALID_DEVICE_REQUEST; - - TraceIrp("c0cQueryInformation", pIrp, &status, TRACE_FLAG_PARAMS); - - pIrp->IoStatus.Information = 0; - pIrp->IoStatus.Status = status; - IoCompleteRequest(pIrp, IO_NO_INCREMENT); - - return status; - } - - NTSTATUS c0cSetInformation(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) - { - NTSTATUS status; - - UNREFERENCED_PARAMETER(pDevObj); - - status = STATUS_INVALID_DEVICE_REQUEST; - - TraceIrp("c0cQueryInformation", pIrp, &status, TRACE_FLAG_PARAMS); - - pIrp->IoStatus.Information = 0; - pIrp->IoStatus.Status = status; - IoCompleteRequest(pIrp, IO_NO_INCREMENT); - - return status; - } - NTSTATUS c0cSystemControlDispatch(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) { --- 107,110 ---- Index: tracetbl.c =================================================================== RCS file: /cvsroot/com0com/com0com/tracetbl.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** tracetbl.c 6 Sep 2005 06:49:38 -0000 1.3 --- tracetbl.c 28 Sep 2005 10:06:42 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2005/09/28 10:06:42 vfrolov + * Implemented IRP_MJ_QUERY_INFORMATION and IRP_MJ_SET_INFORMATION + * * Revision 1.3 2005/09/06 06:49:38 vfrolov * Added codeNameTableErrors[] *************** *** 278,281 **** --- 281,333 ---- }; + CODE2NAME codeNameTableFileInformationClass[] = { + #ifndef _WDMDDK_ + TOCODE2NAME1(FileDirectoryInformation), + TOCODE2NAME1(FileFullDirectoryInformation), + TOCODE2NAME1(FileBothDirectoryInformation), + #endif + TOCODE2NAME1(FileBasicInformation), + TOCODE2NAME1(FileStandardInformation), + #ifndef _WDMDDK_ + TOCODE2NAME1(FileInternalInformation), + TOCODE2NAME1(FileEaInformation), + TOCODE2NAME1(FileAccessInformation), + TOCODE2NAME1(FileNameInformation), + TOCODE2NAME1(FileRenameInformation), + TOCODE2NAME1(FileLinkInformation), + TOCODE2NAME1(FileNamesInformation), + TOCODE2NAME1(FileDispositionInformation), + #endif + TOCODE2NAME1(FilePositionInformation), + #ifndef _WDMDDK_ + TOCODE2NAME1(FileFullEaInformation), + TOCODE2NAME1(FileModeInformation), + TOCODE2NAME1(FileAlignmentInformation), + TOCODE2NAME1(FileAllInformation), + TOCODE2NAME1(FileAllocationInformation), + #endif + TOCODE2NAME1(FileEndOfFileInformation), + #ifndef _WDMDDK_ + TOCODE2NAME1(FileAlternateNameInformation), + TOCODE2NAME1(FileStreamInformation), + TOCODE2NAME1(FilePipeInformation), + TOCODE2NAME1(FilePipeLocalInformation), + TOCODE2NAME1(FilePipeRemoteInformation), + TOCODE2NAME1(FileMailslotQueryInformation), + TOCODE2NAME1(FileMailslotSetInformation), + TOCODE2NAME1(FileCompressionInformation), + TOCODE2NAME1(FileObjectIdInformation), + TOCODE2NAME1(FileCompletionInformation), + TOCODE2NAME1(FileMoveClusterInformation), + TOCODE2NAME1(FileQuotaInformation), + TOCODE2NAME1(FileReparsePointInformation), + TOCODE2NAME1(FileNetworkOpenInformation), + TOCODE2NAME1(FileAttributeTagInformation), + TOCODE2NAME1(FileTrackingInformation), + TOCODE2NAME1(FileMaximumInformation), + #endif + {0, NULL} + }; + #else /* DBG */ #pragma warning(disable:4206) // nonstandard extension used : translation unit is empty Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/trace.c,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** trace.c 13 Sep 2005 08:55:41 -0000 1.13 --- trace.c 28 Sep 2005 10:06:42 -0000 1.14 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.14 2005/09/28 10:06:42 vfrolov + * Implemented IRP_MJ_QUERY_INFORMATION and IRP_MJ_SET_INFORMATION + * * Revision 1.13 2005/09/13 08:55:41 vfrolov * Disabled modem status tracing by default *************** *** 1347,1350 **** --- 1350,1368 ---- pDestStr = AnsiStrCopyStr(pDestStr, &size, " "); pDestStr = AnsiStrCopyCode(pDestStr, &size, code, codeNameTablePower, "POWER_", 10); + break; + } + case IRP_MJ_QUERY_INFORMATION: { + ULONG code = pIrpStack->Parameters.QueryFile.FileInformationClass; + + pDestStr = AnsiStrCopyStr(pDestStr, &size, " "); + pDestStr = AnsiStrCopyCode(pDestStr, &size, code, codeNameTableFileInformationClass, NULL, 10); + break; + } + case IRP_MJ_SET_INFORMATION: { + ULONG code = pIrpStack->Parameters.SetFile.FileInformationClass; + + pDestStr = AnsiStrCopyStr(pDestStr, &size, " "); + pDestStr = AnsiStrCopyCode(pDestStr, &size, code, codeNameTableFileInformationClass, NULL, 10); + break; } } Index: trace.h =================================================================== RCS file: /cvsroot/com0com/com0com/trace.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** trace.h 13 Sep 2005 08:55:41 -0000 1.5 --- trace.h 28 Sep 2005 10:06:42 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2005/09/28 10:06:42 vfrolov + * Implemented IRP_MJ_QUERY_INFORMATION and IRP_MJ_SET_INFORMATION + * * Revision 1.5 2005/09/13 08:55:41 vfrolov * Disabled modem status tracing by default *************** *** 115,118 **** --- 118,122 ---- CODE2NAME codeNameTableDeviceText[]; CODE2NAME codeNameTableErrors[]; + CODE2NAME codeNameTableFileInformationClass[]; FIELD2NAME codeNameTableControlHandShake[]; Index: com0com.h =================================================================== RCS file: /cvsroot/com0com/com0com/com0com.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** com0com.h 13 Sep 2005 14:56:16 -0000 1.13 --- com0com.h 28 Sep 2005 10:06:42 -0000 1.14 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.14 2005/09/28 10:06:42 vfrolov + * Implemented IRP_MJ_QUERY_INFORMATION and IRP_MJ_SET_INFORMATION + * * Revision 1.13 2005/09/13 14:56:16 vfrolov * Implemented IRP_MJ_FLUSH_BUFFERS *************** *** 236,242 **** DeclareMajorFunction(c0cInternalIoControl); DeclareMajorFunction(c0cCleanup); ! ! DeclareMajorFunction(c0cQueryInformation); ! DeclareMajorFunction(c0cSetInformation); DeclareMajorFunction(c0cSystemControlDispatch); --- 239,243 ---- DeclareMajorFunction(c0cInternalIoControl); DeclareMajorFunction(c0cCleanup); ! DeclareMajorFunction(c0cFileInformation); DeclareMajorFunction(c0cSystemControlDispatch); |
From: Vyacheslav F. <vf...@us...> - 2005-09-27 16:41:09
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv18768 Modified Files: adddev.c Log Message: Fixed DeviceType Index: adddev.c =================================================================== RCS file: /cvsroot/com0com/com0com/adddev.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** adddev.c 6 Sep 2005 07:23:44 -0000 1.9 --- adddev.c 27 Sep 2005 16:41:01 -0000 1.10 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.10 2005/09/27 16:41:01 vfrolov + * Fixed DeviceType + * * Revision 1.9 2005/09/06 07:23:44 vfrolov * Implemented overrun emulation *************** *** 364,368 **** sizeof(*pDevExt), &ntDeviceName, ! FILE_DEVICE_BUS_EXTENDER, FILE_DEVICE_SECURE_OPEN, TRUE, --- 367,371 ---- sizeof(*pDevExt), &ntDeviceName, ! FILE_DEVICE_SERIAL_PORT, FILE_DEVICE_SECURE_OPEN, TRUE, |
From: Vyacheslav F. <vf...@us...> - 2005-09-14 13:15:04
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11815 Modified Files: io.c Log Message: Fixed possible tick loss Index: io.c =================================================================== RCS file: /cvsroot/com0com/com0com/io.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** io.c 14 Sep 2005 10:42:38 -0000 1.15 --- io.c 14 Sep 2005 13:14:47 -0000 1.16 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.16 2005/09/14 13:14:47 vfrolov + * Fixed possible tick loss + * * Revision 1.15 2005/09/14 10:42:38 vfrolov * Implemented SERIAL_EV_TXEMPTY *************** *** 478,482 **** wasWrite = FALSE; ! for (firstWrite = TRUE ; !pWriteLimit || *pWriteLimit ; firstWrite = FALSE) { NTSTATUS statusWrite; PDRIVER_CANCEL pCancelRoutineWrite; --- 481,485 ---- wasWrite = FALSE; ! for (firstWrite = TRUE ;; firstWrite = FALSE) { NTSTATUS statusWrite; PDRIVER_CANCEL pCancelRoutineWrite; *************** *** 505,509 **** pIrpWrite->IoStatus.Information = 0; statusWrite = STATUS_SUCCESS; ! } else { if (statusRead == STATUS_PENDING) ReadWriteDirect( --- 508,514 ---- pIrpWrite->IoStatus.Information = 0; statusWrite = STATUS_SUCCESS; ! } ! else ! if (!pWriteLimit || *pWriteLimit) { if (statusRead == STATUS_PENDING) ReadWriteDirect( |
From: Vyacheslav F. <vf...@us...> - 2005-09-14 10:42:47
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10605 Modified Files: io.c Log Message: Implemented SERIAL_EV_TXEMPTY Index: io.c =================================================================== RCS file: /cvsroot/com0com/com0com/io.c,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** io.c 13 Sep 2005 14:56:16 -0000 1.14 --- io.c 14 Sep 2005 10:42:38 -0000 1.15 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.15 2005/09/14 10:42:38 vfrolov + * Implemented SERIAL_EV_TXEMPTY + * * Revision 1.14 2005/09/13 14:56:16 vfrolov * Implemented IRP_MJ_FLUSH_BUFFERS *************** *** 457,461 **** PIRP pIrpRead; SIZE_T doneRead; ! BOOLEAN firstWrite; if (startRead) { --- 460,464 ---- PIRP pIrpRead; SIZE_T doneRead; ! BOOLEAN firstWrite, wasWrite; if (startRead) { *************** *** 473,476 **** --- 476,481 ---- statusRead = STATUS_SUCCESS; + wasWrite = FALSE; + for (firstWrite = TRUE ; !pWriteLimit || *pWriteLimit ; firstWrite = FALSE) { NTSTATUS statusWrite; *************** *** 480,484 **** if(startWrite) { ! pIrpWrite = pQueueWrite->pCurrent; pCancelRoutineWrite = NULL; } else { --- 485,489 ---- if(startWrite) { ! pIrpWrite = firstWrite ? pQueueWrite->pCurrent : NULL; pCancelRoutineWrite = NULL; } else { *************** *** 486,491 **** } ! if (!pIrpWrite) break; statusWrite = STATUS_PENDING; --- 491,501 ---- } ! if (!pIrpWrite) { ! if (wasWrite && pIoPortWrite->waitMask & SERIAL_EV_TXEMPTY) { ! pIoPortWrite->eventMask |= SERIAL_EV_TXEMPTY; ! WaitComplete(pIoPortWrite, pQueueToComplete); ! } break; + } statusWrite = STATUS_PENDING; *************** *** 512,517 **** } ! if (pWriteDelay) ! pWriteDelay->sentFrames += doneWrite; } --- 522,531 ---- } ! if (doneWrite) { ! wasWrite = TRUE; ! ! if (pWriteDelay) ! pWriteDelay->sentFrames += doneWrite; ! } } *************** *** 520,524 **** if (status == STATUS_PENDING) status = FdoPortSetIrpTimeout(pIoPortWrite->pDevExt, pIrpWrite); ! break; } --- 534,538 ---- if (status == STATUS_PENDING) status = FdoPortSetIrpTimeout(pIoPortWrite->pDevExt, pIrpWrite); ! continue; } |
From: Vyacheslav F. <vf...@us...> - 2005-09-13 14:56:27
|
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 |
From: Vyacheslav F. <vf...@us...> - 2005-09-13 08:55:48
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24982 Modified Files: io.c trace.c trace.h trace.reg Log Message: Disabled modem status tracing by default Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/trace.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** trace.c 9 Sep 2005 15:21:32 -0000 1.12 --- trace.c 13 Sep 2005 08:55:41 -0000 1.13 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.13 2005/09/13 08:55:41 vfrolov + * Disabled modem status tracing by default + * * Revision 1.12 2005/09/09 15:21:32 vfrolov * Added additional flushing for saved strings *************** *** 93,96 **** --- 96,100 ---- ULONG getCommStatus; ULONG getModemStatus; + ULONG modemStatus; } traceEnable; /********************************************************************/ *************** *** 150,154 **** NTSTATUS status; UNICODE_STRING traceRegistryPath; ! RTL_QUERY_REGISTRY_TABLE queryTable[7]; ULONG zero = 0; --- 154,158 ---- NTSTATUS status; UNICODE_STRING traceRegistryPath; ! RTL_QUERY_REGISTRY_TABLE queryTable[8]; ULONG zero = 0; *************** *** 210,213 **** --- 214,224 ---- queryTable[5].DefaultLength = sizeof(ULONG); + queryTable[6].Flags = RTL_QUERY_REGISTRY_DIRECT; + queryTable[6].Name = L"ModemStatus"; + queryTable[6].EntryContext = &traceEnable.modemStatus; + queryTable[6].DefaultType = REG_DWORD; + queryTable[6].DefaultData = &zero; + queryTable[6].DefaultLength = sizeof(ULONG); + status = RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, *************** *** 1082,1085 **** --- 1093,1111 ---- } + VOID TraceModemStatus(IN PC0C_IO_PORT pIoPort) + { + if (!TRACE_FILE_OK) + return; + + if (!traceEnable.modemStatus) + return; + + TraceMask( + (PC0C_COMMON_EXTENSION)pIoPort->pDevExt, + "ModemStatus", + codeNameTableModemStatus, + pIoPort->modemStatus); + } + VOID TraceIrp( IN PCHAR pHead, Index: trace.h =================================================================== RCS file: /cvsroot/com0com/com0com/trace.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** trace.h 6 Sep 2005 06:49:39 -0000 1.4 --- trace.h 13 Sep 2005 08:55:41 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2005/09/13 08:55:41 vfrolov + * Disabled modem status tracing by default + * * Revision 1.4 2005/09/06 06:49:39 vfrolov * Added codeNameTableErrors[] *************** *** 91,94 **** --- 94,99 ---- IN ULONG mask); + VOID TraceModemStatus(IN PC0C_IO_PORT pIoPort); + VOID TraceIrp( IN PCHAR pHead, *************** *** 126,129 **** --- 131,135 ---- #define TraceCode(a1, a2, a3, a4, a5) #define TraceMask(a1, a2, a3, a4) + #define TraceModemStatus(a1) #define TraceIrp(a1, a2, a3, a4) Index: trace.reg =================================================================== RCS file: /cvsroot/com0com/com0com/trace.reg,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** trace.reg 30 Aug 2005 13:12:04 -0000 1.3 --- trace.reg 13 Sep 2005 08:55:41 -0000 1.4 *************** *** 11,12 **** --- 11,13 ---- "GetCommStatus"=dword:00000000 "GetModemStatus"=dword:00000000 + "ModemStatus"=dword:00000000 Index: io.c =================================================================== RCS file: /cvsroot/com0com/com0com/io.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** io.c 6 Sep 2005 07:23:44 -0000 1.12 --- io.c 13 Sep 2005 08:55:41 -0000 1.13 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.13 2005/09/13 08:55:41 vfrolov + * Disabled modem status tracing by default + * * Revision 1.12 2005/09/06 07:23:44 vfrolov * Implemented overrun emulation *************** *** 569,581 **** pIoPort->modemStatus &= ~bits; - TraceMask( - (PC0C_COMMON_EXTENSION)pIoPort->pDevExt, - "ModemStatus", - codeNameTableModemStatus, - pIoPort->modemStatus); - modemStatusChanged = modemStatusOld ^ pIoPort->modemStatus; if (modemStatusChanged) { if (pIoPort->escapeChar) { NTSTATUS status; --- 572,580 ---- pIoPort->modemStatus &= ~bits; modemStatusChanged = modemStatusOld ^ pIoPort->modemStatus; if (modemStatusChanged) { + TraceModemStatus(pIoPort); + if (pIoPort->escapeChar) { NTSTATUS status; |
From: Vyacheslav F. <vf...@us...> - 2005-09-09 15:21:44
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15213 Modified Files: trace.c Log Message: Added additional flushing for saved strings Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/trace.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** trace.c 6 Sep 2005 06:58:20 -0000 1.11 --- trace.c 9 Sep 2005 15:21:32 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2005/09/09 15:21:32 vfrolov + * Added additional flushing for saved strings + * * Revision 1.11 2005/09/06 06:58:20 vfrolov * Added SERIAL_STATUS.Errors tracing *************** *** 798,802 **** OBJECT_ATTRIBUTES objectAttributes; IO_STATUS_BLOCK ioStatusBlock; - TIME_FIELDS timeFields; static CHAR strOld[500]; --- 801,804 ---- *************** *** 804,813 **** static LONG strOldFreeInd = 0; - GetTimeFields(&timeFields); - if (KeGetCurrentIrql() != PASSIVE_LEVEL) { SIZE_T size; KIRQL oldIrql; PCHAR pDestStr; KeAcquireSpinLock(&strOldLock, &oldIrql); --- 806,819 ---- static LONG strOldFreeInd = 0; if (KeGetCurrentIrql() != PASSIVE_LEVEL) { SIZE_T size; KIRQL oldIrql; PCHAR pDestStr; + TIME_FIELDS timeFields; + + if (!pStr) + return; + + GetTimeFields(&timeFields); KeAcquireSpinLock(&strOldLock, &oldIrql); *************** *** 898,905 **** } ! pDestStr = AnsiStrCopyTimeFields(pDestStr, &size, &timeFields); ! pDestStr = AnsiStrFormat(pDestStr, &size, " %s\r\n", pStr); ! TraceWrite(pIoObject, handle, pBuf->buf); FreeTraceBuf(pBuf); --- 904,917 ---- } ! if (pStr) { ! TIME_FIELDS timeFields; ! GetTimeFields(&timeFields); ! ! pDestStr = AnsiStrCopyTimeFields(pDestStr, &size, &timeFields); ! pDestStr = AnsiStrFormat(pDestStr, &size, " %s\r\n", pStr); ! ! TraceWrite(pIoObject, handle, pBuf->buf); ! } FreeTraceBuf(pBuf); *************** *** 1084,1087 **** --- 1096,1100 ---- ULONG_PTR inform; ULONG major; + ULONG disabled; if (!TRACE_FILE_OK) *************** *** 1090,1120 **** pIrpStack = IoGetCurrentIrpStackLocation(pIrp); major = pIrpStack->MajorFunction; switch (major) { case IRP_MJ_WRITE: ! if (!traceEnable.write) ! return; break; case IRP_MJ_READ: ! if (!traceEnable.read) ! return; break; case IRP_MJ_DEVICE_CONTROL: switch (pIrpStack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_SERIAL_GET_TIMEOUTS: ! if (!traceEnable.getTimeouts) ! return; break; case IOCTL_SERIAL_SET_TIMEOUTS: ! if (!traceEnable.setTimeouts) ! return; break; case IOCTL_SERIAL_GET_COMMSTATUS: ! if (!traceEnable.getCommStatus) ! return; break; case IOCTL_SERIAL_GET_MODEMSTATUS: ! if (!traceEnable.getModemStatus) ! return; break; } --- 1103,1128 ---- pIrpStack = IoGetCurrentIrpStackLocation(pIrp); major = pIrpStack->MajorFunction; + disabled = FALSE; switch (major) { case IRP_MJ_WRITE: ! disabled = !traceEnable.write; break; case IRP_MJ_READ: ! disabled = !traceEnable.read; break; case IRP_MJ_DEVICE_CONTROL: switch (pIrpStack->Parameters.DeviceIoControl.IoControlCode) { case IOCTL_SERIAL_GET_TIMEOUTS: ! disabled = !traceEnable.getTimeouts; break; case IOCTL_SERIAL_SET_TIMEOUTS: ! disabled = !traceEnable.setTimeouts; break; case IOCTL_SERIAL_GET_COMMSTATUS: ! disabled = !traceEnable.getCommStatus; break; case IOCTL_SERIAL_GET_MODEMSTATUS: ! disabled = !traceEnable.getModemStatus; break; } *************** *** 1122,1125 **** --- 1130,1140 ---- } + pDevExt = pIrpStack->DeviceObject->DeviceExtension; + + if (disabled) { + TraceOutput(pDevExt, NULL); + return; + } + pBuf = AllocTraceBuf(); if (!pBuf) *************** *** 1128,1132 **** pDestStr = pBuf->buf; - pDevExt = pIrpStack->DeviceObject->DeviceExtension; pDestStr = AnsiStrCopyHead(pDestStr, &size, pDevExt, pHead); --- 1143,1146 ---- |
From: Vyacheslav F. <vf...@us...> - 2005-09-06 07:23:56
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15598 Modified Files: adddev.c bufutils.c bufutils.h com0com.h io.c ioctl.c openclos.c read.c startirp.c write.c Log Message: Implemented overrun emulation Index: bufutils.c =================================================================== RCS file: /cvsroot/com0com/com0com/bufutils.c,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bufutils.c 25 Aug 2005 15:38:17 -0000 1.1 --- bufutils.c 6 Sep 2005 07:23:44 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2005/08/25 15:38:17 vfrolov * Some code moved from io.c to bufutils.c * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.1 2005/08/25 15:38:17 vfrolov * Some code moved from io.c to bufutils.c * */ *************** *** 242,245 **** --- 244,264 ---- } + VOID WriteMandatoryToBuffer(PC0C_BUFFER pBuf, UCHAR mandatoryChar) + { + if ((SIZE_T)(pBuf->pEnd - pBuf->pBase) <= pBuf->busy) { + if (pBuf->pBase) { + if (pBuf->pFree == pBuf->pBase) + *(pBuf->pEnd - 1) = mandatoryChar; + else + *(pBuf->pFree - 1) = mandatoryChar; + } + } else { + pBuf->busy++; + *pBuf->pFree = mandatoryChar; + if (++pBuf->pFree == pBuf->pEnd) + pBuf->pFree = pBuf->pBase; + } + } + NTSTATUS WriteRawDataToBuffer(PC0C_RAW_DATA pRawData, PC0C_BUFFER pBuf) { *************** *** 290,296 **** } - if (status == STATUS_PENDING) - status = MoveRawData(&pBuf->insertData, pRawData); - return status; } --- 309,312 ---- Index: openclos.c =================================================================== RCS file: /cvsroot/com0com/com0com/openclos.c,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** openclos.c 14 May 2005 17:07:02 -0000 1.5 --- openclos.c 6 Sep 2005 07:23:44 -0000 1.6 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.5 2005/05/14 17:07:02 vfrolov * Implemented SERIAL_LSRMST_MST insertion *************** *** 35,39 **** * Initial revision * - * */ --- 38,41 ---- *************** *** 83,86 **** --- 85,89 ---- pDevExt->pIoPortLocal->readBuf = readBufNew; + pDevExt->pIoPortLocal->errors = 0; pDevExt->pIoPortLocal->waitMask = 0; pDevExt->pIoPortLocal->eventMask = 0; Index: ioctl.c =================================================================== RCS file: /cvsroot/com0com/com0com/ioctl.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** ioctl.c 23 Aug 2005 15:49:21 -0000 1.7 --- ioctl.c 6 Sep 2005 07:23:44 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.7 2005/08/23 15:49:21 vfrolov * Implemented baudrate emulation *************** *** 41,45 **** * Initial revision * - * */ --- 44,47 ---- *************** *** 57,64 **** KIRQL oldIrql; - status = STATUS_SUCCESS; pIrp->IoStatus.Information = 0; ! switch (code) { case IOCTL_SERIAL_SET_RTS: case IOCTL_SERIAL_CLR_RTS: --- 59,72 ---- KIRQL oldIrql; pIrp->IoStatus.Information = 0; ! if ((pDevExt->handFlow.ControlHandShake & SERIAL_ERROR_ABORT) && ! pDevExt->pIoPortLocal->errors && code != IOCTL_SERIAL_GET_COMMSTATUS) ! { ! status = STATUS_CANCELLED; ! } else { ! status = STATUS_SUCCESS; ! ! switch (code) { case IOCTL_SERIAL_SET_RTS: case IOCTL_SERIAL_CLR_RTS: *************** *** 179,183 **** KeAcquireSpinLock(pDevExt->pIoLock, &oldIrql); RtlZeroMemory(pSysBuf, sizeof(*pSysBuf)); ! pSysBuf->AmountInInQueue = (ULONG)pDevExt->pIoPortLocal->readBuf.busy; KeReleaseSpinLock(pDevExt->pIoLock, oldIrql); pIrp->IoStatus.Information = sizeof(SERIAL_STATUS); --- 187,195 ---- KeAcquireSpinLock(pDevExt->pIoLock, &oldIrql); RtlZeroMemory(pSysBuf, sizeof(*pSysBuf)); ! pSysBuf->AmountInInQueue = ! (ULONG)pDevExt->pIoPortLocal->readBuf.busy + ! (ULONG)pDevExt->pIoPortLocal->readBuf.insertData.size; ! pSysBuf->Errors = pDevExt->pIoPortLocal->errors; ! pDevExt->pIoPortLocal->errors = 0; KeReleaseSpinLock(pDevExt->pIoLock, oldIrql); pIrp->IoStatus.Information = sizeof(SERIAL_STATUS); *************** *** 520,523 **** --- 532,536 ---- default: status = STATUS_INVALID_PARAMETER; + } } Index: com0com.h =================================================================== RCS file: /cvsroot/com0com/com0com/com0com.h,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** com0com.h 23 Aug 2005 15:49:21 -0000 1.11 --- com0com.h 6 Sep 2005 07:23:44 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.11 2005/08/23 15:49:21 vfrolov * Implemented baudrate emulation *************** *** 53,57 **** * Initial revision * - * */ --- 56,59 ---- *************** *** 148,151 **** --- 150,154 ---- struct _C0C_ADAPTIVE_DELAY *pWriteDelay; + ULONG errors; ULONG waitMask; ULONG eventMask; *************** *** 160,163 **** --- 163,168 ---- C0C_BUFFER readBuf; + + BOOLEAN emuOverrun; } C0C_IO_PORT, *PC0C_IO_PORT; *************** *** 255,258 **** --- 260,264 ---- IN PC0C_FDOPORT_START_ROUTINE pStartRoutine); + VOID CancelQueue(PC0C_IRP_QUEUE pQueue, PLIST_ENTRY pQueueToComplete); VOID FdoPortCancelQueue(IN PC0C_FDOPORT_EXTENSION pDevExt, IN PC0C_IRP_QUEUE pQueue); VOID FdoPortCancelQueues(IN PC0C_FDOPORT_EXTENSION pDevExt); Index: startirp.c =================================================================== RCS file: /cvsroot/com0com/com0com/startirp.c,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** startirp.c 24 Aug 2005 12:50:40 -0000 1.3 --- startirp.c 6 Sep 2005 07:23:44 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.3 2005/08/24 12:50:40 vfrolov * Fixed IRP processing order *************** *** 29,33 **** * Initial revision * - * */ --- 32,35 ---- *************** *** 90,99 **** } ! VOID FdoPortCancelRoutine(IN PC0C_FDOPORT_EXTENSION pDevExt, IN PIRP pIrp) { PC0C_IRP_STATE pState; KIRQL oldIrql; PC0C_IRP_QUEUE pQueue; pState = GetIrpState(pIrp); HALT_UNLESS(pState); --- 92,105 ---- } ! VOID CancelRoutine(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) { + PC0C_FDOPORT_EXTENSION pDevExt; PC0C_IRP_STATE pState; KIRQL oldIrql; PC0C_IRP_QUEUE pQueue; + IoReleaseCancelSpinLock(pIrp->CancelIrql); + + pDevExt = pDevObj->DeviceExtension; pState = GetIrpState(pIrp); HALT_UNLESS(pState); *************** *** 120,147 **** } ! VOID CancelRoutine(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) { ! IoReleaseCancelSpinLock(pIrp->CancelIrql); ! FdoPortCancelRoutine(pDevObj->DeviceExtension, pIrp); ! } ! VOID DoCancelRoutine( ! IN PC0C_FDOPORT_EXTENSION pDevExt, ! IN PIRP pIrp, ! IN PKIRQL pOldIrql) ! { ! PDRIVER_CANCEL pCancelRoutine; ! #pragma warning(push, 3) ! pCancelRoutine = IoSetCancelRoutine(pIrp, NULL); ! #pragma warning(pop) ! if (pCancelRoutine) { ! HALT_UNLESS(pCancelRoutine == CancelRoutine); ! pIrp->Cancel = TRUE; ! KeReleaseSpinLock(pDevExt->pIoLock, *pOldIrql); ! FdoPortCancelRoutine(pDevExt, pIrp); ! KeAcquireSpinLock(pDevExt->pIoLock, pOldIrql); } } --- 126,148 ---- } ! VOID CancelQueue(PC0C_IRP_QUEUE pQueue, PLIST_ENTRY pQueueToComplete) { ! while (pQueue->pCurrent) { ! PDRIVER_CANCEL pCancelRoutine; ! PIRP pIrp; ! pIrp = pQueue->pCurrent; ! #pragma warning(push, 3) ! pCancelRoutine = IoSetCancelRoutine(pIrp, NULL); ! #pragma warning(pop) ! ShiftQueue(pQueue); ! if (pCancelRoutine) { ! pIrp->IoStatus.Status = STATUS_CANCELLED; ! pIrp->IoStatus.Information = 0; ! InsertTailList(pQueueToComplete, &pIrp->Tail.Overlay.ListEntry); ! } } } *************** *** 149,177 **** VOID FdoPortCancelQueue(IN PC0C_FDOPORT_EXTENSION pDevExt, IN PC0C_IRP_QUEUE pQueue) { KIRQL oldIrql; ! KeAcquireSpinLock(pDevExt->pIoLock, &oldIrql); ! ! while (!IsListEmpty(&pQueue->queue)) { ! PC0C_IRP_STATE pState; ! PIRP pIrp; ! PLIST_ENTRY pListEntry; ! ! pListEntry = RemoveHeadList(&pQueue->queue); ! pIrp = CONTAINING_RECORD(pListEntry, IRP, Tail.Overlay.ListEntry); ! ! pState = GetIrpState(pIrp); ! ! HALT_UNLESS(pState); ! ! pState->flags &= ~C0C_IRP_FLAG_IN_QUEUE; ! DoCancelRoutine(pDevExt, pIrp, &oldIrql); ! } ! if (pQueue->pCurrent) ! DoCancelRoutine(pDevExt, pQueue->pCurrent, &oldIrql); KeReleaseSpinLock(pDevExt->pIoLock, oldIrql); } --- 150,165 ---- VOID FdoPortCancelQueue(IN PC0C_FDOPORT_EXTENSION pDevExt, IN PC0C_IRP_QUEUE pQueue) { + LIST_ENTRY queueToComplete; KIRQL oldIrql; ! InitializeListHead(&queueToComplete); ! KeAcquireSpinLock(pDevExt->pIoLock, &oldIrql); ! CancelQueue(pQueue, &queueToComplete); KeReleaseSpinLock(pDevExt->pIoLock, oldIrql); + + FdoPortCompleteQueue(&queueToComplete); } Index: bufutils.h =================================================================== RCS file: /cvsroot/com0com/com0com/bufutils.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** bufutils.h 25 Aug 2005 15:38:17 -0000 1.1 --- bufutils.h 6 Sep 2005 07:23:44 -0000 1.2 *************** *** 20,27 **** * * $Log$ * Revision 1.1 2005/08/25 15:38:17 vfrolov * Some code moved from io.c to bufutils.c * - * */ --- 20,29 ---- * * $Log$ + * Revision 1.2 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.1 2005/08/25 15:38:17 vfrolov * Some code moved from io.c to bufutils.c * */ *************** *** 29,32 **** --- 31,35 ---- #define _C0C_BUFUTILS_H_ + NTSTATUS MoveRawData(PC0C_RAW_DATA pDstRawData, PC0C_RAW_DATA pSrcRawData); VOID CopyCharsWithEscape( PC0C_BUFFER pBuf, UCHAR escapeChar, *************** *** 37,40 **** --- 40,44 ---- SIZE_T ReadFromBuffer(PC0C_BUFFER pBuf, PVOID pRead, SIZE_T readLength); SIZE_T WriteToBuffer(PC0C_BUFFER pBuf, PVOID pWrite, SIZE_T writeLength, UCHAR escapeChar); + VOID WriteMandatoryToBuffer(PC0C_BUFFER pBuf, UCHAR mandatoryChar); NTSTATUS WriteRawDataToBuffer(PC0C_RAW_DATA pRawData, PC0C_BUFFER pBuf); SIZE_T WriteRawData(PC0C_RAW_DATA pRawData, PNTSTATUS pStatus, PVOID pReadBuf, SIZE_T readLength); Index: adddev.c =================================================================== RCS file: /cvsroot/com0com/com0com/adddev.c,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** adddev.c 23 Aug 2005 15:49:21 -0000 1.8 --- adddev.c 6 Sep 2005 07:23:44 -0000 1.9 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.8 2005/08/23 15:49:21 vfrolov * Implemented baudrate emulation *************** *** 44,48 **** * Initial revision * - * */ --- 47,50 ---- *************** *** 101,105 **** PDEVICE_OBJECT pNewDevObj; PC0C_FDOPORT_EXTENSION pDevExt = NULL; ! ULONG emuBR = 0; WCHAR propertyBuffer[255]; PWCHAR pPortName; --- 103,107 ---- PDEVICE_OBJECT pNewDevObj; PC0C_FDOPORT_EXTENSION pDevExt = NULL; ! ULONG emuBR, emuOverrun; WCHAR propertyBuffer[255]; PWCHAR pPortName; *************** *** 172,177 **** } if (NT_SUCCESS(status)) { ! RTL_QUERY_REGISTRY_TABLE queryTable[2]; ULONG zero = 0; --- 174,181 ---- } + emuBR = emuOverrun = 0; + if (NT_SUCCESS(status)) { ! RTL_QUERY_REGISTRY_TABLE queryTable[3]; ULONG zero = 0; *************** *** 185,188 **** --- 189,199 ---- queryTable[0].DefaultLength = sizeof(ULONG); + queryTable[1].Flags = RTL_QUERY_REGISTRY_DIRECT; + queryTable[1].Name = L"EmuOverrun"; + queryTable[1].EntryContext = &emuOverrun; + queryTable[1].DefaultType = REG_DWORD; + queryTable[1].DefaultData = &zero; + queryTable[1].DefaultLength = sizeof(ULONG); + RtlQueryRegistryValues( RTL_REGISTRY_ABSOLUTE, *************** *** 238,242 **** --- 249,266 ---- if (NT_SUCCESS(AllocWriteDelay(pDevExt))) Trace0((PC0C_COMMON_EXTENSION)pDevExt, L"Enabled baudrate emulation"); + else + SysLog(pPhDevObj, status, L"AddFdoPort AllocWriteDelay FAIL"); + } else { + Trace0((PC0C_COMMON_EXTENSION)pDevExt, L"Disabled baudrate emulation"); } + + if (emuOverrun) { + pDevExt->pIoPortLocal->emuOverrun = TRUE; + Trace0((PC0C_COMMON_EXTENSION)pDevExt, L"Enabled overrun emulation"); + } else { + pDevExt->pIoPortLocal->emuOverrun = FALSE; + Trace0((PC0C_COMMON_EXTENSION)pDevExt, L"Disabled overrun emulation"); + } + AllocTimeouts(pDevExt); Index: io.c =================================================================== RCS file: /cvsroot/com0com/com0com/io.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** io.c 26 Aug 2005 08:35:05 -0000 1.11 --- io.c 6 Sep 2005 07:23:44 -0000 1.12 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.11 2005/08/26 08:35:05 vfrolov * Fixed unwanted interference to baudrate emulation by read operations *************** *** 53,57 **** * Initial revision * - * */ --- 56,59 ---- *************** *** 145,148 **** --- 147,200 ---- } + VOID AlertOverrun(PC0C_IO_PORT pReadIoPort, PLIST_ENTRY pQueueToComplete) + { + pReadIoPort->errors |= SERIAL_ERROR_QUEUEOVERRUN; + + if (pReadIoPort->pDevExt->handFlow.FlowReplace & SERIAL_ERROR_CHAR) + WriteMandatoryToBuffer(&pReadIoPort->readBuf, pReadIoPort->pDevExt->specialChars.ErrorChar); + + if (pReadIoPort->pDevExt->handFlow.ControlHandShake & SERIAL_ERROR_ABORT) { + CancelQueue(&pReadIoPort->irpQueues[C0C_QUEUE_READ], pQueueToComplete); + CancelQueue(&pReadIoPort->irpQueues[C0C_QUEUE_WRITE], pQueueToComplete); + } + } + + NTSTATUS WriteOverrun( + PIRP pIrp, + PC0C_IO_PORT pReadIoPort, + PLIST_ENTRY pQueueToComplete, + PSIZE_T pWriteLimit, + PSIZE_T pWriteDone) + { + NTSTATUS status; + SIZE_T writeLength, information; + SIZE_T writeDone; + + writeLength = IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length; + information = pIrp->IoStatus.Information; + writeDone = writeLength - information; + + if (pWriteLimit && writeDone > *pWriteLimit) + writeDone = *pWriteLimit; + + if (writeDone) { + *pWriteDone += writeDone; + information += writeDone; + pIrp->IoStatus.Information = information; + + if (pWriteLimit) + *pWriteLimit -= writeDone; + + AlertOverrun(pReadIoPort, pQueueToComplete); + } + + if (information == writeLength) + status = STATUS_SUCCESS; + else + status = STATUS_PENDING; + + return status; + } + VOID ReadWriteDirect( PIRP pIrpRead, *************** *** 353,356 **** --- 405,410 ---- HALT_UNLESS(pParam); status = WriteRawDataToBuffer((PC0C_RAW_DATA)pParam, &pIoPort->readBuf); + if (status == STATUS_PENDING && !pIoPort->emuOverrun) + status = MoveRawData(&pIoPort->readBuf.insertData, (PC0C_RAW_DATA)pParam); break; } *************** *** 442,448 **** &doneRead, &doneWrite); ! if (statusWrite == STATUS_PENDING) statusWrite = WriteBuffer(pIrpWrite, pIoPortRead, pQueueToComplete, pWriteLimit, &doneWrite); if (pWriteDelay) pWriteDelay->sentFrames += doneWrite; --- 496,506 ---- &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; *************** *** 521,524 **** --- 579,583 ---- if (modemStatusChanged) { if (pIoPort->escapeChar) { + NTSTATUS status; C0C_RAW_DATA insertData; *************** *** 528,532 **** insertData.data[2] = (UCHAR)(pIoPort->modemStatus | (modemStatusChanged >> 4)); ! FdoPortIo( C0C_IO_TYPE_INSERT, &insertData, --- 587,591 ---- insertData.data[2] = (UCHAR)(pIoPort->modemStatus | (modemStatusChanged >> 4)); ! status = FdoPortIo( C0C_IO_TYPE_INSERT, &insertData, *************** *** 534,541 **** &pIoPort->irpQueues[C0C_QUEUE_READ], pQueueToComplete); ! #if DBG ! if (insertData.size) Trace0((PC0C_COMMON_EXTENSION)pIoPort->pDevExt, L"WARNING: Lost SERIAL_LSRMST_MST"); ! #endif /* DBG */ } --- 593,601 ---- &pIoPort->irpQueues[C0C_QUEUE_READ], pQueueToComplete); ! ! if (status == STATUS_PENDING) { ! AlertOverrun(pIoPort, pQueueToComplete); Trace0((PC0C_COMMON_EXTENSION)pIoPort->pDevExt, L"WARNING: Lost SERIAL_LSRMST_MST"); ! } } Index: write.c =================================================================== RCS file: /cvsroot/com0com/com0com/write.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** write.c 23 Aug 2005 15:49:21 -0000 1.2 --- write.c 6 Sep 2005 07:23:44 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.2 2005/08/23 15:49:21 vfrolov * Implemented baudrate emulation *************** *** 26,30 **** * Initial revision * - * */ --- 29,32 ---- *************** *** 48,59 **** { NTSTATUS status; - PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation(pIrp); pIrp->IoStatus.Information = 0; ! if (pIrpStack->Parameters.Write.Length) ! status = FdoPortStartIrp(pDevExt, pIrp, C0C_QUEUE_WRITE, StartIrpWrite); ! else ! status = STATUS_SUCCESS; if (status != STATUS_PENDING) { --- 50,64 ---- { NTSTATUS status; pIrp->IoStatus.Information = 0; ! if ((pDevExt->handFlow.ControlHandShake & SERIAL_ERROR_ABORT) && pDevExt->pIoPortLocal->errors) { ! status = STATUS_CANCELLED; ! } else { ! if (IoGetCurrentIrpStackLocation(pIrp)->Parameters.Write.Length) ! status = FdoPortStartIrp(pDevExt, pIrp, C0C_QUEUE_WRITE, StartIrpWrite); ! else ! status = STATUS_SUCCESS; ! } if (status != STATUS_PENDING) { Index: read.c =================================================================== RCS file: /cvsroot/com0com/com0com/read.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** read.c 23 Aug 2005 15:49:21 -0000 1.2 --- read.c 6 Sep 2005 07:23:44 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/09/06 07:23:44 vfrolov + * Implemented overrun emulation + * * Revision 1.2 2005/08/23 15:49:21 vfrolov * Implemented baudrate emulation *************** *** 26,30 **** * Initial revision * - * */ --- 29,32 ---- *************** *** 48,59 **** { NTSTATUS status; - PIO_STACK_LOCATION pIrpStack = IoGetCurrentIrpStackLocation(pIrp); pIrp->IoStatus.Information = 0; ! if (pIrpStack->Parameters.Read.Length) ! status = FdoPortStartIrp(pDevExt, pIrp, C0C_QUEUE_READ, StartIrpRead); ! else ! status = STATUS_SUCCESS; if (status != STATUS_PENDING) { --- 50,64 ---- { NTSTATUS status; pIrp->IoStatus.Information = 0; ! if ((pDevExt->handFlow.ControlHandShake & SERIAL_ERROR_ABORT) && pDevExt->pIoPortLocal->errors) { ! status = STATUS_CANCELLED; ! } else { ! if (IoGetCurrentIrpStackLocation(pIrp)->Parameters.Read.Length) ! status = FdoPortStartIrp(pDevExt, pIrp, C0C_QUEUE_READ, StartIrpRead); ! else ! status = STATUS_SUCCESS; ! } if (status != STATUS_PENDING) { |
From: Vyacheslav F. <vf...@us...> - 2005-09-06 06:58:28
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9282 Modified Files: trace.c Log Message: Added SERIAL_STATUS.Errors tracing Added version tracing Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/trace.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** trace.c 30 Aug 2005 13:12:04 -0000 1.10 --- trace.c 6 Sep 2005 06:58:20 -0000 1.11 *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.11 2005/09/06 06:58:20 vfrolov + * Added SERIAL_STATUS.Errors tracing + * Added version tracing + * * Revision 1.10 2005/08/30 13:12:04 vfrolov * Disabled IOCTL_SERIAL_GET_MODEMSTATUS tracing by default *************** *** 52,56 **** * Initial revision * - * */ --- 56,59 ---- *************** *** 59,62 **** --- 62,67 ---- #if DBG + #include "version.h" + /* * FILE_ID used by HALT_UNLESS to put it on BSOD *************** *** 708,711 **** --- 713,721 ---- IN PSERIAL_STATUS pCommStatus) { + pDestStr = AnsiStrCopyStr(pDestStr, pSize, " Errors"); + pDestStr = AnsiStrCopyMask(pDestStr, pSize, + codeNameTableErrors, + pCommStatus->Errors); + return AnsiStrFormat(pDestStr, pSize, " AmountInInQueue=%lu", *************** *** 967,971 **** TraceF(NULL, "===== BEGIN ====="); ! TraceF(NULL, "(" __DATE__ " " __TIME__ ")"); } } --- 977,981 ---- TraceF(NULL, "===== BEGIN ====="); ! TraceF(NULL, "VERSION " C0C_VERSION_STR " (" __DATE__ " " __TIME__ ")"); } } |
From: Vyacheslav F. <vf...@us...> - 2005-09-06 06:49:47
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7909 Modified Files: tracetbl.c trace.h Log Message: Added codeNameTableErrors[] Index: trace.h =================================================================== RCS file: /cvsroot/com0com/com0com/trace.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** trace.h 25 Aug 2005 07:48:39 -0000 1.3 --- trace.h 6 Sep 2005 06:49:39 -0000 1.4 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2005/09/06 06:49:39 vfrolov + * Added codeNameTableErrors[] + * * Revision 1.3 2005/08/25 07:48:39 vfrolov * Changed type of code names from wchar to char *************** *** 106,109 **** --- 109,113 ---- CODE2NAME codeNameTableBusQuery[]; CODE2NAME codeNameTableDeviceText[]; + CODE2NAME codeNameTableErrors[]; FIELD2NAME codeNameTableControlHandShake[]; Index: tracetbl.c =================================================================== RCS file: /cvsroot/com0com/com0com/tracetbl.c,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tracetbl.c 25 Aug 2005 07:48:39 -0000 1.2 --- tracetbl.c 6 Sep 2005 06:49:38 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2005/09/06 06:49:38 vfrolov + * Added codeNameTableErrors[] + * * Revision 1.2 2005/08/25 07:48:39 vfrolov * Changed type of code names from wchar to char *************** *** 266,269 **** --- 269,281 ---- }; + CODE2NAME codeNameTableErrors[] = { + TOCODE2NAME(SERIAL_ERROR_, BREAK), + TOCODE2NAME(SERIAL_ERROR_, FRAMING), + TOCODE2NAME(SERIAL_ERROR_, OVERRUN), + TOCODE2NAME(SERIAL_ERROR_, QUEUEOVERRUN), + TOCODE2NAME(SERIAL_ERROR_, PARITY), + {0, NULL} + }; + #else /* DBG */ #pragma warning(disable:4206) // nonstandard extension used : translation unit is empty |
From: Vyacheslav F. <vf...@us...> - 2005-09-05 16:05:13
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20233 Modified Files: com0com.rc Log Message: Moved version info to version.h Index: com0com.rc =================================================================== RCS file: /cvsroot/com0com/com0com/com0com.rc,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** com0com.rc 1 Sep 2005 13:29:10 -0000 1.6 --- com0com.rc 5 Sep 2005 16:05:03 -0000 1.7 *************** *** 18,21 **** --- 18,32 ---- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * + * + * $Log$ + * Revision 1.7 2005/09/05 16:05:03 vfrolov + * Moved version info to version.h + * + * Revision 1.2 2005/02/01 09:09:28 vfrolov + * Added version info + * + * Revision 1.1 2005/01/26 12:18:54 vfrolov + * Initial revision + * */ *************** *** 23,29 **** #include <ntverp.h> #include "c0clog.rc" ! #define VER_VERSION 1,3,0,0 ! #define VER_VERSION_STR "1.3.0.0" #define VER_PODUCT_NAME_STR "Null-modem emulator" --- 34,41 ---- #include <ntverp.h> #include "c0clog.rc" + #include "version.h" ! #define VER_VERSION C0C_V1,C0C_V2,C0C_V3,C0C_V4 ! #define VER_VERSION_STR C0C_VERSION_STR #define VER_PODUCT_NAME_STR "Null-modem emulator" |
From: Vyacheslav F. <vf...@us...> - 2005-09-05 15:58:41
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17636 Added Files: version.h Log Message: Initial revision --- NEW FILE: version.h --- /* * $Id: version.h,v 1.1 2005/09/05 15:58:34 vfrolov Exp $ * * Copyright (c) 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 * */ #ifndef _C0C_VERSION_H_ #define _C0C_VERSION_H_ #define C0C_V1 1 #define C0C_V2 3 #define C0C_V3 0 #define C0C_V4 1 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 #define MK_VERSION_STR(V1, V2, V3, V4) MK_VERSION_STR1(V1, V2, V3, V4) #define C0C_VERSION_STR MK_VERSION_STR(C0C_V1, C0C_V2, C0C_V3, C0C_V4) #endif /* _C0C_VERSION_H_ */ |
From: Vyacheslav F. <vf...@us...> - 2005-09-02 09:55:07
|
Update of /cvsroot/com0com/homepage In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5375 Modified Files: index.html Log Message: Added com2tcp Added other changes Index: index.html =================================================================== RCS file: /cvsroot/com0com/homepage/index.html,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** index.html 2 Jun 2005 15:55:20 -0000 1.2 --- index.html 2 Sep 2005 09:54:59 -0000 1.3 *************** *** 4,8 **** <meta content="text/html; charset=windows-1251" http-equiv="content-type"> ! <title>Null-modem emulator (com0com)</title> </head> <body> --- 4,8 ---- <meta content="text/html; charset=windows-1251" http-equiv="content-type"> ! <title>Null-modem emulator (com0com) - virtual serial port driver for Windows</title> </head> <body> *************** *** 12,36 **** </center> <p> ! The null-modem emulator is a kernel-mode virtual serial port driver for ! Windows. You can create with it 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. </p> <p> ! 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. </p> <p> For example, to send/receive faxes over IP you can connect Windows ! Fax application to CNCA0 port and t38modem (part of the <a href="http://openh323.sourceforge.net/"> OpenH323 project</a> ! ) to CNCB0 port. </p> <p>You can find more information in ! <a href="http://cvs.sourceforge.net/viewcvs.py/*checkout*/com0com/com0com/ReadMe.txt"> ! ReadMe.txt</a> and on <a href="http://sourceforge.net/projects/com0com/">SourceForge Project --- 12,46 ---- </center> <p> ! The Null-modem emulator is an open source kernel-mode virtual serial port driver for ! Windows, available freely under GPL license. </p> <p> ! The Null-modem emulator allows you to create an unlimited number of virtual COM port ! pairs and use any pair to connect one COM port based application to another. ! Each COM port pair provides two COM ports. ! The output to one port is the input from other ! port and vice versa. </p> <p> + The Null-modem emulator can be used to provide serial interface for device emulators. + In this case the device emulation program uses one port of the pair and + the other port can be used by Windows or DOS application that + requires a COM port to communicate with the device. For example, to send/receive faxes over IP you can connect Windows ! Fax application to t38modem ("T38FAX Pseudo Modem", part of the <a href="http://openh323.sourceforge.net/"> OpenH323 project</a> ! ) via virtual COM port pair. ! </p> ! <p> ! The Null-modem emulator can be used to provide serial interface for COM port redirectors. ! For example, with com2tcp ("COM port to TCP redirector", part of the ! <a href="http://sourceforge.net/projects/com0com/">com0com</a> ! project) you can communicate via serial interface with the TCP/IP servers. </p> <p>You can find more information in ! <a href="http://cvs.sourceforge.net/viewcvs.py/*checkout*/com0com/com0com/ReadMe.txt?rev=RELEASED"> ! ReadMe.txt for com0com</a>, ! <a href="http://cvs.sourceforge.net/viewcvs.py/*checkout*/com0com/com2tcp/ReadMe.txt?rev=RELEASED"> ! ReadMe.txt for com2tcp</a> and on <a href="http://sourceforge.net/projects/com0com/">SourceForge Project |
From: Vyacheslav F. <vf...@us...> - 2005-09-01 13:29:21
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv636 Modified Files: com0com.rc Log Message: Changed version Removed changes log Index: com0com.rc =================================================================== RCS file: /cvsroot/com0com/com0com/com0com.rc,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** com0com.rc 14 Jul 2005 16:06:23 -0000 1.5 --- com0com.rc 1 Sep 2005 13:29:10 -0000 1.6 *************** *** 18,36 **** * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA * - * - * $Log$ - * Revision 1.5 2005/07/14 16:06:23 vfrolov - * Changed version - * - * Revision 1.4 2005/06/22 14:59:28 vfrolov - * Changed version - * - * Revision 1.3 2005/05/17 14:23:42 vfrolov - * Changed version - * - * Revision 1.2 2005/02/01 09:09:28 vfrolov - * Added version info - * - * */ --- 18,21 ---- *************** *** 39,44 **** #include "c0clog.rc" ! #define VER_VERSION 1,2,0,0 ! #define VER_VERSION_STR "1.2.0.0" #define VER_PODUCT_NAME_STR "Null-modem emulator" --- 24,29 ---- #include "c0clog.rc" ! #define VER_VERSION 1,3,0,0 ! #define VER_VERSION_STR "1.3.0.0" #define VER_PODUCT_NAME_STR "Null-modem emulator" |
From: Vyacheslav F. <vf...@us...> - 2005-09-01 13:17:29
|
Update of /cvsroot/com0com/com0com In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24131 Modified Files: ReadMe.txt Log Message: Added question about baud rate emulation Index: ReadMe.txt =================================================================== RCS file: /cvsroot/com0com/com0com/ReadMe.txt,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ReadMe.txt 8 Jul 2005 14:03:22 -0000 1.6 --- ReadMe.txt 1 Sep 2005 13:17:18 -0000 1.7 *************** *** 83,89 **** Delete file %SystemRoot%\system32\drivers\com0com.sys ! Find in the %SystemRoot%\inf\ directory the oem{N}.inf file that corresponds to ! the com0com.inf file (the system renames com0com.inf to oem{N}.inf, where {N} ! is a number). Delete oem{N}.inf and oem{N}.PNF files. --- 83,89 ---- Delete file %SystemRoot%\system32\drivers\com0com.sys ! Find in the %SystemRoot%\inf\ directory the oem{N}.inf file(s) that corresponds ! to the com0com.inf file (the system renames com0com.inf to oem{N}.inf, where {N} ! is a number). Delete all found oem{N}.inf and corresponding oem{N}.PNF files. *************** *** 98,99 **** --- 98,107 ---- [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\com0com\Parameters\CNCB0] "PortName"="COM3" + + Q. The baud rate setting does not seem to make a difference: data is always + transferred at the same speed. How to enable the baud rate emulation? + A. To enable baud rate emulation for transferring data from CNCA0 to CNCB0 add + the following to the registry: + + [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\com0com\Parameters\CNCA0] + "EmuBR"=dword:FFFFFFFF |