com0com-cvs Mailing List for Null-modem emulator (Page 4)
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...> - 2011-05-19 16:47:02
|
Update of /cvsroot/com0com/hub4com/plugins/serial In directory vz-cvs-2.sog:/tmp/cvs-serv32284 Modified Files: comport.cpp comport.h Log Message: Fixed unexpected assertion Added human readable printing output options set Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** comport.cpp 14 Sep 2010 16:31:50 -0000 1.25 --- comport.cpp 19 May 2011 16:46:59 -0000 1.26 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.26 2011/05/19 16:46:59 vfrolov + * Fixed unexpected assertion + * Added human readable printing output options set + * * Revision 1.25 2010/09/14 16:31:50 vfrolov * Implemented --write-limit=0 to disable writing to the port *************** *** 219,222 **** --- 223,245 ---- }; /////////////////////////////////////////////////////////////// + static const FIELD2NAME fieldNameTableSetPinState[] = { + TOFIELD2NAME2(PIN_STATE_, RTS), + TOFIELD2NAME2(PIN_STATE_, DTR), + TOFIELD2NAME2(PIN_STATE_, OUT1), + TOFIELD2NAME2(PIN_STATE_, OUT2), + TOFIELD2NAME2(PIN_STATE_, CTS), + TOFIELD2NAME2(PIN_STATE_, DSR), + TOFIELD2NAME2(PIN_STATE_, RI), + TOFIELD2NAME2(PIN_STATE_, DCD), + TOFIELD2NAME2(PIN_STATE_, BREAK), + {0, 0, NULL} + }; + /////////////////////////////////////////////////////////////// + static const FIELD2NAME fieldNameTableSoOptions[] = { + TOFIELD2NAME2(SO_, SET_BR), + TOFIELD2NAME2(SO_, SET_LC), + {0, 0, NULL} + }; + /////////////////////////////////////////////////////////////// static const FIELD2NAME fieldNameTableComEvents[] = { TOFIELD2NAME2(EV_, CTS), *************** *** 290,293 **** --- 313,319 ---- countXoff(0), outOptions(0), + #ifdef _DEBUG + outOptionsRequested(0), + #endif writeQueueLimit(comParams.WriteQueueLimit()), writeQueued(0), *************** *** 439,445 **** } ! cout << name << " Event(s) 0x" << hex << events << dec << " ["; PrintFields(cout, fieldNameTableComEvents, events); ! cout << "] will be monitired" << endl; } --- 465,471 ---- } ! cout << name << " Event(s) ["; PrintFields(cout, fieldNameTableComEvents, events); ! cout << "] will be monitored" << endl; } *************** *** 689,705 **** } case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): ! _ASSERTE((~SO_O2V_PIN_STATE(outOptions) & MASK2VAL(pMsg->u.val)) == 0); if (!pComIo) return FALSE; ! pComIo->SetPinState((WORD)pMsg->u.val, MASK2VAL(pMsg->u.val)); break; case HUB_MSG_T2N(HUB_MSG_TYPE_SET_BR): { ! _ASSERTE(outOptions & SO_SET_BR); if (!pComIo) return FALSE; DWORD oldVal = pComIo->BaudRate(); DWORD curVal = pComIo->SetBaudRate(pMsg->u.val); --- 715,734 ---- } case HUB_MSG_T2N(HUB_MSG_TYPE_SET_PIN_STATE): ! _ASSERTE((~SO_O2V_PIN_STATE(outOptionsRequested) & MASK2VAL(pMsg->u.val)) == 0); if (!pComIo) return FALSE; ! pComIo->SetPinState((WORD)pMsg->u.val, SO_O2V_PIN_STATE(outOptions) & MASK2VAL(pMsg->u.val)); break; case HUB_MSG_T2N(HUB_MSG_TYPE_SET_BR): { ! _ASSERTE(outOptionsRequested & SO_SET_BR); if (!pComIo) return FALSE; + if ((outOptions & SO_SET_BR) == 0) + break; + DWORD oldVal = pComIo->BaudRate(); DWORD curVal = pComIo->SetBaudRate(pMsg->u.val); *************** *** 733,741 **** } case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LC): { ! _ASSERTE(outOptions & SO_SET_LC); if (!pComIo) return FALSE; DWORD oldVal = pComIo->LineControl(); DWORD curVal = pComIo->SetLineControl(pMsg->u.val); --- 762,773 ---- } case HUB_MSG_T2N(HUB_MSG_TYPE_SET_LC): { ! _ASSERTE(outOptionsRequested & SO_SET_LC); if (!pComIo) return FALSE; + if ((outOptions & SO_SET_LC) == 0) + break; + DWORD oldVal = pComIo->LineControl(); DWORD curVal = pComIo->SetLineControl(pMsg->u.val); *************** *** 793,801 **** } case HUB_MSG_T2N(HUB_MSG_TYPE_PURGE_TX): ! _ASSERTE(outOptions & SO_PURGE_TX); if (!pComIo) return FALSE; PurgeWrite(FALSE); FlowControlUpdate(); --- 825,836 ---- } case HUB_MSG_T2N(HUB_MSG_TYPE_PURGE_TX): ! _ASSERTE(outOptionsRequested & SO_PURGE_TX); if (!pComIo) return FALSE; + if ((outOptions & SO_PURGE_TX) == 0) + break; + PurgeWrite(FALSE); FlowControlUpdate(); *************** *** 805,808 **** --- 840,847 ---- return FALSE; + #ifdef _DEBUG + outOptionsRequested |= pMsg->u.val; + #endif + pMsg->u.val &= ~outOptions; *************** *** 843,849 **** if (pMsg->u.val) { ! cerr << name << " WARNING: Requested output option(s) [0x" ! << hex << pMsg->u.val << dec ! << "] will be ignored by driver" << endl; } break; --- 882,890 ---- if (pMsg->u.val) { ! cerr << name << " WARNING: Requested output option(s) ["; ! BOOL delimitNext = FALSE; ! delimitNext = PrintFields(cerr, fieldNameTableSetPinState, SO_O2V_PIN_STATE(pMsg->u.val), delimitNext, "SET_"); ! PrintFields(cerr, fieldNameTableSoOptions, pMsg->u.val & ~SO_V2O_PIN_STATE(-1), delimitNext); ! cerr << "] will be ignored by driver" << endl; } break; *************** *** 941,947 **** void ComPort::OnCommEvent(WaitCommEventOverlapped *pOverlapped, DWORD eMask) { ! //cout << name << " OnCommEvent " << ::GetCurrentThreadId() << endl; ! ! //cout << name << " Event(s): 0x" << hex << eMask << dec << " ["; //PrintFields(cout, fieldNameTableComEvents, eMask); //cout << "]" << endl; --- 982,986 ---- void ComPort::OnCommEvent(WaitCommEventOverlapped *pOverlapped, DWORD eMask) { ! //cout << name << " OnCommEvent " << ::GetCurrentThreadId() << " ["; //PrintFields(cout, fieldNameTableComEvents, eMask); //cout << "]" << endl; Index: comport.h =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.h,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** comport.h 18 Dec 2008 16:50:52 -0000 1.17 --- comport.h 19 May 2011 16:47:00 -0000 1.18 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.18 2011/05/19 16:47:00 vfrolov + * Fixed unexpected assertion + * Added human readable printing output options set + * * Revision 1.17 2008/12/18 16:50:52 vfrolov * Extended the number of possible IN options *************** *** 146,149 **** --- 150,156 ---- DWORD inOptions[2]; DWORD outOptions; + #ifdef _DEBUG + DWORD outOptionsRequested; + #endif DWORD writeQueueLimit; |
From: Vyacheslav F. <vf...@us...> - 2011-05-19 16:34:49
|
Update of /cvsroot/com0com/hub4com/plugins/linectl In directory vz-cvs-2.sog:/tmp/cvs-serv29972 Modified Files: filter.cpp Log Message: Fixed typo Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/linectl/filter.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** filter.cpp 6 Mar 2009 07:56:28 -0000 1.12 --- filter.cpp 19 May 2011 16:34:47 -0000 1.13 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.13 2011/05/19 16:34:47 vfrolov + * Fixed typo + * * Revision 1.12 2009/03/06 07:56:28 vfrolov * Fixed assertion with non ascii chars *************** *** 182,186 **** sizeof(PLUGIN_ABOUT_A), "linectl", ! "Copyright (c) 2008 Vyacheslav Frolov", "GNU General Public License", "Baudrate and line control mapping filter", --- 185,189 ---- sizeof(PLUGIN_ABOUT_A), "linectl", ! "Copyright (c) 2008-2011 Vyacheslav Frolov", "GNU General Public License", "Baudrate and line control mapping filter", *************** *** 270,279 **** HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hToPort != NULL); _ASSERTE(pOutMsg != NULL); --- 273,282 ---- HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hFromPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hFromPort != NULL); _ASSERTE(pOutMsg != NULL); *************** *** 307,311 **** cerr << (const char *)hFilterInstance << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hToPort) << " option(s) GO" << iGo << "_0x" << hex << fail_options << dec << " not accepted" << endl; --- 310,314 ---- cerr << (const char *)hFilterInstance << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hFromPort) << " option(s) GO" << iGo << "_0x" << hex << fail_options << dec << " not accepted" << endl; |
From: Vyacheslav F. <vf...@us...> - 2011-05-19 16:33:36
|
Update of /cvsroot/com0com/hub4com/plugins/pinmap In directory vz-cvs-2.sog:/tmp/cvs-serv29883 Modified Files: filter.cpp Log Message: Fixed typo Added 'on' input state Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/pinmap/filter.cpp,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** filter.cpp 18 May 2010 15:00:36 -0000 1.17 --- filter.cpp 19 May 2011 16:33:34 -0000 1.18 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.18 2011/05/19 16:33:34 vfrolov + * Fixed typo + * Added 'on' input state + * * Revision 1.17 2010/05/18 15:00:36 vfrolov * Added connection counter *************** *** 122,125 **** --- 126,130 ---- #define LM_BREAK ((WORD)1 << 8) #define LM_CONNECT ((WORD)1 << 9) + #define LM_ON ((WORD)1 << 10) #define MST2LM(m) ((WORD)((BYTE)(m))) #define LM2MST(lm) ((BYTE)(lm)) *************** *** 136,139 **** --- 141,145 ---- {"break", LM_BREAK}, {"connect", LM_CONNECT}, + {"on", LM_ON}, }; /////////////////////////////////////////////////////////////// *************** *** 142,146 **** State(HMASTERPORT hMasterPort) : pName(pPortName(hMasterPort)) ! , lmInVal(0) , connectionCounter(0) {} --- 148,152 ---- State(HMASTERPORT hMasterPort) : pName(pPortName(hMasterPort)) ! , lmInVal(LM_ON) , connectionCounter(0) {} *************** *** 267,271 **** sizeof(PLUGIN_ABOUT_A), "pinmap", ! "Copyright (c) 2008-2010 Vyacheslav Frolov", "GNU General Public License", "Pinouts mapping filter", --- 273,277 ---- sizeof(PLUGIN_ABOUT_A), "pinmap", ! "Copyright (c) 2008-2011 Vyacheslav Frolov", "GNU General Public License", "Pinouts mapping filter", *************** *** 294,298 **** << " --break=[!]<s> - wire input state of <s> to output state of BREAK." << endl << endl ! << " The possible values of <s> above can be cts, dsr, dcd, ring, break or" << endl << " connect. The exclamation sign (!) can be used to invert the value. If no any" << endl << " wire option specified, then the options --rts=cts --dtr=dsr are used by" << endl --- 300,304 ---- << " --break=[!]<s> - wire input state of <s> to output state of BREAK." << endl << endl ! << " The possible values of <s> above can be on, cts, dsr, dcd, ring, break or" << endl << " connect. The exclamation sign (!) can be used to invert the value. If no any" << endl << " wire option specified, then the options --rts=cts --dtr=dsr are used by" << endl *************** *** 323,327 **** << " - transfer data and signals between COM1 and COM2." << endl << " " << pProgPath << " --load=,,_END_" << endl ! << " --create-filter=pinmap:--rts=cts" << endl << " --add-filters=0,1:pinmap" << endl << " --octs=off" << endl --- 329,333 ---- << " - transfer data and signals between COM1 and COM2." << endl << " " << pProgPath << " --load=,,_END_" << endl ! << " --create-filter=pinmap:--rts=cts --dtr=on" << endl << " --add-filters=0,1:pinmap" << endl << " --octs=off" << endl *************** *** 329,333 **** << " COM2" << endl << " _END_" << endl ! << " - allow end-to-end RTS/CTS handshaking between COM1 and COM2." << endl << " " << pProgPath << " --load=,,_END_" << endl << " --create-filter=pinmap" << endl --- 335,340 ---- << " COM2" << endl << " _END_" << endl ! << " - allow end-to-end RTS/CTS handshaking between COM1 and COM2" << endl ! << " and raise DTR on both ports." << endl << " " << pProgPath << " --load=,,_END_" << endl << " --create-filter=pinmap" << endl *************** *** 442,451 **** HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hToPort != NULL); _ASSERTE(pOutMsg != NULL); --- 449,458 ---- HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hFromPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hFromPort != NULL); _ASSERTE(pOutMsg != NULL); *************** *** 479,483 **** cerr << ((State *)hFilterInstance)->pName << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hToPort) << " option(s) GO1_0x" << hex << fail_options << dec << " not accepted" << endl; --- 486,490 ---- cerr << ((State *)hFilterInstance)->pName << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hFromPort) << " option(s) GO1_0x" << hex << fail_options << dec << " not accepted" << endl; |
From: Vyacheslav F. <vf...@us...> - 2011-05-19 16:31:14
|
Update of /cvsroot/com0com/hub4com/plugins/purge In directory vz-cvs-2.sog:/tmp/cvs-serv28550 Modified Files: filter.cpp Log Message: Fixed typo Added stream description Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/purge/filter.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** filter.cpp 2 Feb 2009 15:21:42 -0000 1.4 --- filter.cpp 19 May 2011 16:31:12 -0000 1.5 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.5 2011/05/19 16:31:12 vfrolov + * Fixed typo + * Added stream description + * * Revision 1.4 2009/02/02 15:21:42 vfrolov * Optimized filter's API *************** *** 112,116 **** sizeof(PLUGIN_ABOUT_A), "purge", ! "Copyright (c) 2008 Vyacheslav Frolov", "GNU General Public License", "Purge mapping filter", --- 116,120 ---- sizeof(PLUGIN_ABOUT_A), "purge", ! "Copyright (c) 2008-2011 Vyacheslav Frolov", "GNU General Public License", "Purge mapping filter", *************** *** 130,133 **** --- 134,144 ---- << "Options:" << endl << endl + << "OUT method input data stream description:" << endl + << " PURGE_TX - it will be discarded from stream." << endl + << " PURGE_TX_IN - it will force to add PURGE_TX to the stream." << endl + << endl + << "OUT method output data stream description:" << endl + << " PURGE_TX - will be added on detecting PURGE_TX_IN." << endl + << endl << "Examples:" << endl ; *************** *** 186,195 **** HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hToPort != NULL); _ASSERTE(pOutMsg != NULL); --- 197,206 ---- HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hFromPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hFromPort != NULL); _ASSERTE(pOutMsg != NULL); *************** *** 219,223 **** cerr << (const char *)hFilterInstance << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hToPort) << " option(s) GO1_0x" << hex << fail_options << dec << " not accepted" << endl; --- 230,234 ---- cerr << (const char *)hFilterInstance << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hFromPort) << " option(s) GO1_0x" << hex << fail_options << dec << " not accepted" << endl; |
From: Vyacheslav F. <vf...@us...> - 2011-05-19 16:29:15
|
Update of /cvsroot/com0com/hub4com/plugins/lsrmap In directory vz-cvs-2.sog:/tmp/cvs-serv28221 Modified Files: filter.cpp Log Message: Fixed typo Index: filter.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/lsrmap/filter.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** filter.cpp 2 Feb 2009 15:21:42 -0000 1.7 --- filter.cpp 19 May 2011 16:29:13 -0000 1.8 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2011/05/19 16:29:13 vfrolov + * Fixed typo + * * Revision 1.7 2009/02/02 15:21:42 vfrolov * Optimized filter's API *************** *** 118,122 **** sizeof(PLUGIN_ABOUT_A), "lsrmap", ! "Copyright (c) 2008 Vyacheslav Frolov", "GNU General Public License", "LSR mapping filter", --- 121,125 ---- sizeof(PLUGIN_ABOUT_A), "lsrmap", ! "Copyright (c) 2008-2011 Vyacheslav Frolov", "GNU General Public License", "LSR mapping filter", *************** *** 192,201 **** HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hToPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hToPort != NULL); _ASSERTE(pOutMsg != NULL); --- 195,204 ---- HFILTER hFilter, HFILTERINSTANCE hFilterInstance, ! HMASTERPORT hFromPort, HUB_MSG *pOutMsg) { _ASSERTE(hFilter != NULL); _ASSERTE(hFilterInstance != NULL); ! _ASSERTE(hFromPort != NULL); _ASSERTE(pOutMsg != NULL); *************** *** 225,229 **** cerr << (const char *)hFilterInstance << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hToPort) << " option(s) GO1_0x" << hex << fail_options << dec << " not accepted" << endl; --- 228,232 ---- cerr << (const char *)hFilterInstance << " WARNING: Requested by filter " << ((Filter *)hFilter)->FilterName() ! << " for port " << pPortName(hFromPort) << " option(s) GO1_0x" << hex << fail_options << dec << " not accepted" << endl; |
From: Vyacheslav F. <vf...@us...> - 2011-05-19 16:27:51
|
Update of /cvsroot/com0com/hub4com In directory vz-cvs-2.sog:/tmp/cvs-serv28027 Modified Files: version.h Log Message: Post-tagging version change Index: version.h =================================================================== RCS file: /cvsroot/com0com/hub4com/version.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** version.h 10 May 2011 10:31:55 -0000 1.7 --- version.h 19 May 2011 16:27:49 -0000 1.8 *************** *** 28,32 **** #define H4C_V2 0 #define H4C_V3 1 ! #define H4C_V4 0 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 --- 28,32 ---- #define H4C_V2 0 #define H4C_V3 1 ! #define H4C_V4 1 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 |
From: Vyacheslav F. <vf...@us...> - 2011-05-10 10:31:57
|
Update of /cvsroot/com0com/hub4com In directory vz-cvs-2.sog:/tmp/cvs-serv8064 Modified Files: version.h Log Message: Pre-tagging version change Index: version.h =================================================================== RCS file: /cvsroot/com0com/hub4com/version.h,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** version.h 31 Jul 2009 11:23:43 -0000 1.6 --- version.h 10 May 2011 10:31:55 -0000 1.7 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2011 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 23,32 **** #define _H4C_VERSION_H_ ! #define H4C_COPYRIGHT_YEARS "2006-2009" #define H4C_V1 2 #define H4C_V2 0 ! #define H4C_V3 0 ! #define H4C_V4 1 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 --- 23,32 ---- #define _H4C_VERSION_H_ ! #define H4C_COPYRIGHT_YEARS "2006-2011" #define H4C_V1 2 #define H4C_V2 0 ! #define H4C_V3 1 ! #define H4C_V4 0 #define MK_VERSION_STR1(V1, V2, V3, V4) #V1 "." #V2 "." #V3 "." #V4 |
From: Vyacheslav F. <vf...@us...> - 2011-05-10 10:30:17
|
Update of /cvsroot/com0com/hub4com In directory vz-cvs-2.sog:/tmp/cvs-serv7901 Modified Files: ReadMe.txt Log Message: Added questions about spliting output to printer and server Index: ReadMe.txt =================================================================== RCS file: /cvsroot/com0com/hub4com/ReadMe.txt,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ReadMe.txt 31 Jul 2009 11:30:18 -0000 1.9 --- ReadMe.txt 10 May 2011 10:30:14 -0000 1.10 *************** *** 273,276 **** physical com port to accept data with hub4com? A. By default hub4com use CTS handshaking on output so if CTS state is OFF ! then no any data can be send to the port. To disable CTS handshaking add --octs=off option before real com port. --- 273,408 ---- physical com port to accept data with hub4com? A. By default hub4com use CTS handshaking on output so if CTS state is OFF ! then no any data can be sent to the port. To disable CTS handshaking add --octs=off option before real com port. + + Q. This is my config: + A com0com virtual null modem (COM3<>CNCB0) is used to get input data from + the Windows "Generic Text Only" printer (configured on virtual COM4). After + this I used hub4com to "split" the ASCII stream in 2 data paths: one stream + goes to a dot matrix printer connected via Ethernet (hub4com creates a TCP + client that connect to Jetdirect port 9100 of the printer) and the other one + is used for a local TCP server on port 5555 (hub4com create a TCP server + that will be used by a TCP client on networked PC to collect the same data + printed on paper). This is the hub4com command-line: + + hub4com.exe --route=0:1,2 \\.\CNCB0 --use-driver=tcp *5555 *172.16.32.12:9100 + + In this way it seems to me that everything works as desired: when the + printer closes the TCP connection the hub4com immediately opens a new one. + + How to create a TCP connection when needed instead of using a "permanent" + TCP connection w/o a risk to lose some bytes of data when hub4com (re)create + the TCP connection to the printer? + + I want to be sure that the TCP client on networked PC continues to get data + also in case that the printer is switched off (or disconnected from the + network) and, at the same time, I want to be sure that the printer continues + to print data also in case that the TCP client is switched off (or disconnected + from the network). How to do it? + + A. The following config script allows + + - create a TCP connection to the printer when needed instead of using a + "permanent" TCP connection. + - suspend a printing job till the job will cancelled by user or till + connection to the printer or from TCP client on networked PC will + established. + - repeate each minute tries to create a TCP connection to the printer till + there is a printing job. + + Copy and paste the following script to a command file (.bat) or to the console + + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + : + : Set parameters + : + SET PRINTER_SERIAL_PORT=COM3 + SET H4C_SERIAL_PORT=CNCB0 + SET H4C_TCP_SERVER_PORT=5555 + SET H4C_TCP_CLIENT_ADDR=172.16.32.12 + : + : Set required flow control on the printer's side + : + mode com4 octs=on odsr=on dtr=on rts=on + : + : Set config file path for hub4com to this bat-file or console + : + SET H4C_CONFIG_FILE="\"%~f0\"" + GOTO END_SET_H4C_CONFIG_FILE + SET H4C_CONFIG_FILE="" + :END_SET_H4C_CONFIG_FILE + : + : Start hub4com + : + hub4com --load=%H4C_CONFIG_FILE%,_BEGIN_H4C_,_END_H4C_:%H4C_SERIAL_PORT%,%H4C_TCP_SERVER_PORT%,%H4C_TCP_CLIENT_ADDR% + : + : Skip config for hub4com if something is wrong + : + GOTO END + find "blah blah blah" + : + : Config for hub4com + : + _BEGIN_H4C_ + # Enable route data and signals + # - from SERIAL(0) to TCP(1) and TCP(2) + # - from TCP(1) to SERIAL(0) + # - from TCP(2) to SERIAL(0) + # Enable route flow control + # - from TCP(1) and TCP(2) to SERIAL(0) + # + --bi-route=0:1,2 + # + # The DTR should be in raised state on the SERIAL(0) + # if TCP(1) or TCP(2) or both are in connected state + # The DTR should be in not raised state on the SERIAL(0) + # if TCP(1) and TCP(2) are in not connected state + # + --create-filter=pinmap:--dtr=connect + --add-filters=0:pinmap + # + # (re)connect TCP(2) only when the DSR on the SERIAL(0) + # is in raised state + # + --create-filter=pin2con:--connect=dsr + --add-filters=0:pin2con + # + # Disable writing data to the SERIAL(0) + # + --write-limit=0 + # + # Serial SERIAL(0) + # + \\.\%%1%% + # + # Restore write queue limit + # + --write-limit=256 + # + --use-driver=tcp + # + # Server TCP(1) + # + *%%2%% + # + # Set write queue limit to a big enough value for TCP(2) to + # minimize delays while connection procedure is in progress + # (it's optional) + # --write-limit=2048 + # + # Do reconnect TCP(2) each minute till there is + # a job for printing (the DSR on the SERIAL(0) + # is in raised state) + # + --reconnect=60000 + # + # Client TCP(2) to JetDirect server + # + %%3%%:9100 + # + _END_H4C_ + find "blah blah blah" + :END + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: + :: Press CTRL+C :: + :::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: |
From: Vyacheslav F. <vf...@us...> - 2010-12-27 14:14:15
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv19669 Modified Files: handflow.c Log Message: Added cleaning SERIAL_TX_WAITING_FOR_XON on opening port Index: handflow.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/handflow.c,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** handflow.c 30 Oct 2008 07:54:37 -0000 1.12 --- handflow.c 27 Dec 2010 14:14:06 -0000 1.13 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.13 2010/12/27 14:14:06 vfrolov + * Added cleaning SERIAL_TX_WAITING_FOR_XON on opening port + * * Revision 1.12 2008/10/30 07:54:37 vfrolov * Improved BREAK emulation *************** *** 96,99 **** --- 99,105 ---- // Set local side + if (!pHandFlow) + pIoPort->writeHolding &= ~SERIAL_TX_WAITING_FOR_XON; + if (pHandFlow && ((pIoPort->handFlow.FlowReplace & SERIAL_AUTO_TRANSMIT) != 0) && |
From: Vyacheslav F. <vf...@us...> - 2010-09-14 18:34:39
|
Update of /cvsroot/com0com/hub4com/plugins/tcp In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24790 Modified Files: comio.cpp comport.cpp Log Message: Fixed rejected connections handling Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** comport.cpp 14 Sep 2010 16:33:34 -0000 1.21 --- comport.cpp 14 Sep 2010 18:34:30 -0000 1.22 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.22 2010/09/14 18:34:30 vfrolov + * Fixed rejected connections handling + * * Revision 1.21 2010/09/14 16:33:34 vfrolov * Implemented --write-limit=0 to disable writing to the port *************** *** 638,658 **** void ComPort::OnDisconnect() { - cout << name << ": Disconnected" << endl; - Close(name.c_str(), hSock); hSock = INVALID_SOCKET; ! if (isConnected) { ! if (lenWriteBuf) { ! _ASSERTE(pWriteBuf != NULL); ! writeLost += lenWriteBuf; ! writeQueued -= lenWriteBuf; ! lenWriteBuf = 0; ! pBufFree(pWriteBuf); ! pWriteBuf = NULL; ! FlowControlUpdate(); ! } isConnected = FALSE; --- 641,661 ---- void ComPort::OnDisconnect() { Close(name.c_str(), hSock); hSock = INVALID_SOCKET; ! if (lenWriteBuf) { ! _ASSERTE(pWriteBuf != NULL); ! writeLost += lenWriteBuf; ! writeQueued -= lenWriteBuf; ! lenWriteBuf = 0; ! pBufFree(pWriteBuf); ! pWriteBuf = NULL; ! FlowControlUpdate(); ! } ! ! if (isConnected) { ! cout << name << ": Disconnected" << endl; isConnected = FALSE; Index: comio.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comio.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** comio.cpp 14 Sep 2009 09:05:28 -0000 1.10 --- comio.cpp 14 Sep 2010 18:34:30 -0000 1.11 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.11 2010/09/14 18:34:30 vfrolov + * Fixed rejected connections handling + * * Revision 1.10 2009/09/14 09:05:28 vfrolov * Fixed data loss on disconnect. *************** *** 490,496 **** if ((events.lNetworkEvents & FD_CONNECT) != 0) { - if (!pOver->port.OnEvent(pOver, FD_CONNECT)) - return; - if (events.iErrorCode[FD_CONNECT_BIT] != ERROR_SUCCESS) { TraceError( --- 493,496 ---- *************** *** 503,506 **** --- 503,509 ---- return; } + else + if (!pOver->port.OnEvent(pOver, FD_CONNECT)) + return; } |
From: Vyacheslav F. <vf...@us...> - 2010-09-14 16:33:45
|
Update of /cvsroot/com0com/hub4com/plugins/tcp In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3888 Modified Files: comparams.cpp comport.cpp port.cpp Log Message: Implemented --write-limit=0 to disable writing to the port Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comport.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** comport.cpp 7 Jun 2010 14:54:48 -0000 1.20 --- comport.cpp 14 Sep 2010 16:33:34 -0000 1.21 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.21 2010/09/14 16:33:34 vfrolov + * Implemented --write-limit=0 to disable writing to the port + * * Revision 1.20 2010/06/07 14:54:48 vfrolov * Added "Connected" and "Disconnected" messages (feature request #3010158) *************** *** 451,455 **** switch (HUB_MSG_T2N(pMsg->type)) { case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { ! BYTE *pBuf = pMsg->u.buf.pBuf; DWORD len = pMsg->u.buf.size; --- 454,460 ---- switch (HUB_MSG_T2N(pMsg->type)) { case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { ! if (!writeQueueLimit) ! return TRUE; ! DWORD len = pMsg->u.buf.size; *************** *** 457,460 **** --- 462,467 ---- return TRUE; + BYTE *pBuf = pMsg->u.buf.pBuf; + if (!pBuf) { writeLost += len; Index: comparams.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/comparams.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** comparams.cpp 6 Mar 2009 07:56:28 -0000 1.5 --- comparams.cpp 14 Sep 2010 16:33:34 -0000 1.6 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.6 2010/09/14 16:33:34 vfrolov + * Implemented --write-limit=0 to disable writing to the port + * * Revision 1.5 2009/03/06 07:56:28 vfrolov * Fixed assertion with non ascii chars *************** *** 70,74 **** if (isdigit((unsigned char)*pWriteQueueLimit)) { writeQueueLimit = atol(pWriteQueueLimit); ! return writeQueueLimit > 0; } --- 73,77 ---- if (isdigit((unsigned char)*pWriteQueueLimit)) { writeQueueLimit = atol(pWriteQueueLimit); ! return writeQueueLimit >= 0; } *************** *** 78,82 **** string ComParams::WriteQueueLimitStr(long writeQueueLimit) { ! if (writeQueueLimit > 0) { stringstream buf; buf << writeQueueLimit; --- 81,85 ---- string ComParams::WriteQueueLimitStr(long writeQueueLimit) { ! if (writeQueueLimit >= 0) { stringstream buf; buf << writeQueueLimit; *************** *** 89,93 **** const char *ComParams::WriteQueueLimitLst() { ! return "a positive number"; } /////////////////////////////////////////////////////////////// --- 92,96 ---- const char *ComParams::WriteQueueLimitLst() { ! return "a positive number or 0"; } /////////////////////////////////////////////////////////////// Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/tcp/port.cpp,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** port.cpp 14 Sep 2009 09:08:48 -0000 1.15 --- port.cpp 14 Sep 2010 16:33:34 -0000 1.16 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.16 2010/09/14 16:33:34 vfrolov + * Implemented --write-limit=0 to disable writing to the port + * * Revision 1.15 2009/09/14 09:08:48 vfrolov * Added discarding owned tick (for optimization) *************** *** 127,132 **** << " means n[o] else d[efault] means 0." << endl << " --write-limit=<s> - set write queue limit to <s> (" << ComParams().WriteQueueLimitStr() << " by default)," << endl ! << " where <s> is " << ComParams::WriteQueueLimitLst() << ". The queue will be" << endl ! << " purged with data lost on overruning." << endl << endl << "Output data stream description:" << endl --- 130,136 ---- << " means n[o] else d[efault] means 0." << endl << " --write-limit=<s> - set write queue limit to <s> (" << ComParams().WriteQueueLimitStr() << " by default)," << endl ! << " where <s> is " << ComParams::WriteQueueLimitLst() << ". The queue" << endl ! << " will be purged with data lost on overruning." << endl ! << " The value 0 will disable writing to the port." << endl << endl << "Output data stream description:" << endl |
From: Vyacheslav F. <vf...@us...> - 2010-09-14 16:31:59
|
Update of /cvsroot/com0com/hub4com/plugins/serial In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv3517 Modified Files: comparams.cpp comport.cpp port.cpp Log Message: Implemented --write-limit=0 to disable writing to the port Index: comport.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comport.cpp,v retrieving revision 1.24 retrieving revision 1.25 diff -C2 -d -r1.24 -r1.25 *** comport.cpp 22 Dec 2008 09:40:46 -0000 1.24 --- comport.cpp 14 Sep 2010 16:31:50 -0000 1.25 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.25 2010/09/14 16:31:50 vfrolov + * Implemented --write-limit=0 to disable writing to the port + * * Revision 1.24 2008/12/22 09:40:46 vfrolov * Optimized message switching *************** *** 611,615 **** switch (HUB_MSG_T2N(pMsg->type)) { case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { ! BYTE *pBuf = pMsg->u.buf.pBuf; DWORD len = pMsg->u.buf.size; --- 614,620 ---- switch (HUB_MSG_T2N(pMsg->type)) { case HUB_MSG_T2N(HUB_MSG_TYPE_LINE_DATA): { ! if (!writeQueueLimit) ! return TRUE; ! DWORD len = pMsg->u.buf.size; *************** *** 617,620 **** --- 622,627 ---- return TRUE; + BYTE *pBuf = pMsg->u.buf.pBuf; + if (!pBuf) { writeLost += len; Index: comparams.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/comparams.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** comparams.cpp 6 Mar 2009 07:56:28 -0000 1.7 --- comparams.cpp 14 Sep 2010 16:31:50 -0000 1.8 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2010/09/14 16:31:50 vfrolov + * Implemented --write-limit=0 to disable writing to the port + * * Revision 1.7 2009/03/06 07:56:28 vfrolov * Fixed assertion with non ascii chars *************** *** 151,155 **** if (isdigit((unsigned char)*pWriteQueueLimit)) { writeQueueLimit = atol(pWriteQueueLimit); ! return writeQueueLimit > 0; } --- 154,158 ---- if (isdigit((unsigned char)*pWriteQueueLimit)) { writeQueueLimit = atol(pWriteQueueLimit); ! return writeQueueLimit >= 0; } *************** *** 235,239 **** string ComParams::WriteQueueLimitStr(long writeQueueLimit) { ! if (writeQueueLimit > 0) { stringstream buf; buf << writeQueueLimit; --- 238,242 ---- string ComParams::WriteQueueLimitStr(long writeQueueLimit) { ! if (writeQueueLimit >= 0) { stringstream buf; buf << writeQueueLimit; *************** *** 281,285 **** const char *ComParams::WriteQueueLimitLst() { ! return "a positive number"; } --- 284,288 ---- const char *ComParams::WriteQueueLimitLst() { ! return "a positive number or 0"; } Index: port.cpp =================================================================== RCS file: /cvsroot/com0com/hub4com/plugins/serial/port.cpp,v retrieving revision 1.14 retrieving revision 1.15 diff -C2 -d -r1.14 -r1.15 *** port.cpp 20 Feb 2009 18:32:35 -0000 1.14 --- port.cpp 14 Sep 2010 16:31:50 -0000 1.15 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2008-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2008-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.15 2010/09/14 16:31:50 vfrolov + * Implemented --write-limit=0 to disable writing to the port + * * Revision 1.14 2009/02/20 18:32:35 vfrolov * Added info about location of options *************** *** 169,174 **** << " where <t> is " << ComParams::IntervalTimeoutLst() << "." << endl << " --write-limit=<s> - set write queue limit to <s> (" << ComParams().WriteQueueLimitStr() << " by default)," << endl ! << " where <s> is " << ComParams::WriteQueueLimitLst() << ". The queue will be" << endl ! << " purged with data lost on overruning." << endl << endl << " The value c[urrent] above means to use current COM port settings." << endl --- 172,178 ---- << " where <t> is " << ComParams::IntervalTimeoutLst() << "." << endl << " --write-limit=<s> - set write queue limit to <s> (" << ComParams().WriteQueueLimitStr() << " by default)," << endl ! << " where <s> is " << ComParams::WriteQueueLimitLst() << ". The queue" << endl ! << " will be purged with data lost on overruning." << endl ! << " The value 0 will disable writing to the port." << endl << endl << " The value c[urrent] above means to use current COM port settings." << endl |
From: Vyacheslav F. <vf...@us...> - 2010-09-03 13:52:36
|
Update of /cvsroot/com0com/com0com In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv32764 Modified Files: ReadMe.txt Log Message: Updated getting of inf2cat, makecert, pvk2pfx, signtool and certmgr Index: ReadMe.txt =================================================================== RCS file: /cvsroot/com0com/com0com/ReadMe.txt,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** ReadMe.txt 19 Jul 2010 11:24:33 -0000 1.27 --- ReadMe.txt 3 Sep 2010 13:52:28 -0000 1.28 *************** *** 209,215 **** certmgr -add com0com.cer -s -r localMachine trustedpublisher ! The inf2cat tool can be installed with the Winqual Submission Tool. ! The makecert, pvk2pfx, signtool and certmgr tools can be installed with the ! Platform Software Development Kit (SDK). Q. How to monitor and get the paired port settings (baud rate, byte size, parity --- 209,214 ---- certmgr -add com0com.cer -s -r localMachine trustedpublisher ! The inf2cat, makecert, pvk2pfx, signtool and certmgr tools are included in the ! Windows Driver Kit (WDK). Q. How to monitor and get the paired port settings (baud rate, byte size, parity |
From: Vyacheslav F. <vf...@us...> - 2010-09-03 13:39:18
|
Update of /cvsroot/com0com/com0com In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv29661 Modified Files: Building.txt Log Message: Added note for Windows 2000 Removed SDK from PREREQUISITES Index: Building.txt =================================================================== RCS file: /cvsroot/com0com/com0com/Building.txt,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** Building.txt 20 May 2009 13:50:10 -0000 1.2 --- Building.txt 3 Sep 2010 13:39:10 -0000 1.3 *************** *** 8,30 **** You will need the following to build com0com from source code: ! 1. Microsoft Windows Driver Development Kit (DDK). ! When the DDK is installed, it defines the Start menu shortcuts for ! several different build environments. To open a DDK build environment window choose one of the environment shortcuts. ! 2. Microsoft Windows Platform Software Development Kit (SDK). ! It's required for creating a certificate and signing com0com.sys file ! if you build driver for x64-based versions of ! Windows Vista/Windows Server 2008/Windows 7. ! When the SDK is installed, it defines the Start menu shortcuts for ! several different build environments. To open a SDK build environment ! window choose one of the environment shortcuts. ! 3. Microsoft Visual C++ 2005 Express Edition (MSVC). It's required for building the GUI-based setup utility. When the MSVC is installed, it defines the Start menu shortcut for build environment. To open a MSVC build environment window choose it. ! 4. Nullsoft Scriptable Install System (http://nsis.sourceforge.net/). It's required for building the installer. --- 8,34 ---- You will need the following to build com0com from source code: ! 1. Microsoft Windows Driver Development Kit (DDK) or Windows Driver Kit (WDK). ! When the DDK/WDK is installed, it defines the Start menu shortcuts for ! several different build environments. To open a DDK/WDK build environment window choose one of the environment shortcuts. ! NOTE: Microsoft removed Windows 2000 from its list of supported platforms ! for the new WDKs. So for Windows 2000 you'll need one of the previous ! releases of the DDK/WDK: ! 6001.18002 - WDK for Windows Server 2008. ! This WDK provides a Windows 2000 build environment for the ! development of drivers targeting Windows 2000. ! (6.1.6001.18002.081017-1400_wdksp-WDK18002SP_EN_DVD.iso). ! 1830 - DDK for Windows Server 2003 SP1. ! This DDK can be installed to Windows 2000. ! (1830_usa_ddk.iso). ! ! 2. Microsoft Visual C++ 2005 Express Edition (MSVC). It's required for building the GUI-based setup utility. When the MSVC is installed, it defines the Start menu shortcut for build environment. To open a MSVC build environment window choose it. ! 3. Nullsoft Scriptable Install System (http://nsis.sourceforge.net/). It's required for building the installer. *************** *** 35,39 **** 1. Build the driver. ! For example execute in the DDK build environment window: cd C:\com0com --- 39,43 ---- 1. Build the driver. ! For example execute in the DDK/WDK build environment window: cd C:\com0com *************** *** 48,52 **** a test certificate and sign com0com.sys file. ! For example execute in the SDK build environment window: mkdir C:\com0com\cert --- 52,56 ---- a test certificate and sign com0com.sys file. ! For example execute in the WDK build environment window: mkdir C:\com0com\cert |
From: Vyacheslav F. <vf...@us...> - 2010-09-03 13:32:23
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27979 Modified Files: precomp.h Log Message: Fixed incompatibility with WDK 6001.18002 Index: precomp.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/precomp.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** precomp.h 4 Aug 2010 10:38:56 -0000 1.4 --- precomp.h 3 Sep 2010 13:32:14 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2010/09/03 13:32:14 vfrolov + * Fixed incompatibility with WDK 6001.18002 + * * Revision 1.4 2010/08/04 10:38:56 vfrolov * Minimized PREfast noise *************** *** 45,52 **** #pragma warning(pop) ! #ifndef NTDDI_VERSION /* Declare stuff missing in old DDKs */ #define __drv_dispatchType(type) #define __drv_aliasesMem --- 48,64 ---- #pragma warning(pop) ! #ifndef NTDDI_WIN7 /* Declare stuff missing in old DDKs */ + + typedef VOID KDEFERRED_ROUTINE( + IN PKDPC pDpc, + IN PVOID deferredContext, + IN PVOID systemArgument1, + IN PVOID systemArgument2); + + #ifndef NTDDI_VERSION + #define __drv_dispatchType(type) #define __drv_aliasesMem *************** *** 71,80 **** IN PIRP pIrp); - typedef VOID KDEFERRED_ROUTINE( - IN PKDPC pDpc, - IN PVOID deferredContext, - IN PVOID systemArgument1, - IN PVOID systemArgument2); - NTSYSAPI NTSTATUS NTAPI ZwDeleteValueKey( IN HANDLE KeyHandle, --- 83,86 ---- *************** *** 82,85 **** --- 88,92 ---- #endif /* NTDDI_VERSION */ + #endif /* NTDDI_WIN7 */ #define ENABLE_TRACING 1 |
From: Vyacheslav F. <vf...@us...> - 2010-08-10 16:46:06
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2331 Modified Files: tracetbl.c Log Message: Added STATUS_WAIT_1..3 Index: tracetbl.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/tracetbl.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** tracetbl.c 9 Aug 2010 16:08:37 -0000 1.17 --- tracetbl.c 10 Aug 2010 16:45:58 -0000 1.18 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.18 2010/08/10 16:45:58 vfrolov + * Added STATUS_WAIT_1..3 + * * Revision 1.17 2010/08/09 16:08:37 vfrolov * Added STATUS_NOT_IMPLEMENTED *************** *** 322,325 **** --- 325,331 ---- TOCODE2NAME(STATUS_, TIMEOUT), TOCODE2NAME(STATUS_, UNSUCCESSFUL), + TOCODE2NAME(STATUS_, WAIT_1), + TOCODE2NAME(STATUS_, WAIT_2), + TOCODE2NAME(STATUS_, WAIT_3), TOCODE2NAME(STATUS_, WMI_GUID_NOT_FOUND), {0, NULL} |
From: Vyacheslav F. <vf...@us...> - 2010-08-09 16:08:45
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv18419 Modified Files: tracetbl.c Log Message: Added STATUS_NOT_IMPLEMENTED Index: tracetbl.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/tracetbl.c,v retrieving revision 1.16 retrieving revision 1.17 diff -C2 -d -r1.16 -r1.17 *** tracetbl.c 27 May 2010 11:16:46 -0000 1.16 --- tracetbl.c 9 Aug 2010 16:08:37 -0000 1.17 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.17 2010/08/09 16:08:37 vfrolov + * Added STATUS_NOT_IMPLEMENTED + * * Revision 1.16 2010/05/27 11:16:46 vfrolov * Added ability to put the port to the Ports class *************** *** 305,323 **** TOCODE2NAME(STATUS_, BUFFER_TOO_SMALL), TOCODE2NAME(STATUS_, CANCELLED), ! TOCODE2NAME(STATUS_, INSUFFICIENT_RESOURCES), TOCODE2NAME(STATUS_, INSUFFICIENT_RESOURCES), TOCODE2NAME(STATUS_, INVALID_DEVICE_REQUEST), TOCODE2NAME(STATUS_, INVALID_PARAMETER), TOCODE2NAME(STATUS_, NO_SUCH_DEVICE), TOCODE2NAME(STATUS_, NOT_SUPPORTED), TOCODE2NAME(STATUS_, PENDING), TOCODE2NAME(STATUS_, SUCCESS), TOCODE2NAME(STATUS_, TIMEOUT), TOCODE2NAME(STATUS_, UNSUCCESSFUL), - TOCODE2NAME(STATUS_, OBJECT_NAME_NOT_FOUND), - TOCODE2NAME(STATUS_, DEVICE_BUSY), TOCODE2NAME(STATUS_, WMI_GUID_NOT_FOUND), - TOCODE2NAME(STATUS_, SERIAL_COUNTER_TIMEOUT), - TOCODE2NAME(STATUS_, SERIAL_MORE_WRITES), {0, NULL} }; --- 308,326 ---- TOCODE2NAME(STATUS_, BUFFER_TOO_SMALL), TOCODE2NAME(STATUS_, CANCELLED), ! TOCODE2NAME(STATUS_, DEVICE_BUSY), TOCODE2NAME(STATUS_, INSUFFICIENT_RESOURCES), TOCODE2NAME(STATUS_, INVALID_DEVICE_REQUEST), TOCODE2NAME(STATUS_, INVALID_PARAMETER), TOCODE2NAME(STATUS_, NO_SUCH_DEVICE), + TOCODE2NAME(STATUS_, NOT_IMPLEMENTED), TOCODE2NAME(STATUS_, NOT_SUPPORTED), + TOCODE2NAME(STATUS_, OBJECT_NAME_NOT_FOUND), TOCODE2NAME(STATUS_, PENDING), + TOCODE2NAME(STATUS_, SERIAL_COUNTER_TIMEOUT), + TOCODE2NAME(STATUS_, SERIAL_MORE_WRITES), TOCODE2NAME(STATUS_, SUCCESS), TOCODE2NAME(STATUS_, TIMEOUT), TOCODE2NAME(STATUS_, UNSUCCESSFUL), TOCODE2NAME(STATUS_, WMI_GUID_NOT_FOUND), {0, NULL} }; |
From: Vyacheslav F. <vf...@us...> - 2010-08-09 12:51:06
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27267 Modified Files: halt.h Log Message: Added try DbgBreakPoint() before KeBugCheckEx() Index: halt.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/halt.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** halt.h 4 Aug 2010 10:38:55 -0000 1.2 --- halt.h 9 Aug 2010 12:50:58 -0000 1.3 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.3 2010/08/09 12:50:58 vfrolov + * Added try DbgBreakPoint() before KeBugCheckEx() + * * Revision 1.2 2010/08/04 10:38:55 vfrolov * Minimized PREfast noise *************** *** 32,48 **** #if defined(_PREFAST_) ! ! #define HALT_UNLESS3(exp, p1, p2, p3) __assume(exp) ! #elif DBG ! ! #define HALT_UNLESS3(exp, p1, p2, p3) \ ! if (!(exp)) \ ! KeBugCheckEx(0xDEADC0CD, (FILE_ID << 16) + __LINE__, p1, p2, p3) ! #else ! ! #define HALT_UNLESS3(exp, p1, p2, p3) ! #endif --- 35,53 ---- #if defined(_PREFAST_) ! #define HALT_UNLESS3(exp, p1, p2, p3) __assume(exp) #elif DBG ! #define HALT_UNLESS3(exp, p1, p2, p3) \ ! if (!(exp)) { \ ! try { \ ! DbgPrint("%s (%d):\n", __FILE__, __LINE__); \ ! DbgPrint(" HALT_UNLESS3(\"%s\",\n", #exp); \ ! DbgPrint(" 0x%08X, 0x%08X, 0x%08X);\n", (ULONG)(p1), (ULONG)(p2), (ULONG)(p3)); \ ! DbgBreakPoint(); \ ! } except (EXCEPTION_EXECUTE_HANDLER) { \ ! KeBugCheckEx(0xDEADC0CD, (FILE_ID << 16) + __LINE__, (ULONG_PTR)(p1), (ULONG_PTR)(p2), (ULONG_PTR)(p3)); \ ! } \ ! } #else ! #define HALT_UNLESS3(exp, p1, p2, p3) #endif |
From: Vyacheslav F. <vf...@us...> - 2010-08-09 06:02:48
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv6279 Modified Files: adddev.c com0com.h initunlo.c Log Message: Eliminated accessing undocumented structure members Index: initunlo.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/initunlo.c,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** initunlo.c 4 Aug 2010 10:38:55 -0000 1.7 --- initunlo.c 9 Aug 2010 06:02:40 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2010/08/09 06:02:40 vfrolov + * Eliminated accessing undocumented structure members + * * Revision 1.7 2010/08/04 10:38:55 vfrolov * Minimized PREfast noise *************** *** 54,57 **** --- 57,63 ---- NTSTATUS status; + KeInitializeSpinLock(&c0cGlobal.listFdoBusLock); + InitializeListHead(&c0cGlobal.listFdoBus); + c0cGlobal.pDrvObj = pDrvObj; Index: adddev.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/adddev.c,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** adddev.c 27 May 2010 11:16:46 -0000 1.37 --- adddev.c 9 Aug 2010 06:02:40 -0000 1.38 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.38 2010/08/09 06:02:40 vfrolov + * Eliminated accessing undocumented structure members + * * Revision 1.37 2010/05/27 11:16:46 vfrolov * Added ability to put the port to the Ports class *************** *** 154,157 **** --- 157,161 ---- #define FILE_ID 6 + /********************************************************************/ NTSTATUS InitCommonExt( PC0C_COMMON_EXTENSION pDevExt, *************** *** 164,168 **** return CopyStrW(pDevExt->portName, sizeof(pDevExt->portName)/sizeof(pDevExt->portName[0]), pPortName); } ! VOID RemoveFdoPort(IN PC0C_FDOPORT_EXTENSION pDevExt) { --- 168,172 ---- return CopyStrW(pDevExt->portName, sizeof(pDevExt->portName)/sizeof(pDevExt->portName[0]), pPortName); } ! /********************************************************************/ VOID RemoveFdoPort(IN PC0C_FDOPORT_EXTENSION pDevExt) { *************** *** 569,573 **** return status; } ! VOID RemovePdoPort(IN PC0C_PDOPORT_EXTENSION pDevExt) { --- 573,577 ---- return status; } ! /********************************************************************/ VOID RemovePdoPort(IN PC0C_PDOPORT_EXTENSION pDevExt) { *************** *** 650,752 **** return status; } ! ! VOID RemoveFdoBus(IN PC0C_FDOBUS_EXTENSION pDevExt) { ! int i; ! ! for (i = 0 ; i < 2 ; i++) { ! if (pDevExt->childs[i].pDevExt) ! RemovePdoPort(pDevExt->childs[i].pDevExt); ! } ! ! if (pDevExt->pLowDevObj) ! IoDetachDevice(pDevExt->pLowDevObj); ! Trace0((PC0C_COMMON_EXTENSION)pDevExt, L"RemoveFdoBus"); ! IoDeleteDevice(pDevExt->pDevObj); ! } ! ULONG AllocPortNum(IN PDRIVER_OBJECT pDrvObj, ULONG num) ! { ! PDEVICE_OBJECT pDevObj; ! ULONG numNext; ! PCHAR pBusyMask; ! SIZE_T busyMaskLen; ! ULONG maskNum; ! ULONG mask; ! numNext = 0; ! for (pDevObj = pDrvObj->DeviceObject ; pDevObj ; pDevObj = pDevObj->NextDevice) { ! PC0C_FDOBUS_EXTENSION pDevExt = (PC0C_FDOBUS_EXTENSION)pDevObj->DeviceExtension; ! if (pDevExt && pDevExt->doType == C0C_DOTYPE_FB) { ! ULONG portNum = pDevExt->portNum; ! if (portNum >= numNext) ! numNext = portNum + 1; ! } } ! if (num == (ULONG)-1) ! num = 0; ! if (num >= numNext) ! return num; ! busyMaskLen = (numNext + (sizeof(*pBusyMask)*8 - 1))/(sizeof(*pBusyMask)*8); ! pBusyMask = C0C_ALLOCATE_POOL(PagedPool, busyMaskLen); ! if (!pBusyMask) { ! SysLog(pDrvObj, STATUS_INSUFFICIENT_RESOURCES, L"AllocPortNum C0C_ALLOCATE_POOL FAIL"); ! return numNext; } ! RtlZeroMemory(pBusyMask, busyMaskLen); ! for (pDevObj = pDrvObj->DeviceObject ; pDevObj ; pDevObj = pDevObj->NextDevice) { ! PC0C_FDOBUS_EXTENSION pDevExt = (PC0C_FDOBUS_EXTENSION)pDevObj->DeviceExtension; ! if (pDevExt && pDevExt->doType == C0C_DOTYPE_FB) { ! ULONG portNum = pDevExt->portNum; ! maskNum = portNum/(sizeof(*pBusyMask)*8); ! mask = 1 << (portNum%(sizeof(*pBusyMask)*8)); ! HALT_UNLESS3(maskNum < busyMaskLen, portNum, busyMaskLen, numNext); ! pBusyMask[maskNum] |= mask; ! } ! } ! maskNum = num/(sizeof(*pBusyMask)*8); ! mask = 1 << (num%(sizeof(*pBusyMask)*8)); ! if ((pBusyMask[maskNum] & mask) != 0) { ! for (num = 0 ; num < numNext ; num++) { ! maskNum = num/(sizeof(*pBusyMask)*8); ! mask = 1 << (num%(sizeof(*pBusyMask)*8)); ! HALT_UNLESS3(maskNum < busyMaskLen, num, busyMaskLen, numNext); ! if ((pBusyMask[maskNum] & mask) == 0) ! break; ! } ! } ! C0C_FREE_POOL(pBusyMask); ! return num; } ! ULONG GetPortNum(IN PDRIVER_OBJECT pDrvObj, IN PDEVICE_OBJECT pPhDevObj) { ULONG num; - ULONG numPref; HANDLE hKey; NTSTATUS status; - numPref = (ULONG)-1; - status = IoOpenDeviceRegistryKey(pPhDevObj, PLUGPLAY_REGKEY_DEVICE, --- 654,741 ---- return status; } ! /********************************************************************/ ! ULONG ListFdoBusGetFreeNum() { ! ULONG numNext; ! KIRQL oldIrql; ! PLIST_ENTRY Flink; ! numNext = 0; ! KeAcquireSpinLock(&c0cGlobal.listFdoBusLock, &oldIrql); ! for (Flink = c0cGlobal.listFdoBus.Flink ;; Flink = Flink->Flink) { ! ULONG num; ! if (Flink == &c0cGlobal.listFdoBus) ! break; ! num = CONTAINING_RECORD(Flink, C0C_FDOBUS_EXTENSION, listEntry)->portNum; ! if (numNext < num) ! break; ! numNext = num + 1; } ! KeReleaseSpinLock(&c0cGlobal.listFdoBusLock, oldIrql); ! return numNext; ! } ! VOID ListFdoBusInsert(PC0C_FDOBUS_EXTENSION pDevExt) ! { ! KIRQL oldIrql; ! PLIST_ENTRY Flink; ! KeAcquireSpinLock(&c0cGlobal.listFdoBusLock, &oldIrql); ! for (Flink = c0cGlobal.listFdoBus.Flink ;; Flink = Flink->Flink) { ! if (Flink == &c0cGlobal.listFdoBus || ! pDevExt->portNum <= CONTAINING_RECORD(Flink, C0C_FDOBUS_EXTENSION, listEntry)->portNum) ! { ! InsertHeadList(Flink, &pDevExt->listEntry); ! KeReleaseSpinLock(&c0cGlobal.listFdoBusLock, oldIrql); ! return; ! } } + } ! VOID ListFdoBusRemove(PC0C_FDOBUS_EXTENSION pDevExt) ! { ! KIRQL oldIrql; ! KeAcquireSpinLock(&c0cGlobal.listFdoBusLock, &oldIrql); ! RemoveEntryList(&pDevExt->listEntry); ! KeReleaseSpinLock(&c0cGlobal.listFdoBusLock, oldIrql); ! } ! VOID RemoveFdoBus(IN PC0C_FDOBUS_EXTENSION pDevExt) ! { ! int i; ! for (i = 0 ; i < 2 ; i++) { ! if (pDevExt->childs[i].pDevExt) ! RemovePdoPort(pDevExt->childs[i].pDevExt); ! } ! if (pDevExt->pLowDevObj) ! IoDetachDevice(pDevExt->pLowDevObj); ! ListFdoBusRemove(pDevExt); ! Trace0((PC0C_COMMON_EXTENSION)pDevExt, L"RemoveFdoBus"); ! IoDeleteDevice(pDevExt->pDevObj); } ! ULONG GetPortNum(IN PDEVICE_OBJECT pPhDevObj) { ULONG num; HANDLE hKey; NTSTATUS status; status = IoOpenDeviceRegistryKey(pPhDevObj, PLUGPLAY_REGKEY_DEVICE, *************** *** 763,766 **** --- 752,757 ---- len = sizeof(*pInfo) + sizeof(ULONG); + num = (ULONG)-1; + pInfo = C0C_ALLOCATE_POOL(PagedPool, len); *************** *** 769,783 **** if (NT_SUCCESS(status) && pInfo->DataLength == sizeof(ULONG)) ! numPref = *(PULONG)pInfo->Data; C0C_FREE_POOL(pInfo); } ! if (numPref == (ULONG)-1) ! num = AllocPortNum(pDrvObj, numPref); ! else ! num = numPref; - if (num != numPref) { status = ZwSetValueKey(hKey, &keyName, 0, REG_DWORD, &num, sizeof(num)); --- 760,771 ---- if (NT_SUCCESS(status) && pInfo->DataLength == sizeof(ULONG)) ! num = *(PULONG)pInfo->Data; C0C_FREE_POOL(pInfo); } ! if (num == (ULONG)-1) { ! num = ListFdoBusGetFreeNum(); status = ZwSetValueKey(hKey, &keyName, 0, REG_DWORD, &num, sizeof(num)); *************** *** 790,794 **** SysLog(pPhDevObj, status, L"GetPortNum IoOpenDeviceRegistryKey(PLUGPLAY_REGKEY_DEVICE) FAIL"); ! num = AllocPortNum(pDrvObj, numPref); } --- 778,782 ---- SysLog(pPhDevObj, status, L"GetPortNum IoOpenDeviceRegistryKey(PLUGPLAY_REGKEY_DEVICE) FAIL"); ! num = ListFdoBusGetFreeNum(); } *************** *** 806,810 **** int i; ! num = GetPortNum(pDrvObj, pPhDevObj); RtlInitUnicodeString(&portName, NULL); --- 794,798 ---- int i; ! num = GetPortNum(pPhDevObj); RtlInitUnicodeString(&portName, NULL); *************** *** 838,841 **** --- 826,831 ---- HALT_UNLESS(pDevExt); RtlZeroMemory(pDevExt, sizeof(*pDevExt)); + pDevExt->portNum = num; + ListFdoBusInsert(pDevExt); status = InitCommonExt((PC0C_COMMON_EXTENSION)pDevExt, pNewDevObj, C0C_DOTYPE_FB, portName.Buffer); *************** *** 845,849 **** } - pDevExt->portNum = num; pDevExt->pLowDevObj = IoAttachDeviceToDeviceStack(pNewDevObj, pPhDevObj); --- 835,838 ---- *************** *** 901,905 **** return status; } ! NTSTATUS c0cAddDevice(IN PDRIVER_OBJECT pDrvObj, IN PDEVICE_OBJECT pPhDevObj) { --- 890,894 ---- return status; } ! /********************************************************************/ NTSTATUS c0cAddDevice(IN PDRIVER_OBJECT pDrvObj, IN PDEVICE_OBJECT pPhDevObj) { *************** *** 936,937 **** --- 925,927 ---- return status; } + /********************************************************************/ Index: com0com.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/com0com.h,v retrieving revision 1.50 retrieving revision 1.51 diff -C2 -d -r1.50 -r1.51 *** com0com.h 4 Aug 2010 10:38:55 -0000 1.50 --- com0com.h 9 Aug 2010 06:02:40 -0000 1.51 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.51 2010/08/09 06:02:40 vfrolov + * Eliminated accessing undocumented structure members + * * Revision 1.50 2010/08/04 10:38:55 vfrolov * Minimized PREfast noise *************** *** 416,419 **** --- 419,423 ---- FDO_EXTENSION + LIST_ENTRY listEntry; KSPIN_LOCK ioLock; C0C_CHILD childs[2]; *************** *** 422,425 **** --- 426,431 ---- typedef struct _C0C_GLOBAL { + LIST_ENTRY listFdoBus; + KSPIN_LOCK listFdoBusLock; PDRIVER_OBJECT pDrvObj; UNICODE_STRING registryPath; |
From: Vyacheslav F. <vf...@us...> - 2010-08-09 05:51:25
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv4687 Modified Files: trace.c Log Message: Fixed BSOD on tracing broken IRP_MN_QUERY_DEVICE_RELATIONS Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/trace.c,v retrieving revision 1.36 retrieving revision 1.37 diff -C2 -d -r1.36 -r1.37 *** trace.c 4 Aug 2010 13:12:04 -0000 1.36 --- trace.c 9 Aug 2010 05:51:16 -0000 1.37 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.37 2010/08/09 05:51:16 vfrolov + * Fixed BSOD on tracing broken IRP_MN_QUERY_DEVICE_RELATIONS + * * Revision 1.36 2010/08/04 13:12:04 vfrolov * Fixed null string tracing *************** *** 1634,1638 **** pIrpStack->Parameters.QueryId.IdType, codeNameTableBusQuery, "BusQuery", 10); ! if (flags & TRACE_FLAG_RESULTS && pIrp->IoStatus.Information) { BOOLEAN multiStr; --- 1637,1641 ---- pIrpStack->Parameters.QueryId.IdType, codeNameTableBusQuery, "BusQuery", 10); ! if ((flags & TRACE_FLAG_RESULTS) && inform) { BOOLEAN multiStr; *************** *** 1648,1652 **** } pDestStr = AnsiStrCopyStrW(pDestStr, &size, ! (PWCHAR)pIrp->IoStatus.Information, multiStr); --- 1651,1655 ---- } pDestStr = AnsiStrCopyStrW(pDestStr, &size, ! (PWCHAR)inform, multiStr); *************** *** 1659,1666 **** pIrpStack->Parameters.QueryDeviceText.DeviceTextType, codeNameTableDeviceText, "DeviceText", 10); ! if (flags & TRACE_FLAG_RESULTS && pIrp->IoStatus.Information) { pDestStr = AnsiStrFormat(pDestStr, &size, " Information: \"%S\"", ! (PWCHAR)pIrp->IoStatus.Information); } break; --- 1662,1669 ---- pIrpStack->Parameters.QueryDeviceText.DeviceTextType, codeNameTableDeviceText, "DeviceText", 10); ! if ((flags & TRACE_FLAG_RESULTS) && inform) { pDestStr = AnsiStrFormat(pDestStr, &size, " Information: \"%S\"", ! (PWCHAR)inform); } break; *************** *** 1670,1677 **** pIrpStack->Parameters.QueryDeviceRelations.Type, codeNameTableRelations, "Relations", 10); ! if (flags & TRACE_FLAG_RESULTS) { ! if (pIrp->IoStatus.Information) ! pDestStr = AnsiStrFormat(pDestStr, &size, " Count=%u", ! (unsigned)((PDEVICE_RELATIONS)pIrp->IoStatus.Information)->Count); } break; --- 1673,1685 ---- pIrpStack->Parameters.QueryDeviceRelations.Type, codeNameTableRelations, "Relations", 10); ! if ((flags & TRACE_FLAG_RESULTS) && inform) { ! switch (pIrpStack->Parameters.QueryDeviceRelations.Type) { ! case BusRelations: ! case EjectionRelations: ! case PowerRelations: ! case RemovalRelations: ! case TargetDeviceRelation: ! pDestStr = AnsiStrFormat(pDestStr, &size, " Count=%u", (unsigned)((PDEVICE_RELATIONS)inform)->Count); ! } } break; |
From: Vyacheslav F. <vf...@us...> - 2010-08-04 13:12:14
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv2293 Modified Files: trace.c Log Message: Fixed null string tracing Index: trace.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/trace.c,v retrieving revision 1.35 retrieving revision 1.36 diff -C2 -d -r1.35 -r1.36 *** trace.c 27 May 2010 11:02:11 -0000 1.35 --- trace.c 4 Aug 2010 13:12:04 -0000 1.36 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.36 2010/08/04 13:12:04 vfrolov + * Fixed null string tracing + * * Revision 1.35 2010/05/27 11:02:11 vfrolov * Added multiline tracing for IRP_MN_QUERY_ID *************** *** 363,367 **** PCHAR pStrTmp; ! pStrTmp = (pStr != NULL ? pStr : "(null)"); while (*(pStrTmp++)) --- 366,373 ---- PCHAR pStrTmp; ! if (pStr == NULL) ! pStr = "(null)"; ! ! pStrTmp = pStr; while (*(pStrTmp++)) *************** *** 393,397 **** PWCHAR pStrTmp; ! pStrTmp = (pStr != NULL ? pStr : L"(null)" L"\0"); if (multiStr) { --- 399,406 ---- PWCHAR pStrTmp; ! if (pStr == NULL) ! pStr = L"(null)" L"\0"; ! ! pStrTmp = pStr; if (multiStr) { |
From: Vyacheslav F. <vf...@us...> - 2010-08-04 10:39:05
|
Update of /cvsroot/com0com/com0com/sys In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv15261 Modified Files: bufutils.c bufutils.h com0com.h delay.c halt.h initunlo.c io.c precomp.h showport.c startirp.c timeout.c Log Message: Minimized PREfast noise Index: bufutils.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/bufutils.c,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** bufutils.c 30 Oct 2008 07:54:37 -0000 1.17 --- bufutils.c 4 Aug 2010 10:38:55 -0000 1.18 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.18 2010/08/04 10:38:55 vfrolov + * Minimized PREfast noise + * * Revision 1.17 2008/10/30 07:54:37 vfrolov * Improved BREAK emulation *************** *** 349,353 **** --- 352,358 ---- #endif /* DBG */ AddRawData(&pBuf->insertData, buf + len, length); + #if DBG HALT_UNLESS2(done == length, done, length); + #endif /* DBG */ } } *************** *** 366,370 **** --- 371,377 ---- #endif /* DBG */ AddRawData(&pBuf->insertData, &errorChar, sizeof(errorChar)); + #if DBG HALT_UNLESS1(done == sizeof(errorChar), done); + #endif /* DBG */ } } else { *************** *** 387,391 **** --- 394,400 ---- #endif /* DBG */ AddRawData(&pBuf->insertData, &errorChar, sizeof(errorChar)); + #if DBG HALT_UNLESS1(done == sizeof(errorChar), done); + #endif /* DBG */ } } else { *************** *** 423,427 **** --- 432,438 ---- #endif /* DBG */ AddRawData(&pBuf->insertData, &curChar, sizeof(curChar)); + #if DBG HALT_UNLESS1(done == sizeof(curChar), done); + #endif /* DBG */ } } else { *************** *** 450,454 **** --- 461,467 ---- #endif /* DBG */ AddRawData(&pBuf->insertData, &curChar, sizeof(curChar)); + #if DBG HALT_UNLESS1(done == sizeof(curChar), done); + #endif /* DBG */ } } else { *************** *** 670,674 **** } ! VOID InitBufferBase(PC0C_BUFFER pBuf, PUCHAR pBase, SIZE_T size) { pBuf->pBase = pBase; --- 683,687 ---- } ! VOID InitBufferBase(PC0C_BUFFER pBuf, __drv_aliasesMem PUCHAR pBase, SIZE_T size) { pBuf->pBase = pBase; *************** *** 727,731 **** } ! VOID InitBuffer(PC0C_BUFFER pBuf, PUCHAR pBase, SIZE_T size) { RtlZeroMemory(pBuf, sizeof(*pBuf)); --- 740,744 ---- } ! VOID InitBuffer(PC0C_BUFFER pBuf, __drv_aliasesMem PUCHAR pBase, SIZE_T size) { RtlZeroMemory(pBuf, sizeof(*pBuf)); Index: showport.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/showport.c,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** showport.c 27 May 2010 11:16:46 -0000 1.4 --- showport.c 4 Aug 2010 10:38:56 -0000 1.5 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.5 2010/08/04 10:38:56 vfrolov + * Minimized PREfast noise + * * Revision 1.4 2010/05/27 11:16:46 vfrolov * Added ability to put the port to the Ports class *************** *** 42,50 **** #define FILE_ID 0xD - #ifndef NTDDI_VERSION - /* ZwDeleteValueKey is missing in old DDKs */ - NTSYSAPI NTSTATUS NTAPI ZwDeleteValueKey(IN HANDLE KeyHandle, IN PUNICODE_STRING ValueName); - #endif - BOOLEAN HidePortName(IN PC0C_FDOPORT_EXTENSION pDevExt) { --- 45,48 ---- Index: io.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/io.c,v retrieving revision 1.42 retrieving revision 1.43 diff -C2 -d -r1.42 -r1.43 *** io.c 15 Dec 2008 11:00:00 -0000 1.42 --- io.c 4 Aug 2010 10:38:55 -0000 1.43 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.43 2010/08/04 10:38:55 vfrolov + * Minimized PREfast noise + * * Revision 1.42 2008/12/15 11:00:00 vfrolov * Fixed break char delay *************** *** 839,843 **** --- 842,849 ---- pQueue = &pIoPortWrite->irpQueues[C0C_QUEUE_WRITE]; + + #if DBG HALT_UNLESS(!pQueue->started); + #endif /* DBG */ pIrpXoffCounter = pQueue->pCurrent; Index: startirp.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/startirp.c,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** startirp.c 21 Sep 2009 08:49:56 -0000 1.19 --- startirp.c 4 Aug 2010 10:38:56 -0000 1.20 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.20 2010/08/04 10:38:56 vfrolov + * Minimized PREfast noise + * * Revision 1.19 2009/09/21 08:49:56 vfrolov * Added missing removing from queue *************** *** 148,151 **** --- 151,155 ---- } + DRIVER_CANCEL CancelRoutine; VOID CancelRoutine(IN PDEVICE_OBJECT pDevObj, IN PIRP pIrp) { Index: halt.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/halt.h,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** halt.h 2 Dec 2008 16:07:37 -0000 1.1 --- halt.h 4 Aug 2010 10:38:55 -0000 1.2 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2005-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2005-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.2 2010/08/04 10:38:55 vfrolov + * Minimized PREfast noise + * * Revision 1.1 2008/12/02 16:07:37 vfrolov * Initial revision *************** *** 28,32 **** #define _HALT_H_ ! #if DBG #define HALT_UNLESS3(exp, p1, p2, p3) \ --- 31,39 ---- #define _HALT_H_ ! #if defined(_PREFAST_) ! ! #define HALT_UNLESS3(exp, p1, p2, p3) __assume(exp) ! ! #elif DBG #define HALT_UNLESS3(exp, p1, p2, p3) \ *************** *** 34,49 **** KeBugCheckEx(0xDEADC0CD, (FILE_ID << 16) + __LINE__, p1, p2, p3) ! #define HALT_UNLESS2(exp, p1, p2) HALT_UNLESS3(exp, p1, p2, 0) ! #define HALT_UNLESS1(exp, p1) HALT_UNLESS3(exp, p1, 0, 0) ! #define HALT_UNLESS(exp) HALT_UNLESS3(exp, 0, 0, 0) ! ! #else /* DBG */ #define HALT_UNLESS3(exp, p1, p2, p3) - #define HALT_UNLESS2(exp, p1, p2) - #define HALT_UNLESS1(exp, p1) - #define HALT_UNLESS(exp) ! #endif /* DBG */ #endif /* _HALT_H_ */ --- 41,53 ---- KeBugCheckEx(0xDEADC0CD, (FILE_ID << 16) + __LINE__, p1, p2, p3) ! #else #define HALT_UNLESS3(exp, p1, p2, p3) ! #endif ! ! #define HALT_UNLESS2(exp, p1, p2) HALT_UNLESS3(exp, p1, p2, 0) ! #define HALT_UNLESS1(exp, p1) HALT_UNLESS3(exp, p1, 0, 0) ! #define HALT_UNLESS(exp) HALT_UNLESS3(exp, 0, 0, 0) #endif /* _HALT_H_ */ Index: bufutils.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/bufutils.h,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** bufutils.h 30 Oct 2008 07:54:37 -0000 1.8 --- bufutils.h 4 Aug 2010 10:38:55 -0000 1.9 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2005-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2005-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2010/08/04 10:38:55 vfrolov + * Minimized PREfast noise + * * Revision 1.8 2008/10/30 07:54:37 vfrolov * Improved BREAK emulation *************** *** 84,88 **** BOOLEAN SetNewBufferBase(PC0C_BUFFER pBuf, PUCHAR pBase, SIZE_T size); VOID PurgeBuffer(PC0C_BUFFER pBuf); ! VOID InitBuffer(PC0C_BUFFER pBuf, PUCHAR pBase, SIZE_T size); VOID FreeBuffer(PC0C_BUFFER pBuf); VOID SetBufferLimit(PC0C_BUFFER pBuf, SIZE_T limit); --- 87,91 ---- BOOLEAN SetNewBufferBase(PC0C_BUFFER pBuf, PUCHAR pBase, SIZE_T size); VOID PurgeBuffer(PC0C_BUFFER pBuf); ! VOID InitBuffer(PC0C_BUFFER pBuf, __drv_aliasesMem PUCHAR pBase, SIZE_T size); VOID FreeBuffer(PC0C_BUFFER pBuf); VOID SetBufferLimit(PC0C_BUFFER pBuf, SIZE_T limit); Index: initunlo.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/initunlo.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** initunlo.c 23 Aug 2006 13:13:53 -0000 1.6 --- initunlo.c 4 Aug 2010 10:38:55 -0000 1.7 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2005 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.7 2010/08/04 10:38:55 vfrolov + * Minimized PREfast noise + * * Revision 1.6 2006/08/23 13:13:53 vfrolov * Moved c0cSystemControlDispatch() to wmi.c *************** *** 46,49 **** --- 49,53 ---- C0C_GLOBAL c0cGlobal; + DRIVER_INITIALIZE DriverEntry; NTSTATUS DriverEntry(IN PDRIVER_OBJECT pDrvObj, IN PUNICODE_STRING pRegistryPath) { Index: precomp.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/precomp.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** precomp.h 2 Dec 2008 16:10:09 -0000 1.3 --- precomp.h 4 Aug 2010 10:38:56 -0000 1.4 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.4 2010/08/04 10:38:56 vfrolov + * Minimized PREfast noise + * * Revision 1.3 2008/12/02 16:10:09 vfrolov * Separated tracing and debuging *************** *** 42,45 **** --- 45,86 ---- #pragma warning(pop) + #ifndef NTDDI_VERSION + + /* Declare stuff missing in old DDKs */ + + #define __drv_dispatchType(type) + #define __drv_aliasesMem + + typedef NTSTATUS DRIVER_INITIALIZE( + IN PDRIVER_OBJECT pDrvObj, + IN PUNICODE_STRING pRegistryPath); + + typedef VOID DRIVER_UNLOAD( + IN PDRIVER_OBJECT pDrvObj); + + typedef NTSTATUS DRIVER_ADD_DEVICE( + IN PDRIVER_OBJECT pDrvObj, + IN PDEVICE_OBJECT pPhDevObj); + + typedef NTSTATUS DRIVER_DISPATCH( + IN PDEVICE_OBJECT, + IN PIRP); + + typedef VOID DRIVER_CANCEL( + IN PDEVICE_OBJECT pDevObj, + IN PIRP pIrp); + + typedef VOID KDEFERRED_ROUTINE( + IN PKDPC pDpc, + IN PVOID deferredContext, + IN PVOID systemArgument1, + IN PVOID systemArgument2); + + NTSYSAPI NTSTATUS NTAPI ZwDeleteValueKey( + IN HANDLE KeyHandle, + IN PUNICODE_STRING ValueName); + + #endif /* NTDDI_VERSION */ + #define ENABLE_TRACING 1 Index: delay.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/delay.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** delay.c 26 Jun 2008 13:37:10 -0000 1.11 --- delay.c 4 Aug 2010 10:38:55 -0000 1.12 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2005-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2005-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2010/08/04 10:38:55 vfrolov + * Minimized PREfast noise + * * Revision 1.11 2008/06/26 13:37:10 vfrolov * Implemented noise emulation *************** *** 71,74 **** --- 74,78 ---- #define FILE_ID 7 + KDEFERRED_ROUTINE WriteDelayRoutine; VOID WriteDelayRoutine( IN PKDPC pDpc, *************** *** 84,87 **** --- 88,93 ---- UNREFERENCED_PARAMETER(systemArgument2); + HALT_UNLESS(deferredContext != NULL); + pIoPort = (PC0C_IO_PORT)deferredContext; pWriteDelay = pIoPort->pWriteDelay; Index: com0com.h =================================================================== RCS file: /cvsroot/com0com/com0com/sys/com0com.h,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** com0com.h 1 Jun 2010 06:14:10 -0000 1.49 --- com0com.h 4 Aug 2010 10:38:55 -0000 1.50 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.50 2010/08/04 10:38:55 vfrolov + * Minimized PREfast noise + * * Revision 1.49 2010/06/01 06:14:10 vfrolov * Improved driver updating *************** *** 425,449 **** extern C0C_GLOBAL c0cGlobal; ! VOID c0cUnload(IN PDRIVER_OBJECT pDrvObj); ! ! #define DeclareMajorFunction(mfunc) \ ! NTSTATUS mfunc(IN PDEVICE_OBJECT, IN PIRP) ! ! DeclareMajorFunction(c0cOpen); ! DeclareMajorFunction(c0cClose); ! DeclareMajorFunction(c0cWrite); ! DeclareMajorFunction(c0cRead); ! DeclareMajorFunction(c0cIoControl); ! DeclareMajorFunction(c0cInternalIoControl); ! DeclareMajorFunction(c0cCleanup); ! DeclareMajorFunction(c0cFileInformation); ! DeclareMajorFunction(c0cSystemControlDispatch); ! ! DeclareMajorFunction(c0cPnpDispatch); ! DeclareMajorFunction(c0cPowerDispatch); ! #undef DeclareMajorFunction - NTSTATUS c0cAddDevice(IN PDRIVER_OBJECT pDrvObj, IN PDEVICE_OBJECT pPhDevObj); VOID RemoveFdoPort(IN PC0C_FDOPORT_EXTENSION pDevExt); VOID RemoveFdoBus(IN PC0C_FDOBUS_EXTENSION pDevExt); --- 428,448 ---- extern C0C_GLOBAL c0cGlobal; ! DRIVER_UNLOAD c0cUnload; ! DRIVER_ADD_DEVICE c0cAddDevice; ! __drv_dispatchType(IRP_MJ_CREATE) DRIVER_DISPATCH c0cOpen; ! __drv_dispatchType(IRP_MJ_CLOSE) DRIVER_DISPATCH c0cClose; ! __drv_dispatchType(IRP_MJ_CLEANUP) DRIVER_DISPATCH c0cCleanup; ! __drv_dispatchType(IRP_MJ_FLUSH_BUFFERS) ! __drv_dispatchType(IRP_MJ_WRITE) DRIVER_DISPATCH c0cWrite; ! __drv_dispatchType(IRP_MJ_READ) DRIVER_DISPATCH c0cRead; ! __drv_dispatchType(IRP_MJ_DEVICE_CONTROL) DRIVER_DISPATCH c0cIoControl; ! __drv_dispatchType(IRP_MJ_INTERNAL_DEVICE_CONTROL) DRIVER_DISPATCH c0cInternalIoControl; ! __drv_dispatchType(IRP_MJ_QUERY_INFORMATION) ! __drv_dispatchType(IRP_MJ_SET_INFORMATION) DRIVER_DISPATCH c0cFileInformation; ! __drv_dispatchType(IRP_MJ_SYSTEM_CONTROL) DRIVER_DISPATCH c0cSystemControlDispatch; ! __drv_dispatchType(IRP_MJ_PNP) DRIVER_DISPATCH c0cPnpDispatch; ! __drv_dispatchType(IRP_MJ_POWER) DRIVER_DISPATCH c0cPowerDispatch; VOID RemoveFdoPort(IN PC0C_FDOPORT_EXTENSION pDevExt); VOID RemoveFdoBus(IN PC0C_FDOBUS_EXTENSION pDevExt); Index: timeout.c =================================================================== RCS file: /cvsroot/com0com/com0com/sys/timeout.c,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** timeout.c 17 Sep 2008 07:58:32 -0000 1.11 --- timeout.c 4 Aug 2010 10:38:56 -0000 1.12 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2004-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2004-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.12 2010/08/04 10:38:56 vfrolov + * Minimized PREfast noise + * * Revision 1.11 2008/09/17 07:58:32 vfrolov * Added AddRTTO and AddRITO parameters *************** *** 241,244 **** --- 244,248 ---- } + KDEFERRED_ROUTINE TimeoutReadTotal; VOID TimeoutReadTotal( IN PKDPC pDpc, *************** *** 247,251 **** IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort = (PC0C_IO_PORT)deferredContext; UNREFERENCED_PARAMETER(pDpc); --- 251,255 ---- IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort; UNREFERENCED_PARAMETER(pDpc); *************** *** 253,259 **** --- 257,268 ---- UNREFERENCED_PARAMETER(systemArgument2); + HALT_UNLESS(deferredContext != NULL); + + pIoPort = (PC0C_IO_PORT)deferredContext; + TimeoutRoutine(pIoPort, &pIoPort->irpQueues[C0C_QUEUE_READ]); } + KDEFERRED_ROUTINE TimeoutReadInterval; VOID TimeoutReadInterval( IN PKDPC pDpc, *************** *** 262,266 **** IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort = (PC0C_IO_PORT)deferredContext; UNREFERENCED_PARAMETER(pDpc); --- 271,275 ---- IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort; UNREFERENCED_PARAMETER(pDpc); *************** *** 268,274 **** --- 277,288 ---- UNREFERENCED_PARAMETER(systemArgument2); + HALT_UNLESS(deferredContext != NULL); + + pIoPort = (PC0C_IO_PORT)deferredContext; + TimeoutRoutine(pIoPort, &pIoPort->irpQueues[C0C_QUEUE_READ]); } + KDEFERRED_ROUTINE TimeoutWriteTotal; VOID TimeoutWriteTotal( IN PKDPC pDpc, *************** *** 277,281 **** IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort = (PC0C_IO_PORT)deferredContext; UNREFERENCED_PARAMETER(pDpc); --- 291,295 ---- IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort; UNREFERENCED_PARAMETER(pDpc); *************** *** 283,289 **** --- 297,308 ---- UNREFERENCED_PARAMETER(systemArgument2); + HALT_UNLESS(deferredContext != NULL); + + pIoPort = (PC0C_IO_PORT)deferredContext; + TimeoutRoutine(pIoPort, &pIoPort->irpQueues[C0C_QUEUE_WRITE]); } + KDEFERRED_ROUTINE TimeoutClose; VOID TimeoutClose( IN PKDPC pDpc, *************** *** 292,296 **** IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort = (PC0C_IO_PORT)deferredContext; UNREFERENCED_PARAMETER(pDpc); --- 311,315 ---- IN PVOID systemArgument2) { ! PC0C_IO_PORT pIoPort; UNREFERENCED_PARAMETER(pDpc); *************** *** 298,301 **** --- 317,324 ---- UNREFERENCED_PARAMETER(systemArgument2); + HALT_UNLESS(deferredContext != NULL); + + pIoPort = (PC0C_IO_PORT)deferredContext; + TimeoutRoutine(pIoPort, &pIoPort->irpQueues[C0C_QUEUE_CLOSE]); } |
From: Vyacheslav F. <vf...@us...> - 2010-07-30 09:27:26
|
Update of /cvsroot/com0com/com0com/setup In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv27419 Modified Files: inffile.cpp Log Message: Added STRDUP() Fixed updating the source location information by OemPath() and InstallOEMInf() Optimazed UninstallAllInfFiles() to look omly OEM files Index: inffile.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/inffile.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** inffile.cpp 16 Jul 2010 07:47:13 -0000 1.9 --- inffile.cpp 30 Jul 2010 09:27:18 -0000 1.10 *************** *** 20,23 **** --- 20,28 ---- * * $Log$ + * Revision 1.10 2010/07/30 09:27:18 vfrolov + * Added STRDUP() + * Fixed updating the source location information by OemPath() and InstallOEMInf() + * Optimazed UninstallAllInfFiles() to look omly OEM files + * * Revision 1.9 2010/07/16 07:47:13 vfrolov * Added using SetupUninstallOEMInf() if it exists in setupapi.dll *************** *** 219,234 **** char path[MAX_PATH + 1]; ! if (GetFilePath(pInfName, pNearPath, path, sizeof(path)/sizeof(path[0]))) { ! int len = lstrlen(path); ! ! pPath = (char *)LocalAlloc(LPTR, (len + 1)*sizeof(path[0])); ! ! if (pPath) { ! lstrcpy(pPath, path); ! } else { ! SetLastError(ERROR_NOT_ENOUGH_MEMORY); ! ShowLastError(MB_OK|MB_ICONSTOP, "LocalAlloc(%lu)", (unsigned long)(sizeof(path)/sizeof(path[0]))); ! } ! } } /////////////////////////////////////////////////////////////// --- 224,229 ---- char path[MAX_PATH + 1]; ! if (GetFilePath(pInfName, pNearPath, path, sizeof(path)/sizeof(path[0]))) ! pPath = STRDUP(path); } /////////////////////////////////////////////////////////////// *************** *** 303,320 **** char path[MAX_PATH + 1]; ! if (SetupCopyOEMInf(pPath, NULL, SPOST_NONE, SP_COPY_REPLACEONLY, path, ! sizeof(path)/sizeof(path[0]), NULL, NULL)) { ! int len = lstrlen(path) + 1; ! ! pOemPath = (char *)LocalAlloc(LPTR, len*sizeof(pOemPath[0])); ! ! if (pOemPath != NULL) { ! SNPRINTF(pOemPath, len, "%s", path); ! } else { ! SetLastError(ERROR_NOT_ENOUGH_MEMORY); ! if (showErrors) ! ShowLastError(MB_OK|MB_ICONSTOP, "LocalAlloc(%lu)", (unsigned long)(len*sizeof(pOemPath[0]))); ! } } } --- 298,306 ---- char path[MAX_PATH + 1]; ! if (SetupCopyOEMInf(pPath, NULL, SPOST_NONE, SP_COPY_REPLACEONLY|SP_COPY_NOOVERWRITE, ! path, sizeof(path)/sizeof(path[0]), NULL, NULL) || ! GetLastError() == ERROR_FILE_EXISTS) { ! pOemPath = STRDUP(path, showErrors); } } *************** *** 430,442 **** return FALSE; ! if (!OemPath()) { ! if (!SetupCopyOEMInf(pPath, NULL, SPOST_PATH, 0, NULL, 0, NULL, NULL)) { ! ShowLastError(MB_OK|MB_ICONSTOP, "SetupCopyOEMInf(%s)", pPath); ! return FALSE; ! } ! Trace("Installed %s to %s\n", pPath, OemPath()); } return TRUE; } --- 416,431 ---- return FALSE; ! BOOL wasInstalled = (OemPath() != NULL); ! if (!SetupCopyOEMInf(pPath, NULL, SPOST_PATH, 0, NULL, 0, NULL, NULL)) { ! ShowLastError(MB_OK|MB_ICONSTOP, "SetupCopyOEMInf(%s)", pPath); ! return FALSE; } + if (!wasInstalled) + Trace("Installed %s to %s\n", pPath, OemPath()); + else + Trace("Re-installed %s to %s\n", pPath, OemPath()); + return TRUE; } *************** *** 592,597 **** DWORD err = GetLastError(); ! Trace("\n"); ! ShowError(MB_OK|MB_ICONSTOP, err, "SetupGetInfFileList()"); return FALSE; --- 581,585 ---- DWORD err = GetLastError(); ! Trace(" FAIL\n"); ShowError(MB_OK|MB_ICONSTOP, err, "SetupGetInfFileList()"); return FALSE; *************** *** 607,612 **** DWORD err = GetLastError(); ! Trace("\n"); ! ShowError(MB_OK|MB_ICONSTOP, err, "SetupGetInfFileList(%lu)", (unsigned long)size); LocalFree(pList); --- 595,599 ---- DWORD err = GetLastError(); ! Trace(" FAIL\n"); ShowError(MB_OK|MB_ICONSTOP, err, "SetupGetInfFileList(%lu)", (unsigned long)size); LocalFree(pList); *************** *** 614,619 **** } } else { ! Trace("\n"); ! SetLastError(ERROR_NOT_ENOUGH_MEMORY); ShowLastError(MB_OK|MB_ICONSTOP, "LocalAlloc(%lu)", (unsigned long)size); --- 601,605 ---- } } else { ! Trace(" FAIL\n"); SetLastError(ERROR_NOT_ENOUGH_MEMORY); ShowLastError(MB_OK|MB_ICONSTOP, "LocalAlloc(%lu)", (unsigned long)size); *************** *** 630,635 **** DWORD err = !size ? GetLastError() : ERROR_BUFFER_OVERFLOW; ShowError(MB_OK|MB_ICONSTOP, err, "GetEnvironmentVariable(windir)"); - LocalFree(pList); return FALSE; --- 616,621 ---- DWORD err = !size ? GetLastError() : ERROR_BUFFER_OVERFLOW; + Trace(" FAIL\n"); ShowError(MB_OK|MB_ICONSTOP, err, "GetEnvironmentVariable(windir)"); LocalFree(pList); return FALSE; *************** *** 662,666 **** char infPath[MAX_PATH + 1]; ! if (SNPRINTF(infPath, sizeof(infPath)/sizeof(infPath[0]), "%s\\inf\\%s", windir, p) > 0) { InfFile infFile(infPath, NULL); BOOL doUninstall; --- 648,656 ---- char infPath[MAX_PATH + 1]; ! if ((p[0] == 'O' || p[0] == 'o') && ! (p[1] == 'E' || p[1] == 'e') && ! (p[2] == 'M' || p[2] == 'm') && ! SNPRINTF(infPath, sizeof(infPath)/sizeof(infPath[0]), "%s\\inf\\%s", windir, p) > 0) ! { InfFile infFile(infPath, NULL); BOOL doUninstall; |
From: Vyacheslav F. <vf...@us...> - 2010-07-30 09:19:36
|
Update of /cvsroot/com0com/com0com/setup In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv25717 Modified Files: msg.cpp setup.cpp Log Message: Added STRDUP() Index: msg.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/msg.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** msg.cpp 9 Nov 2009 11:16:43 -0000 1.8 --- msg.cpp 30 Jul 2010 09:19:29 -0000 1.9 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2009 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2010/07/30 09:19:29 vfrolov + * Added STRDUP() + * * Revision 1.8 2009/11/09 11:16:43 vfrolov * Added restoring last error *************** *** 284,298 **** if (pFile) { ! DWORD size = (lstrlen(pFile) + 1)*sizeof(*pFile); ! ! pOutputFile = (char *)LocalAlloc(LPTR, size); ! if (pOutputFile) { ! lstrcpy(pOutputFile, pFile); ! } else { ! SetLastError(ERROR_NOT_ENOUGH_MEMORY); ! ShowLastError(MB_OK|MB_ICONSTOP, "LocalAlloc(%lu)", (unsigned long)size); return FALSE; - } } --- 287,294 ---- if (pFile) { ! pOutputFile = STRDUP(pFile); ! if (!pOutputFile) return FALSE; } Index: setup.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/setup.cpp,v retrieving revision 1.43 retrieving revision 1.44 diff -C2 -d -r1.43 -r1.44 *** setup.cpp 29 Jul 2010 12:18:43 -0000 1.43 --- setup.cpp 30 Jul 2010 09:19:29 -0000 1.44 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.44 2010/07/30 09:19:29 vfrolov + * Added STRDUP() + * * Revision 1.43 2010/07/29 12:18:43 vfrolov * Fixed waiting stuff *************** *** 212,216 **** struct InfFileInstall { const char *pInfName; ! const char *CopyDriversSection; const char *pHardwareId; BOOL preinstallClass; --- 215,219 ---- struct InfFileInstall { const char *pInfName; ! const char *pCopyDriversSection; const char *pHardwareId; BOOL preinstallClass; *************** *** 1262,1267 **** goto err; ! if (pInfFileInstall->CopyDriversSection != NULL) { ! if (!infFile.UninstallFiles(pInfFileInstall->CopyDriversSection)) goto err; } --- 1265,1270 ---- goto err; ! if (pInfFileInstall->pCopyDriversSection != NULL) { ! if (!infFile.UninstallFiles(pInfFileInstall->pCopyDriversSection)) goto err; } *************** *** 1359,1374 **** { char *pPatternUp; - SIZE_T sizePattern; ! sizePattern = (lstrlen(pPattern) + 1) * sizeof(pPatternUp[0]); ! ! pPatternUp = (char *)LocalAlloc(LPTR, sizePattern); ! if (!pPatternUp) { ! ShowError(MB_OK|MB_ICONSTOP, ERROR_NOT_ENOUGH_MEMORY, "LocalAlloc(%lu)", (unsigned long)sizePattern); return FALSE; - } - lstrcpy(pPatternUp, pPattern); CharUpper(pPatternUp); --- 1362,1371 ---- { char *pPatternUp; ! pPatternUp = STRDUP(pPattern); ! if (!pPatternUp) return FALSE; CharUpper(pPatternUp); |
From: Vyacheslav F. <vf...@us...> - 2010-07-30 09:15:15
|
Update of /cvsroot/com0com/com0com/setup In directory sfp-cvsdas-2.v30.ch3.sourceforge.com:/tmp/cvs-serv24625 Modified Files: utils.cpp utils.h Log Message: Added STRDUP() Index: utils.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/utils.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** utils.cpp 25 Dec 2008 16:56:25 -0000 1.8 --- utils.cpp 30 Jul 2010 09:15:04 -0000 1.9 *************** *** 2,6 **** * $Id$ * ! * Copyright (c) 2006-2008 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify --- 2,6 ---- * $Id$ * ! * Copyright (c) 2006-2010 Vyacheslav Frolov * * This program is free software; you can redistribute it and/or modify *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.9 2010/07/30 09:15:04 vfrolov + * Added STRDUP() + * * Revision 1.8 2008/12/25 16:56:25 vfrolov * Added MatchPattern() *************** *** 49,52 **** --- 52,56 ---- #include "precomp.h" #include "utils.h" + #include "msg.h" /////////////////////////////////////////////////////////////// *************** *** 189,192 **** --- 193,214 ---- } /////////////////////////////////////////////////////////////// + char *STRDUP(const char *pSrcStr, BOOL showErrors) + { + char *pDstStr; + int len = lstrlen(pSrcStr) + 1; + + pDstStr = (char *)LocalAlloc(LPTR, len*sizeof(pDstStr[0])); + + if (pDstStr != NULL) { + SNPRINTF(pDstStr, len, "%s", pSrcStr); + } else { + SetLastError(ERROR_NOT_ENOUGH_MEMORY); + if (showErrors) + ShowLastError(MB_OK|MB_ICONSTOP, "LocalAlloc(%lu)", (unsigned long)(len*sizeof(pDstStr[0]))); + } + + return pDstStr; + } + /////////////////////////////////////////////////////////////// void BusyMask::Clear() { Index: utils.h =================================================================== RCS file: /cvsroot/com0com/com0com/setup/utils.h,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** utils.h 25 Dec 2008 16:56:25 -0000 1.7 --- utils.h 30 Jul 2010 09:15:04 -0000 1.8 *************** *** 20,23 **** --- 20,26 ---- * * $Log$ + * Revision 1.8 2010/07/30 09:15:04 vfrolov + * Added STRDUP() + * * Revision 1.7 2008/12/25 16:56:25 vfrolov * Added MatchPattern() *************** *** 47,50 **** --- 50,54 ---- #define _C0C_UTILS_H_ + /////////////////////////////////////////////////////////////// int VSNPRINTF(char *pBuf, int size, const char *pFmt, va_list va); int SNPRINTF(char *pBuf, int size, const char *pFmt, ...); *************** *** 52,56 **** BOOL StrToInt(const char *pStr, int *pNum); BOOL MatchPattern(const char *pPattern, const char *pStr); ! class BusyMask { public: --- 56,61 ---- BOOL StrToInt(const char *pStr, int *pNum); BOOL MatchPattern(const char *pPattern, const char *pStr); ! char *STRDUP(const char *pSrcStr, BOOL showErrors = TRUE); ! /////////////////////////////////////////////////////////////// class BusyMask { public: *************** *** 101,104 **** --- 106,110 ---- StackEl *pFirst; }; + /////////////////////////////////////////////////////////////// #endif /* _C0C_UTILS_H_ */ |