Index: branches/fat32-0.9/src/ifscache.c =================================================================== --- branches/fat32-0.9/src/ifscache.c (revision 82) +++ branches/fat32-0.9/src/ifscache.c (revision 83) @@ -266,9 +266,11 @@ -#define Cluster2Sector( ulCluster ) (( ULONG )( pVolInfo->ulStartOfData + \ - (( ULONG )( ulCluster ) - 2) * pVolInfo->BootSect.bpb.SectorsPerCluster )) - -#define Sector2Cluster( ulSector ) (( ULONG )((( ULONG )( ulSector ) - pVolInfo->ulStartOfData ) / \ - pVolInfo->BootSect.bpb.SectorsPerCluster + 2 )) +#define Cluster2Sector( pVolInfo, ulCluster ) \ + (( ULONG )(( pVolInfo )->ulStartOfData + \ + (( ULONG )( ulCluster ) - 2) * ( pVolInfo )->BootSect.bpb.SectorsPerCluster )) + +#define Sector2Cluster( pVolInfo, ulSector ) \ + (( ULONG )((( ULONG )( ulSector ) - ( pVolInfo )->ulStartOfData ) / \ + ( pVolInfo )->BootSect.bpb.SectorsPerCluster + 2 )) /****************************************************************** @@ -341,6 +343,6 @@ if( ulSector>= pVolInfo->ulStartOfData ) { - ULONG ulStartCluster = Sector2Cluster( ulSector ); - ULONG ulEndCluster = Sector2Cluster( ulSector + usSectors - 1 ); + ULONG ulStartCluster = Sector2Cluster( pVolInfo, ulSector ); + ULONG ulEndCluster = Sector2Cluster( pVolInfo, ulSector + usSectors - 1 ); ULONG ulNextCluster = 0; ULONG ulCluster; @@ -356,5 +358,5 @@ { usSectors = ( ulStartCluster != ulCluster ) ? - ( min(( USHORT )( Cluster2Sector( ulCluster ) - ulSector ), usSectors )) : 0; + ( min(( USHORT )( Cluster2Sector( pVolInfo, ulCluster ) - ulSector ), usSectors )) : 0; } }

AltStyle によって変換されたページ (->オリジナル) /