[Com0com-cvs] com0com/setup devutils.cpp, 1.20, 1.21 devutils.h, 1.13, 1.14 setup.cpp, 1.53, 1.54
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
|
From: Vyacheslav F. <vf...@us...> - 2012-01-10 11:24:30
|
Update of /cvsroot/com0com/com0com/setup
In directory vz-cvs-4.sog:/tmp/cvs-serv20345
Modified Files:
devutils.cpp devutils.h setup.cpp
Log Message:
Added ability to repeate waiting for no pending device
installation activities
Index: devutils.h
===================================================================
RCS file: /cvsroot/com0com/com0com/setup/devutils.h,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** devutils.h 15 Dec 2011 15:51:48 -0000 1.13
--- devutils.h 10 Jan 2012 11:24:27 -0000 1.14
***************
*** 2,6 ****
* $Id$
*
! * Copyright (c) 2006-2011 Vyacheslav Frolov
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* $Id$
*
! * Copyright (c) 2006-2012 Vyacheslav Frolov
*
* This program is free software; you can redistribute it and/or modify
***************
*** 20,23 ****
--- 20,27 ----
*
* $Log$
+ * Revision 1.14 2012/01/10 11:24:27 vfrolov
+ * Added ability to repeate waiting for no pending device
+ * installation activities
+ *
* Revision 1.13 2011/12/15 15:51:48 vfrolov
* Fixed types
***************
*** 171,175 ****
bool WaitNoPendingInstallEvents(
! int timeLimit);
///////////////////////////////////////////////////////////////
--- 175,180 ----
bool WaitNoPendingInstallEvents(
! int timeLimit,
! bool repeate = FALSE);
///////////////////////////////////////////////////////////////
Index: setup.cpp
===================================================================
RCS file: /cvsroot/com0com/com0com/setup/setup.cpp,v
retrieving revision 1.53
retrieving revision 1.54
diff -C2 -d -r1.53 -r1.54
*** setup.cpp 29 Dec 2011 14:34:23 -0000 1.53
--- setup.cpp 10 Jan 2012 11:24:27 -0000 1.54
***************
*** 2,6 ****
* $Id$
*
! * Copyright (c) 2006-2011 Vyacheslav Frolov
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* $Id$
*
! * Copyright (c) 2006-2012 Vyacheslav Frolov
*
* This program is free software; you can redistribute it and/or modify
***************
*** 20,23 ****
--- 20,27 ----
*
* $Log$
+ * Revision 1.54 2012/01/10 11:24:27 vfrolov
+ * Added ability to repeate waiting for no pending device
+ * installation activities
+ *
* Revision 1.53 2011/12/29 14:34:23 vfrolov
* Implemented RealPortName=COM<n> for PortName=COM#
***************
*** 290,293 ****
--- 294,298 ----
///////////////////////////////////////////////////////////////
static int timeout = 0;
+ static bool repeate_timeout = FALSE;
static bool detailPrms = FALSE;
static bool no_update = FALSE;
***************
*** 1853,1857 ****
"Options:\n"
" --output <file> - file for output, default is console\n"
! " --wait <to> - wait <to> seconds for install completion\n"
" (by default <to> is 0 - no wait)\n"
" --detail-prms - show detailed parameters\n"
--- 1858,1864 ----
"Options:\n"
" --output <file> - file for output, default is console\n"
! " --wait [+]<to> - wait <to> seconds for install completion. If\n"
! " <to> has '+' prefix then ask user to continue\n"
! " waiting after <to> seconds elapsing\n"
" (by default <to> is 0 - no wait)\n"
" --detail-prms - show detailed parameters\n"
***************
*** 1967,1971 ****
if (ok) {
if (timeout > 0)
! WaitNoPendingInstallEvents(timeout);
return 0;
--- 1974,1978 ----
if (ok) {
if (timeout > 0)
! WaitNoPendingInstallEvents(timeout, repeate_timeout);
return 0;
***************
*** 1982,1985 ****
--- 1989,1993 ----
Silent(FALSE);
timeout = 0;
+ repeate_timeout = FALSE;
detailPrms = FALSE;
no_update = FALSE;
***************
*** 2002,2007 ****
int num;
! if (StrToInt(argv[2], &num) && num >= 0)
! timeout = num;
argv[2] = argv[0];
--- 2010,2022 ----
int num;
! if (!StrToInt(argv[2], &num) || num < 0) {
! ConsoleWrite("Invalid option %s %s\n", argv[1], argv[2]);
! return 1;
! }
!
! timeout = num;
!
! if (argv[2][0] == '+')
! repeate_timeout = TRUE;
argv[2] = argv[0];
Index: devutils.cpp
===================================================================
RCS file: /cvsroot/com0com/com0com/setup/devutils.cpp,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** devutils.cpp 15 Dec 2011 15:51:48 -0000 1.20
--- devutils.cpp 10 Jan 2012 11:24:27 -0000 1.21
***************
*** 2,6 ****
* $Id$
*
! * Copyright (c) 2006-2011 Vyacheslav Frolov
*
* This program is free software; you can redistribute it and/or modify
--- 2,6 ----
* $Id$
*
! * Copyright (c) 2006-2012 Vyacheslav Frolov
*
* This program is free software; you can redistribute it and/or modify
***************
*** 20,23 ****
--- 20,27 ----
*
* $Log$
+ * Revision 1.21 2012/01/10 11:24:27 vfrolov
+ * Added ability to repeate waiting for no pending device
+ * installation activities
+ *
* Revision 1.20 2011/12/15 15:51:48 vfrolov
* Fixed types
***************
*** 946,950 ****
}
///////////////////////////////////////////////////////////////
! bool WaitNoPendingInstallEvents(int timeLimit)
{
typedef DWORD (WINAPI *PWAITNOPENDINGINSTALLEVENTS)(IN DWORD);
--- 950,954 ----
}
///////////////////////////////////////////////////////////////
! bool WaitNoPendingInstallEvents(int timeLimit, bool repeate)
{
typedef DWORD (WINAPI *PWAITNOPENDINGINSTALLEVENTS)(IN DWORD);
***************
*** 981,984 ****
--- 985,989 ----
if (inTrace)
Trace(" OK\n");
+
SetLastError(ERROR_SUCCESS);
break;
***************
*** 997,1002 ****
if (timeLimit != -1 && timeElapsed >= DWORD(timeLimit * 1000)) {
! if (inTrace)
Trace(" timeout\n");
SetLastError(ERROR_TIMEOUT);
break;
--- 1002,1023 ----
if (timeLimit != -1 && timeElapsed >= DWORD(timeLimit * 1000)) {
! if (inTrace) {
Trace(" timeout\n");
+ inTrace = FALSE;
+ }
+
+ if (!Silent() && repeate) {
+ if (ShowMsg(MB_YESNO,
+ "The device installation activities are still pending.\n"
+ "Continue to wait?\n") == IDYES)
+ {
+ startTime = GetTickCount();
+ } else {
+ repeate = FALSE;
+ }
+
+ continue;
+ }
+
SetLastError(ERROR_TIMEOUT);
break;
***************
*** 1005,1011 ****
if (!inTrace) {
if (timeLimit != -1)
! Trace("Wating for no pending device installation activities (%u secs) ", (unsigned)timeLimit);
else
! Trace("Wating for no pending device installation activities (perpetually) ");
inTrace = TRUE;
--- 1026,1032 ----
if (!inTrace) {
if (timeLimit != -1)
! Trace("Waiting for no pending device installation activities (%u secs) ", (unsigned)timeLimit);
else
! Trace("Waiting for no pending device installation activities (perpetually) ");
inTrace = TRUE;
|