TempleOSTS_131005.ISO
This commit is contained in:
1 parent
1343005a29
commit
2d2a65d572
547 files changed
+33608
-12549
No files matched your search
@@ -11,37 +11,37 @@ Bool ChkDskConfirm(Bool *_fix,Bool *_confirm)
|
||||
return *_fix;
|
||||
}
|
||||
|
||||
I64 RedSeaFSChkDskLst(CDirEntry *tempm1,U8 *bits,U8 *bits2,I64 size,I64 bpc)
|
||||
I64 RedSeaFSChkDskLst(CDirEntry *tempde1,U8 *bits,U8 *bits2,I64 size,I64 bpc)
|
||||
{
|
||||
CDirEntry *tempm2;
|
||||
CDirEntry *tempde2;
|
||||
I64 i,j,errs=0;
|
||||
while (tempm1) {
|
||||
tempm2=tempm1->next;
|
||||
if (tempm1->attr & _ATTR_DIR) {
|
||||
if (tempm1->sub)
|
||||
errs+=RedSeaFSChkDskLst(tempm1->sub,bits,bits2,size,bpc);
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & _ATTR_DIR) {
|
||||
if (tempde1->sub)
|
||||
errs+=RedSeaFSChkDskLst(tempde1->sub,bits,bits2,size,bpc);
|
||||
}
|
||||
j=(tempm1->size+bpc-1)/bpc;
|
||||
j=(tempde1->size+bpc-1)/bpc;
|
||||
for (i=0;i<j;i++) {
|
||||
if (i+tempm1->cluster>size) {
|
||||
PrintFErr("Invalid Cluster:%s Cluster:%X\n",tempm1->full_name,
|
||||
i+tempm1->cluster);
|
||||
if (i+tempde1->cluster>size) {
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tempde1->full_name,
|
||||
i+tempde1->cluster);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,i+tempm1->cluster)) {
|
||||
PrintFErr("Dbl Alloc:%s Cluster:%X\n",tempm1->full_name,
|
||||
i+tempm1->cluster);
|
||||
if (LBts(bits,i+tempde1->cluster)) {
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tempde1->full_name,
|
||||
i+tempde1->cluster);
|
||||
errs++;
|
||||
}
|
||||
if (!LBtr(bits2,i+tempm1->cluster)) {
|
||||
PrintFErr("UnAlloc:%s Cluster:%X\n",tempm1->full_name,
|
||||
i+tempm1->cluster);
|
||||
if (!LBtr(bits2,i+tempde1->cluster)) {
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tempde1->full_name,
|
||||
i+tempde1->cluster);
|
||||
errs++;
|
||||
}
|
||||
}
|
||||
CDirEntryDel(tempm1);
|
||||
tempm1=tempm2;
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
}
|
||||
return errs;
|
||||
}
|
||||
@@ -50,7 +50,7 @@ I64 RedSeaFSChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
{
|
||||
I64 i,j,bpc,size,errs=0;
|
||||
CPrt *p=Drv2Prt(drv_let),*old_prt=Fs->cur_prt;
|
||||
U8 *files_find_mask=MSPrintF("%c:/*",Prt2Drv(p)),
|
||||
U8 *files_find_mask=MPrint("%c:/*",Prt2Drv(p)),
|
||||
*old_dir=StrNew(Fs->cur_dir),
|
||||
*bits,*bits2;
|
||||
CDirEntry *ptr,*ptr2;
|
||||
@@ -72,16 +72,16 @@ I64 RedSeaFSChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
|
||||
for (i=0;i<j;i++) {
|
||||
if (i+p->root_cluster>size) {
|
||||
PrintFErr("Invalid Cluster: RootDir Cluster:%X\n",i+p->root_cluster);
|
||||
PrintErr("Invalid Cluster: RootDir Cluster:%X\n",i+p->root_cluster);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,i+p->root_cluster)) {
|
||||
PrintFErr("Dbl Alloc: RootDir Cluster:%X\n",i+p->root_cluster);
|
||||
PrintErr("Dbl Alloc: RootDir Cluster:%X\n",i+p->root_cluster);
|
||||
errs++;
|
||||
}
|
||||
if (!LBtr(bits2,i+p->root_cluster)) {
|
||||
PrintFErr("UnAlloc: RootDir Cluster:%X\n",i+p->root_cluster);
|
||||
PrintErr("UnAlloc: RootDir Cluster:%X\n",i+p->root_cluster);
|
||||
errs++;
|
||||
}
|
||||
}
|
||||
@@ -89,7 +89,7 @@ I64 RedSeaFSChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
errs+=RedSeaFSChkDskLst(FilesFind(files_find_mask,FUF_RECURSE),bits,bits2,size,bpc);
|
||||
for (i=1;i<size;i++)
|
||||
if (Bt(bits2,i)) {
|
||||
PrintFWarn("Shouldn't Alloc Cluster:%0X\n",i);
|
||||
PrintWarn("Shouldn't Alloc Cluster:%0X\n",i);
|
||||
errs++;
|
||||
if (ChkDskConfirm(_fix,_confirm))
|
||||
RedSeaFSFreeClusters(p,i,1);
|
||||
@@ -104,49 +104,49 @@ I64 RedSeaFSChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
return errs;
|
||||
}
|
||||
|
||||
I64 FAT32ChkDskLst(CPrt *p,CDirEntry *tempm1,U8 *bits,U32 *bits2,I64 size,I64 bpc)
|
||||
I64 FAT32ChkDskLst(CPrt *p,CDirEntry *tempde1,U8 *bits,U32 *bits2,I64 size,I64 bpc)
|
||||
{
|
||||
CDirEntry *tempm2;
|
||||
CDirEntry *tempde2;
|
||||
I64 i,c,errs=0;
|
||||
while (tempm1) {
|
||||
tempm2=tempm1->next;
|
||||
if (tempm1->attr & _ATTR_DIR) {
|
||||
if (tempm1->sub)
|
||||
errs+=FAT32ChkDskLst(p,tempm1->sub,bits,bits2,size,bpc);
|
||||
while (tempde1) {
|
||||
tempde2=tempde1->next;
|
||||
if (tempde1->attr & _ATTR_DIR) {
|
||||
if (tempde1->sub)
|
||||
errs+=FAT32ChkDskLst(p,tempde1->sub,bits,bits2,size,bpc);
|
||||
}
|
||||
i=0;
|
||||
c=tempm1->cluster;
|
||||
c=tempde1->cluster;
|
||||
while (0<c<0x0FFFFFF8) {
|
||||
if (c>size) {
|
||||
PrintFErr("Invalid Cluster:%s Cluster:%X\n",tempm1->full_name,c);
|
||||
PrintErr("Invalid Cluster:%s Cluster:%X\n",tempde1->full_name,c);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,c)) {
|
||||
PrintFErr("Dbl Alloc:%s Cluster:%X\n",tempm1->full_name,c);
|
||||
PrintErr("Dbl Alloc:%s Cluster:%X\n",tempde1->full_name,c);
|
||||
errs++;
|
||||
}
|
||||
if (!bits2[c]) {
|
||||
PrintFErr("UnAlloc:%s Cluster:%X\n",tempm1->full_name,c);
|
||||
PrintErr("UnAlloc:%s Cluster:%X\n",tempde1->full_name,c);
|
||||
errs++;
|
||||
} else
|
||||
bits2[c]=0;
|
||||
c=ClusterNumNext(p,c);
|
||||
i++;
|
||||
}
|
||||
if (!(tempm1->attr & _ATTR_DIR)) {
|
||||
if (!(tempde1->attr & _ATTR_DIR)) {
|
||||
i*=bpc;
|
||||
if (tempm1->size>i) {
|
||||
PrintFErr("Allocated File Too Short:%s\n",tempm1->full_name);
|
||||
if (tempde1->size>i) {
|
||||
PrintErr("Allocated File Too Short:%s\n",tempde1->full_name);
|
||||
errs++;
|
||||
}
|
||||
if (i>tempm1->size+bpc-1) {
|
||||
PrintFWarn("Allocated File Too Long:%s\n",tempm1->full_name);
|
||||
if (i>tempde1->size+bpc-1) {
|
||||
PrintWarn("Allocated File Too Long:%s\n",tempde1->full_name);
|
||||
errs++;
|
||||
}
|
||||
}
|
||||
CDirEntryDel(tempm1);
|
||||
tempm1=tempm2;
|
||||
DirEntryDel(tempde1);
|
||||
tempde1=tempde2;
|
||||
}
|
||||
return errs;
|
||||
}
|
||||
@@ -155,7 +155,7 @@ I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
{
|
||||
I64 i,bpc,size,c,errs=0;
|
||||
CPrt *p=Drv2Prt(drv_let),*old_prt=Fs->cur_prt;
|
||||
U8 *files_find_mask=MSPrintF("%c:/*",Prt2Drv(p)),
|
||||
U8 *files_find_mask=MPrint("%c:/*",Prt2Drv(p)),
|
||||
*old_dir=StrNew(Fs->cur_dir),
|
||||
*bits;
|
||||
U32 *bits2;
|
||||
@@ -170,16 +170,16 @@ I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
c=p->root_cluster;
|
||||
while (0<c<0x0FFFFFF8) {
|
||||
if (c>size) {
|
||||
PrintFErr("Invalid Cluster: RootDir Cluster:%X\n",c);
|
||||
PrintErr("Invalid Cluster: RootDir Cluster:%X\n",c);
|
||||
errs++;
|
||||
break;
|
||||
}
|
||||
if (LBts(bits,c)) {
|
||||
PrintFErr("Dbl Alloc: RootDir Cluster:%X\n",c);
|
||||
PrintErr("Dbl Alloc: RootDir Cluster:%X\n",c);
|
||||
errs++;
|
||||
}
|
||||
if (!bits2[c]) {
|
||||
PrintFErr("UnAlloc: RootDir Cluster:%X\n",c);
|
||||
PrintErr("UnAlloc: RootDir Cluster:%X\n",c);
|
||||
errs++;
|
||||
} else
|
||||
bits2[c]=0;
|
||||
@@ -191,7 +191,7 @@ I64 FAT32ChkDsk(U8 drv_let,Bool *_fix,Bool *_confirm)
|
||||
bits2[1]=0; //See $LK,"FAT32Fmt","MN:FAT32Fmt"$()
|
||||
for (i=1;i<size;i++)
|
||||
if (bits2[i]) {
|
||||
PrintFWarn("Shouldn't Alloc Cluster:%0X\n",i);
|
||||
PrintWarn("Shouldn't Alloc Cluster:%0X\n",i);
|
||||
errs++;
|
||||
if (ChkDskConfirm(_fix,_confirm))
|
||||
FAT32FreeClusters(p,i);
|
||||
|
||||
Reference in new issue
Block a user