src/wfcomman.c
/////////////////////////////////////////////////////////////////////
//
// Name:     UpdateConnectionsOnConnect
//
// Synopsis: This handles updating connections after a new connection
//           is created.  It only invalidates aWNetGetCon[i] for the
//           new drive.  If there is no new drive (i.e., a replaced
//           connection), then all are invalidated.
//
//           If you want everything to update always, just modify
//           this routine to always set all bValids to FALSE.
//
//
// Return:   INT      >= 0 iDrive that is new
//                    = -1 if no detected new drive letter
//
// Assumes:
//
// Effects:
//
//
// Notes:    Updates drive list by calling worker thread.
//
// Rev:      216 1.22
//
/////////////////////////////////////////////////////////////////////

UpdateConnectionsOnConnect
Synopsis: This handles updating connections after a new connection
is created.  It only invalidates aWNetGetCon[i] for the
new drive.  If there is no new drive , then all are invalidated.

If you want everything to update always, just modify
this routine to always set all bValids to FALSE.

INT      >= 0 iDrive that is new
-1 if no detected new drive letter





Updates drive list by calling worker thread.


UpdateConnectionsOnConnect Synopsis : This handles updating connections after a new connection is created . It only invalidates aWNetGetCon [ i ] for the new drive . If there is no new drive then all are invalidated . If you want everything to update always just modify this routine to always set all bValids to FALSE . INT > = 0 iDrive that is new - 1 if no detected new drive letter Updates drive list by calling worker thread .
INT
UpdateConnectionsOnConnect(VOID)
{
   INT rgiOld[MAX_DRIVES];
   BOOL abRemembered[MAX_DRIVES];
   PDRIVEINFO pDriveInfo;
   DRIVE drive;
   DRIVEIND i;
   for (i=0; i<MAX_DRIVES; i++)
      rgiOld[i] = rgiDrive[i];
   for (pDriveInfo=&aDriveInfo[0], i=0; i<MAX_DRIVES; i++, pDriveInfo++)
      abRemembered[i] = pDriveInfo->bRemembered;
   UpdateDriveList();
   for (i=0; i<MAX_DRIVES; i++) {
      drive = rgiDrive[i];
      if (rgiOld[i] != drive ||
         (abRemembered[drive] && !aDriveInfo[drive].bRemembered)) {
         break;
      }
   }
   if (i < MAX_DRIVES) {
      I_NetCon(rgiDrive[i]);
      return rgiDrive[i];
   } else {
      return -1;
   }
}
INT UpdateConnectionsOnConnect ( VOID ) { INT rgiOld [ MAX_DRIVES ] ; BOOL abRemembered [ MAX_DRIVES ] ; PDRIVEINFO pDriveInfo ; DRIVE drive ; DRIVEIND i ; for ( i = 0 ; i < MAX_DRIVES ; i ++ ) rgiOld [ i ] = rgiDrive [ i ] ; for ( pDriveInfo = & aDriveInfo [ 0 ] , i = 0 ; i < MAX_DRIVES ; i ++ , pDriveInfo ++ ) abRemembered [ i ] = pDriveInfo -> bRemembered ; UpdateDriveList ( ) ; for ( i = 0 ; i < MAX_DRIVES ; i ++ ) { drive = rgiDrive [ i ] ; if ( rgiOld [ i ] != drive || ( abRemembered [ drive ] && ! aDriveInfo [ drive ] . bRemembered ) ) { break ; } } if ( i < MAX_DRIVES ) { I_NetCon ( rgiDrive [ i ] ) ; return rgiDrive [ i ] ; } else { return -1 ; } }
Name:     UpdateConnectionsOnConnect
Synopsis: This handles updating connections after a new connection
is created.
Name : UpdateConnectionsOnConnect Synopsis : This handles updating connections after a new connection is created .
//
 // save old drive map so that we can compare it against the
 // current map for new drives.
 //
 //
 // save a list of what's remembered
 //
 //
 // Now update the drive list
 //
 //
 // !! BUGBUG !!
 //
 // This will fail if the user add/deletes drives from cmd then
 // attempts to add a connection using winfile without refreshing first.
 //
