Refactor AppleDOS and solves bug preventing VTOC from being retrieved as "$Vtoc".

This commit is contained in:
2017-12-22 07:05:08 +00:00
parent 0ad9da7b3a
commit 56986338be
5 changed files with 50 additions and 61 deletions

View File

@@ -47,9 +47,7 @@ namespace DiscImageChef.Filesystems.AppleDOS
/// <param name="dest">Link destination.</param>
public override Errno ReadLink(string path, ref string dest)
{
if(!mounted) return Errno.AccessDenied;
return Errno.NotSupported;
return !mounted ? Errno.AccessDenied : Errno.NotSupported;
}
/// <summary>
@@ -97,10 +95,9 @@ namespace DiscImageChef.Filesystems.AppleDOS
if(debug) catalogMs.Write(catSectorB, 0, catSectorB.Length);
// Read the catalog sector
CatalogSector catSector;
IntPtr catPtr = Marshal.AllocHGlobal(256);
Marshal.Copy(catSectorB, 0, catPtr, 256);
catSector = (CatalogSector)Marshal.PtrToStructure(catPtr, typeof(CatalogSector));
CatalogSector catSector = (CatalogSector)Marshal.PtrToStructure(catPtr, typeof(CatalogSector));
Marshal.FreeHGlobal(catPtr);
foreach(FileEntry entry in catSector.entries.Where(entry => entry.extentTrack > 0)) {