TRACE(( "scanThread got rc %d, quitting\n", (int)rc));
PRINTF( "scanThread got rc %d, quitting\n", (int)rc);
void fsTree::Scan(){   // Set up the notify thread   mCBQueue.Create();   _beginthread( notifyThread, 0, 32768, this);   // Do root node   CreateRootNode();   // Do drives -- root dir for each drive   // This will do *everything* if we're not in Lazy mode.   CreateDrives();   // Signal that we've done the initial scan.   // This lets the user thread go if we're synchronous.   SendCompleteMsg();   // Process commands   for(;;)   {      RQPacket pkt;      APIRET rc = mRQQueue.Read( &pkt);      if( rc)      {         TRACE(( "scanThread got rc %d, quitting\n", (int)rc));         break;      }      switch( pkt.mCmd)      {         case RQPacket::Expand:         {            // scan on each child of pkt.mDir            fsDir *pDir = pkt.mDir->GetFirstChild();            while( pDir)            {               ScanForChildren( pDir);               pDir = pDir->GetNextSibling();            }            break;         }         case RQPacket::Trash:         {            // Refresh a node - destroy tree below & rescan at top level.            fsDir *pDir = pkt.mDir->GetFirstChild();            pkt.mDir->SetChild(0);            while( pDir)            {               fsDir *pTemp = pDir->GetNextSibling();               Lock();               DestroyNode( pDir); // pDir no longer valid               Unlock();               pDir = pTemp;            }            ScanForChildren( pkt.mDir);            break;         }         case RQPacket::Foliate:            // scan for files in pkt.mDir            Foliate( pkt.mDir);            break;         case RQPacket::Defoliate:            // remove all leaves from pkt.mDir            Defoliate( pkt.mDir);            break;      }   }}