Пример #1
0
BOOL FindClusterInFAT(RDWRHandle handle, CLUSTER tofind, CLUSTER* result)
{
   struct Pipe pipe, *ppipe=&pipe;
   CLUSTER cluster;
   
   pipe.tofind = tofind;
   pipe.sector = 0;
   pipe.found  = FALSE;
  
   if (!LinearTraverseFat(handle, ClusterInFATFinder, (void**) &ppipe))
      return FALSE;

   if (!pipe.found)
   {
      *result = 0;
      return TRUE;
   }
      
   if (!pipe.sector)                  /* This should never happen */
   {
      *result = 0;
      return FALSE;
   }
      
   cluster = DataSectorToCluster(handle, pipe.sector);
   if (!cluster) return FALSE;
   
   *result = cluster;
   return TRUE;
}
Пример #2
0
RETVAL MakeFatLabelsValid(RDWRHandle handle)
{
   struct Pipe pipe, *ppipe = &pipe;
   
   pipe.invalidfound = FALSE;
   pipe.fixit        = TRUE;

   if (!LinearTraverseFat(handle, ValidityChecker, (void**) &ppipe))
      return ERROR;
    
   return SUCCESS;
}
Пример #3
0
RETVAL CheckFatLabelValidity(RDWRHandle handle)
{
   struct Pipe pipe, *ppipe = &pipe;
   
   pipe.invalidfound = FALSE;
   pipe.fixit        = FALSE;

   if (!LinearTraverseFat(handle, ValidityChecker, (void**) &ppipe))
      return ERROR;

   return (pipe.invalidfound) ? FAILED : SUCCESS;
}