[Com0com-cvs] com0com/setup devutils.cpp,1.5,1.6
The virtual serial port driver for Windows.
Brought to you by:
vfrolov
From: Vyacheslav F. <vf...@us...> - 2007-09-14 12:58:52
|
Update of /cvsroot/com0com/com0com/setup In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv2783 Modified Files: devutils.cpp Log Message: Removed INSTALLFLAG_FORCE Added UpdateDriverForPlugAndPlayDevices() retrying Index: devutils.cpp =================================================================== RCS file: /cvsroot/com0com/com0com/setup/devutils.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** devutils.cpp 15 Feb 2007 08:48:45 -0000 1.5 --- devutils.cpp 14 Sep 2007 12:58:44 -0000 1.6 *************** *** 20,23 **** --- 20,27 ---- * * $Log$ + * Revision 1.6 2007/09/14 12:58:44 vfrolov + * Removed INSTALLFLAG_FORCE + * Added UpdateDriverForPlugAndPlayDevices() retrying + * * Revision 1.5 2007/02/15 08:48:45 vfrolov * Fixed 1658441 - Installation Failed *************** *** 534,543 **** } ! BOOL rebootRequired; ! res = UpdateDriverForPlugAndPlayDevices(0, pDevId, infFile.Path(), INSTALLFLAG_FORCE, &rebootRequired); ! if (!res) { ! updateErr = GetLastError(); err1: --- 538,567 ---- } ! int i; ! for (i = 0 ; i < 10 ; i++) { ! BOOL rebootRequired; ! ! res = UpdateDriverForPlugAndPlayDevices(0, pDevId, infFile.Path(), 0, &rebootRequired); ! ! if (res) { ! updateErr = ERROR_SUCCESS; ! } else { ! updateErr = GetLastError(); + if (updateErr == ERROR_SHARING_VIOLATION) { + Trace("."); + Sleep(1000); + continue; + } + } + + if (i) + Trace("\n"); + + break; + } + + if (updateErr != ERROR_SUCCESS) { err1: *************** *** 585,589 **** } ! ShowError(MB_OK|MB_ICONSTOP, updateErr, "UpdateDriverForPlugAndPlayDevices()"); } --- 609,613 ---- } ! return ShowError(MB_CANCELTRYCONTINUE, updateErr, "UpdateDriverForPlugAndPlayDevices()"); } |