* DiscImageChef.Tests/Filters/PCExchange.cs:

* DiscImageChef.Tests/DiscImageChef.Tests.csproj:
	  Added test for PCExchange filter.

	* DiscImageChef.Filters/PCExchange.cs:
	  Solved handling last entry of FINDER.DAT.
	Close FINDER.DAT to prevent sharing violation.
This commit is contained in:
2017-06-29 23:41:14 +01:00
parent 0fa84cf895
commit 25c6c78516
3 changed files with 127 additions and 2 deletions

View File

@@ -215,7 +215,7 @@ namespace DiscImageChef.Filters
FileStream finderDatStream = new FileStream(Path.Combine(parentFolder, FinderInfo), FileMode.Open, FileAccess.Read);
while(finderDatStream.Position + 0x5C < finderDatStream.Length)
while(finderDatStream.Position + 0x5C <= finderDatStream.Length)
{
PCExchangeEntry datEntry = new PCExchangeEntry();
byte[] datEntry_b = new byte[Marshal.SizeOf(datEntry)];
@@ -269,7 +269,7 @@ namespace DiscImageChef.Filters
FileStream finderDatStream = new FileStream(Path.Combine(parentFolder, FinderInfo), FileMode.Open, FileAccess.Read);
while(finderDatStream.Position + 0x5C < finderDatStream.Length)
while(finderDatStream.Position + 0x5C <= finderDatStream.Length)
{
PCExchangeEntry datEntry = new PCExchangeEntry();
byte[] datEntry_b = new byte[Marshal.SizeOf(datEntry)];
@@ -313,6 +313,8 @@ namespace DiscImageChef.Filters
basePath = path;
opened = true;
finderDatStream.Close();
}
}
}