mirror of
https://github.com/SabreTools/BinaryObjectScanner.git
synced 2026-07-12 20:07:02 +00:00
Skip other null writes for other packages
This commit is contained in:
@@ -1113,7 +1113,12 @@ namespace LibMSPackSharp.CHM
|
||||
/// </summary>
|
||||
private static int SysWrite(object file, byte[] buffer, int offset, int bytes)
|
||||
{
|
||||
if (file is DecompressorImpl self)
|
||||
// Null output file means skip those bytes
|
||||
if (file == null)
|
||||
{
|
||||
return bytes;
|
||||
}
|
||||
else if (file is DecompressorImpl self)
|
||||
{
|
||||
self.State.Offset += (uint)bytes;
|
||||
if (self.State.OutputFileHandle != null)
|
||||
|
||||
@@ -86,7 +86,12 @@ namespace LibMSPackSharp.OAB
|
||||
|
||||
private static int SysWrite(object baseFile, byte[] buf, int pointer, int size)
|
||||
{
|
||||
if (baseFile is InternalFile file)
|
||||
// Null output file means skip those bytes
|
||||
if (baseFile == null)
|
||||
{
|
||||
return size;
|
||||
}
|
||||
else if (baseFile is InternalFile file)
|
||||
{
|
||||
int bytes_written = file.OrigSys.Write(file.OrigFile, buf, pointer, size);
|
||||
if (bytes_written > 0)
|
||||
@@ -100,7 +105,7 @@ namespace LibMSPackSharp.OAB
|
||||
}
|
||||
|
||||
// Unknown file to write to
|
||||
return 0;
|
||||
return -1;
|
||||
}
|
||||
|
||||
#endregion
|
||||
|
||||
@@ -252,6 +252,12 @@ namespace LibMSPackSharp
|
||||
|
||||
private static int DefaultWrite(object file, byte[] buffer, int pointer, int bytes)
|
||||
{
|
||||
// Null output file means skip those bytes
|
||||
if (file == null)
|
||||
{
|
||||
return bytes;
|
||||
}
|
||||
|
||||
FileStream self = file as FileStream;
|
||||
if (self != null && buffer != null && bytes >= 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user